Skip to content

Commit

Permalink
feat(volumes): support for secrets mounted from volumes
Browse files Browse the repository at this point in the history
  • Loading branch information
dwelch2344 committed May 23, 2024
1 parent b44387d commit ac1c72d
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 4 deletions.
2 changes: 1 addition & 1 deletion charts/nes-node-web/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ name: nes-node-web
description: A Helm chart for NES Node apps on Kubernetes

type: application
version: 0.1.6
version: 0.1.7
18 changes: 16 additions & 2 deletions charts/nes-node-web/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,12 @@ spec:
- name: {{ include "nes-node-web.fullname" . }}
image: "{{ .Values.image.repository }}:{{ required "A valid App Version must be provided to .Values.version" .Values.version }}"
imagePullPolicy: Always
{{- if .Values.volumes }}
volumeMounts:
{{- range $key, $value := .Values.volumes.mounts }}
- {{ $value | toYaml | indent 12 | trim }}
{{- end }}
{{- end }}
resources:
limits:
memory: '300Mi'
Expand Down Expand Up @@ -62,5 +68,13 @@ spec:
fieldPath: metadata.name
{{- range $key, $value := .Values.env }}
- {{ $value | toYaml | indent 12 | trim }}
{{ end }}

{{ end }}

volumes:
{{- with .Values.volumes }}
{{- range .definitions }}
- name: {{ .name }}
secret:
secretName: {{ .secret.secretName }}
{{- end }}
{{- end }}
13 changes: 12 additions & 1 deletion charts/nes-node-web/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,4 +35,15 @@ deployment:
# valueFrom:
# secretKeyRef:
# name: some-secret
# key: svc-env-value
# key: svc-env-value

# volumes:
# mounts:
# - name: example-volume
# mountPath: /home/node/app/example.json
# subPath: secret-subprop
# readOnly: true
# definitions:
# - name: example-volume
# secret:
# secretName: secret-name

0 comments on commit ac1c72d

Please sign in to comment.