I have a spring boot app that has an application YAML file (src/main/resources/).
app:
props:
-
key1: value
key2: value
-
key3: value
key4: value
-
key5: value
key6: value
I want to override the entire list of props
in the deployment's env section (k8s). is there any way to do it in Kubernetes?
CodePudding user response:
Spring will automatically allow you to override properties via environment variables.
So if you want to change key3, then all you need to do is to create an environment variable called: APP_PROPS_1_KEY3 and you can override this value. This can be done via K8.
More here: https://stackoverflow.com/a/58186093/5563263
CodePudding user response:
As per this SO, Assuming the App is deployed on Kubernetes with a Pod you can inject environment variables inside the container by either directly assigning them to the Deployment itself, or with a ConfigMap, Here in this Tutorial you have detailed info and steps about this process.
Adding the support links:
Here is the doc for :