So, I have a yaml file that looks like this:
service:
users:
- username: some-user
password: some-pass (would be placed in Secret)
- username: some-user
password: some-pass (would be placed in Secret)
I need to add it in env (In spring boot's priority list, config from env is higher than config from yaml. And this would be env(dev,stage,live) based). I already tried this with Kustomize
configMapGenerator:
- name: my-java-server-props
files:
- config.yaml
And then using this in Deployment
envFrom:
- configMapRef:
name: my-java-server-props
Other configs in config.yml like this:
spring:
datasource:
url: some-url-here
are then add in .properties file for configMapGenerator like this:
spring_datasource_url=some-url-here
but the config with array doesn't seem to work.
any hints on where am I missing the trick? Also, the password comes from credstash; so, I have a different script which gets the value from credstash and creates a manifest for Secret.
The end goal to add passwords would be something like this in Deployment:
name: service_users.0.password
valueFrom:
secretKeyRef:
key: value
name: service-user-store-password