简体   繁体   English

如何覆盖 kubernetes 集群中的配置环境?

[英]How to override configure the environment in kubernetes cluster?

I have a spring boot application, and I created a ConfigMap of my application.proporties.我有一个 spring 引导应用程序,并创建了我的 application.proporties 的 ConfigMap。 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?例如,我该如何覆盖 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?我想通过命令行覆盖,以同样的方式覆盖值。yaml,可以这样做吗?

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.如果此 configMap 是您图表的一部分,您可以将您的秘密内容放入 {{.Values.secretStuff }} 中,然后使用您的 helm install 命令覆盖它。

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 命令将是

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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