-
Notifications
You must be signed in to change notification settings - Fork 43
Mission: ConfigMap
ID | Short Name |
---|---|
|
|
Mission that demonstrates application and runtime configuration leveraging external configuration sources. Alongside the basic means to set up a configmap and use with a specific runtime, this mission also demonstrates how changes to the configuration can be applied to services already deployed to OpenShift.
User would like to configure an application or the application runtime deployed to OpenShift.
oc client tools at version >1.4.1 (needs to support oc rollout latest)
The user has access to an OpenShift instance, and is logged in (using oc login …
)
The user has selected, or created, a project in which the application is going to be deployed.
The user deploys the configmap for the application: oc create configmap <config_name> --from-file=app-config.yml The user deploys the application using the deployment instructions. For example: mvn fabric8:deploy -Popenshift -DskipTests The user can access the application using a web page provided by the application
The user edits the configmap for the application: oc edit configmap <configmap_name> greeting.message = Bonjour %s from a ConfigMap! oc rollout latest dc/<deployment_name>
The user will create a ConfigMap within OpenShift using the provided yaml file from the booster implementation and then deploy the booster. Once deployed the user can utilize the web frontend or /api/greeting endpoint to see a greeting retrieved from the ConfigMap.
The user is then taken through editing the ConfigMap to alter the message template being used by the application, and subsequently reload the ConfigMap to make it available for use. Once reloaded the can utilize the web frontend or /api/greeting endpoint to see the updated greeting retrieved from the ConfigMap.
Lastly, the user will delete the ConfigMap and attempt to use the /api/greeting endpoint receiving an HTTP Response of 500.
-
Black box integration test, executed against the running application, validating the following actions:
-
Client HTTP GET request to
$protocol://$hostname:$port/api/greeting
returns:{“content”: “Hello World from a ConfigMap!”}
-
Client HTTP GET request to
$protocol://$hostname:$port/api/greeting?name=$name
returns:{“content”: “Hello $name from a ConfigMap!”}
-
-
Index Page located at $protocol://$hostname:$port/ contains:
-
Mission description
-
Information about and pointers to relevant code powering the implementation being used
-
Instructions for a user to execute requests against the API to see the service working in action
-
Form to invoke the service and see the result, both for no-arg and name parameter invocations.
-
-
Black box integration test, executed against the running application with no configmap present, validation the following action:
-
Client HTTP GET request to
$protocol://$hostname:$port/api/greeting
returns: HTTP 500 with a message explaining that the config map is not present.
-
In addition to the common acceptance criteria, the update of the config map should be read by the application within an acceptable time (a few seconds) without requiring a restart of the application. The test of this behavior is implemented in https://github.com/obsidian-toaster-quickstarts/rest_configmap_vertx/blob/master/src/test/java/org/obsidiantoaster/quickstart/OpenShiftIT.java#L54
For integration tests Swarm requires a config map to be present in the file system when the Pod starts (otherwise it wouldn’t). Therefore Swarm will replace an existing configmap as it will already exist
The runtimes need to support the following integration requirements:
-
Ability to read from external configuration sources during the runtime bootstrap
-
Support for yaml syntax in configuration sources
Related: Trigger re-deployment when config map changes: https://github.com/openshift/origin/issues/9146 Exp-107: Microprofile Configuration API Support https://docs.google.com/document/d/17Q9EvvEKx-NC4ystbMXlx9qMqlKB5wM7wU7d7vHTs30/edit KubeClient support for rollout latest: https://github.com/fabric8io/kubernetes-client/issues/709
PM |
☑ |
|
DevExp |
☑ |
|
Vert.x |
☑ |
|
WildFly Swarm |
☑ |
|
Spring Boot |
☑ |
|
QE |
☑ |
|
Docs |
☑ |
|
Architect |
☑ |