add env
This commit is contained in:
parent
c9139aa850
commit
8faeee5594
@ -24,6 +24,35 @@ spec:
|
||||
volumeMounts:
|
||||
- name: data
|
||||
mountPath: /data
|
||||
env:
|
||||
{{- with .Values.env.plain }}
|
||||
{{- toYaml . | nindent 12 }}
|
||||
{{- end }}
|
||||
{{- range .Values.env.configMapKeys }}
|
||||
- name: {{ .name }}
|
||||
valueFrom:
|
||||
configMapKeyRef:
|
||||
name: {{ .configMapName }}
|
||||
key: {{ .key }}
|
||||
{{- end }}
|
||||
{{- range .Values.env.secretKeys }}
|
||||
- name: {{ .name }}
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
name: {{ .secretName }}
|
||||
key: {{ .key }}
|
||||
{{- end }}
|
||||
envFrom:
|
||||
{{- range .Values.env.configMapRefs }}
|
||||
- configMapRef:
|
||||
name: {{ .name }}
|
||||
optional: {{ .optional | default false }}
|
||||
{{- end }}
|
||||
{{- range .Values.env.secretRefs }}
|
||||
- secretRef:
|
||||
name: {{ .name }}
|
||||
optional: {{ .optional | default false }}
|
||||
{{- end }}
|
||||
volumes:
|
||||
- name: data
|
||||
persistentVolumeClaim:
|
||||
|
30
values.yaml
30
values.yaml
@ -35,3 +35,33 @@ ingress:
|
||||
# kubernetes.io/ingress.class: nginx
|
||||
# kubernetes.io/tls-acme: "true"
|
||||
# cert-manager.io/cluster-issuer: "letsencrypt-prod"
|
||||
|
||||
|
||||
# Environment variables to be passed to the container
|
||||
env:
|
||||
# Direct environment variables
|
||||
plain:
|
||||
- name: APP_NAME
|
||||
value: "my-app"
|
||||
- name: PORT
|
||||
value: "8080"
|
||||
|
||||
# Environment variables from ConfigMaps
|
||||
configMapRefs:
|
||||
- name: app-config # Reference an existing ConfigMap
|
||||
optional: true # Make it optional
|
||||
|
||||
configMapKeys:
|
||||
- name: CONFIG_KEY
|
||||
configMapName: app-config
|
||||
key: config.key
|
||||
|
||||
# Environment variables from Secrets
|
||||
secretRefs:
|
||||
- name: app-secrets # Reference an existing Secret
|
||||
optional: true # Make it optional
|
||||
|
||||
secretKeys:
|
||||
- name: API_KEY
|
||||
secretName: app-secrets
|
||||
key: api.key
|
||||
|
Loading…
Reference in New Issue
Block a user