Draft for secret file mount
This commit is contained in:
@@ -71,6 +71,11 @@ spec:
|
||||
- name: {{ .name }}
|
||||
mountPath: {{ .path }}
|
||||
{{- end }}
|
||||
{{- range .Values.volumesFromSecretFiles }}
|
||||
- name: {{ .name }}
|
||||
mountPath: {{ .path }}
|
||||
readOnly: true
|
||||
{{- end }}
|
||||
resources:
|
||||
{{- toYaml .Values.resources | nindent 12 }}
|
||||
volumes:
|
||||
@@ -79,6 +84,11 @@ spec:
|
||||
persistentVolumeClaim:
|
||||
claimName: {{ printf "%s-%s" $.Release.Name .name }}
|
||||
{{- end }}
|
||||
{{- range .Values.volumesFromSecretFiles }}
|
||||
- name: {{ .name }}
|
||||
secret:
|
||||
secretName: {{ .name }}
|
||||
{{- end }}
|
||||
{{- with .Values.nodeSelector }}
|
||||
nodeSelector:
|
||||
{{- toYaml . | nindent 8 }}
|
||||
|
||||
@@ -0,0 +1,32 @@
|
||||
suite: test deployment
|
||||
templates:
|
||||
- deployment.yaml
|
||||
- configmap.yaml
|
||||
tests:
|
||||
- it: Should mount volume
|
||||
set:
|
||||
volumesFromSecretFiles:
|
||||
- name: google-account-key
|
||||
path: /google-account-key
|
||||
filesToMount:
|
||||
- name: key.json
|
||||
sourcePath: my-google-acoount-key.json
|
||||
asserts:
|
||||
- equal:
|
||||
path: spec.template.spec.containers[0].volumeMounts
|
||||
value:
|
||||
- name: google-account-key
|
||||
mountPath: /google-account-key
|
||||
readOnly: true
|
||||
- it: Should reference volume
|
||||
set:
|
||||
volumesFromSecretFiles:
|
||||
- name: google-account-key
|
||||
path: /google-account-key
|
||||
asserts:
|
||||
- equal:
|
||||
path: spec.template.spec.volumes
|
||||
value:
|
||||
- name: google-account-key
|
||||
secret:
|
||||
secretName: google-account-key
|
||||
Reference in New Issue
Block a user