Last active
April 21, 2020 10:09
-
-
Save nepomucen/14e99543652c5f5284688ff05b0b7837 to your computer and use it in GitHub Desktop.
helm template - let users introduce their custom ENVs based on ConfigMap in supported resources
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
env: | |
- name: POD_NAME | |
valueFrom: | |
fieldRef: | |
apiVersion: v1 | |
fieldPath: metadata.name | |
- name: POD_NAMESPACE | |
valueFrom: | |
fieldRef: | |
apiVersion: v1 | |
fieldPath: metadata.namespace | |
{{- if .Values.envConfigs }} | |
{{- range $key, $config := $.Values.envConfigs }} | |
- name: {{ $key }} | |
valueFrom: | |
configMapKeyRef: | |
name: {{ $config }} | |
key: {{ $key | quote }} | |
{{- end }} | |
{{- end }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# | |
# values.yaml | |
# | |
envConfigs: | |
Q3_CFG_MAP: Q3DM17 | |
Q3_CFG_TIMEOUT: 30 | |
# if empty use: | |
# envConfigs: {} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment