Skip to content

Commit

Permalink
support most common usecase for mounting configmaps as files (#83)
Browse files Browse the repository at this point in the history
* support most common usecase for mounting configmaps as files
  • Loading branch information
whereismyjetpack authored Sep 9, 2024
1 parent b506127 commit f5e162d
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 3 deletions.
2 changes: 1 addition & 1 deletion charts/application-core/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ type: application
# This is the chart version. This version number should be incremented each time you make changes
# to the chart and its templates, including the app version.
# Versions are expected to follow Semantic Versioning (https://semver.org/)
version: 4.2.1
version: 4.2.2

maintainers:
- name: Dominic DePasquale
21 changes: 19 additions & 2 deletions charts/application-core/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -154,8 +154,20 @@ spec:
{{- end }}
resources:
{{- toYaml .Values.resources | nindent 12 }}
{{- if .Values.emptyDir }}
volumeMounts:
{{- range $volume := .Values.extraConfigMapVolumes }}
- mountPath: "{{ .mountPath }}"
name: "{{ .name }}"
{{- if eq .readOnly false }}
readOnly: false
{{- else }}
readOnly: true
{{- end }}
{{- if .subPath }}
subPath: "{{ .subPath }}"
{{- end }}
{{- end }}
{{- if .Values.emptyDir }}
- mountPath: {{ .Values.emptyDir.mountPath }}
name: emptydir-volume
{{- end }}
Expand Down Expand Up @@ -190,8 +202,13 @@ spec:
tolerations:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- if .Values.emptyDir }}
volumes:
{{- range $volume := .Values.extraConfigMapVolumes }}
- name: {{ .name }}
configMap:
name: {{ .name }}
{{- end }}
{{- if .Values.emptyDir }}
- name: emptydir-volume
emptyDir:
sizeLimit: {{ .Values.emptyDir.sizeLimit }}
Expand Down
10 changes: 10 additions & 0 deletions charts/application-core/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,16 @@ env:
extraConfigMaps: []
extraSecrets: []

# Mount ConfigMaps as files in the Deployment
# Mount ca-bundle.pem from ca-cert-configmap to /etc/ssl/certs/ca-bundle.pem
# - name: ca-cert-configmap
# mountPath: /etc/ssl/certs/ca-bundle.pem
# subPath: ca-bundle.pem
# Mount all keys from ca-cert-configmap as files to /etc/ssl/certs
# - name: ca-cert-configmap
# mountPath: /etc/ssl/certs/
extraConfigMapVolumes: []

externalSecret:
enabled: false
# data:
Expand Down

0 comments on commit f5e162d

Please sign in to comment.