Search code examples
springspring-bootkubernetesazure-devopskubernetes-helm

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

Solution

  • 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