Files
spring-cloud-kubernetes/spring-cloud-kubernetes-examples/kubernetes-reload-example
Spring Operator b0c696cc9c URL Cleanup (#357)
This commit updates URLs to prefer the https protocol. Redirects are not followed to avoid accidentally expanding intentionally shortened URLs (i.e. if using a URL shortener).

# Fixed URLs

## Fixed Success
These URLs were switched to an https URL with a 2xx status. While the status was successful, your review is still recommended.

* http://cloud.spring.io with 1 occurrences migrated to:
  https://cloud.spring.io ([https](https://cloud.spring.io) result 200).
* http://maven.apache.org/xsd/maven-4.0.0.xsd with 21 occurrences migrated to:
  https://maven.apache.org/xsd/maven-4.0.0.xsd ([https](https://maven.apache.org/xsd/maven-4.0.0.xsd) result 200).
* http://www.apache.org/licenses/LICENSE-2.0 with 14 occurrences migrated to:
  https://www.apache.org/licenses/LICENSE-2.0 ([https](https://www.apache.org/licenses/LICENSE-2.0) result 200).
* http://www.apache.org/licenses/LICENSE-2.0.txt with 1 occurrences migrated to:
  https://www.apache.org/licenses/LICENSE-2.0.txt ([https](https://www.apache.org/licenses/LICENSE-2.0.txt) result 200).
* http://www.spring.io with 1 occurrences migrated to:
  https://www.spring.io ([https](https://www.spring.io) result 301).

# Ignored
These URLs were intentionally ignored.

* http://maven.apache.org/POM/4.0.0 with 42 occurrences
* http://www.w3.org/2001/XMLSchema-instance with 21 occurrences
2019-03-16 12:05:09 -04:00
..
2016-12-16 16:00:40 -07:00
2019-03-16 12:05:09 -04:00

Kubernetes Reload Example

This example demonstrate how to use the reload feature to change the configuration of a spring-boot application at runtime.

The application consists of a timed bean that periodically prints a message to the console. The message can be changed using a config map.

Running the example

When using Openshift, you must assign the view role to the default service account in the current project:

oc policy add-role-to-user view --serviceaccount=default

You can deploy the application using the fabric8 maven plugin:

mvn clean install fabric8:build fabric8:deploy -Pintegration

Changing the configuration

Create a yaml file with the following contents:

apiVersion: v1
kind: ConfigMap
metadata:
  name: reload-example
data:
  application.properties: |-
    bean.message=Hello World!
    another.property=value

A sample config map is provided with this example in the config-map.yml file.

To deploy the config map, just run the following command on Openshift (just replace oc with kubectl if you are using plain Kubernetes):

oc create -f config-map.yml

As soon as the config map is deployed, the output of the application changes accordingly. The config map can be now edited with the following command:

oc edit configmap reload-example

Changes are applied immediately when using the event reload mode.

The name of the config map ("reload-example") matches the name of the application as declared in the application.properties file.