简体   繁体   中英

How to override configure the environment in kubernetes cluster?

I have a spring boot application, and I created a ConfigMap of my application.proporties. I have some passwords and other sensible date in this file and I would to override some infos there. How can I do for example to override the elasticsearch.url? I would like to override via command line, in the same way to override the values.yaml, is it possible to do this?

kind: ConfigMap
apiVersion: v1
metadata:
  name: application
data:
  application.properties: |-
    server.port = 8080
    elasticsearch.baseuri = url

If this configMap is part of your chart your can just put your secret stuff inside {{.Values.secretStuff }} and then override it with your helm install command.

Example configMap:

kind: ConfigMap
apiVersion: v1
metadata:
  name: application
data:
  application.properties: |-
    server.port = 8080
    elasticsearch.baseuri = {{ .Values.elasticSearch.baseUri}}

And your helm install command will be

helm install chart./mychart --set elasticSearch.baseUri=some-super-secret-stuff

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM