2

我们在以下文件中指定了我们的应用程序特定属性

application.properties
application-dev.properties
application-qa.properties

在 kubernetes 中创建 configmap 时,我想将内容合并到一个文件中。可以合并内容吗?

我知道我们可以通过 kustomize 实现。但是,我们使用的是 Helm Charts,我们没有使用 kustomize。

https://github.com/kubernetes-sigs/kustomize/blob/master/examples/combineConfigs.md

4

2 回答 2

0

将 ConfigMap 文件放在一个文件夹中,然后将文件夹路径传递给kubectl命令:

kubectl create configmap config-name --from-file=path_to_the_folder

链接到:https ://kubernetes.io/docs/tasks/configure-pod-container/configure-pod-configmap/

于 2019-08-16T18:11:26.577 回答
0

试试这个简单的技巧

cat application*.properties > app.properties && kubectl create configmap myconfigmap --from-file=app.properties

您可以在掌舵图中使用 app.properties

于 2019-08-16T08:07:28.870 回答