Bruno Justino Praciano
Bruno Justino Praciano

Reputation: 552

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

Upvotes: 1

Views: 394

Answers (1)

Shai Katz
Shai Katz

Reputation: 1833

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

Upvotes: 2

Related Questions