【发布时间】:2021-06-12 09:28:08
【问题描述】:
我使用kustomize生成各种configMap,如下例:-
# kustomization.yaml
configMapGenerator:
- name: my-config-path # <-- My original name.
files:
- file1.txt
- file2.txt
- ...
- fileN.txt
输出如下示例:-
# my-configmap.yaml
apiVersion: v1
data:
file1.txt: |
...
file2.txt: |
...
fileN.txt |
...
kind: ConfigMap
metadata:
name: my-config-path-mk89db6928 # <-- There is a hashed value appended at the end.
另一方面,我有一个第三方helm,它需要覆盖values.yaml,如下所示:-
# third-party-chart-values.yaml
customArguments:
- --config.dir=/config
...
volumes:
- mountPath: /config
name: my-config-path # <--- Here, I would like to replace with `my-config-path-mk89db6928`.
type: configMap
我们有什么方法可以将third-party-chart-values.yaml 处的my-config-path 替换为从名为my-configmap.yaml 的文件中生成的值my-config-path-mk89db6928? (注意,如果 configMap 更改了哈希值,例如 mk89db6928 也将更改。)
【问题讨论】: