How to reload open shift config yaml file automatically when config value was updated?
Current I am redeploying to reload open shift config yaml. I don't want to redeploy application one more time for a config value change?
Below is my config.yaml file. How to write a syntax to Trigger pod and redepoy pod automatically and config value got change automatically?
apiVersion: template.openshift.io/v1
kind: Template
metadata:
name: config
parameters:
- name: APPLICATION
required: true
- name: BLUE_GREEN_VERSION
required: true
- name: SQL_CONNECTION
required: true
- name: API_URL
required: true
objects:
- apiVersion: v1
kind: ConfigMap
metadata:
name: ${APPLICATION}-${BLUE_GREEN_VERSION}
data:
appsettings.json: |-
{
"ConnectionStrings": {
"SQLDB": "${SQL_CONNECTION}"
},
"URL":"${API_URL}",
"AllowedHosts": "*"
}
I was checking the watch command, and it did not behave as expected.
So I made a simple script and tested it.
Example usage will be,
In your case, would be something like the following
./watch config.yaml "oc apply -f config.yaml" 2Hope this will be helpful. And there are few 3rd party libraries that will provide more options. like entr, inotify-tools and watch exec