diff --git a/templates/deployment.yaml b/templates/deployment.yaml index ea70157..b3afc55 100644 --- a/templates/deployment.yaml +++ b/templates/deployment.yaml @@ -33,8 +33,12 @@ spec: {{- end }} {{- with $config.volumeMounts }} volumeMounts: - {{- include "common.dictToList" ( dict "keyName" "mountPath" "contents" . ) | nindent 12 -}} - {{- end -}} + {{- include "common.dictToList" ( dict "keyName" "mountPath" "contents" . ) | nindent 12 }} + {{- end }} + {{- with $config.volumeDevices }} + volumeDevices: + {{- include "common.dictToList" ( dict "keyName" "devicePath" "contents" . ) | nindent 12 }} + {{- end }} {{- end }} {{- end }} containers: diff --git a/tests/expected.yaml b/tests/expected.yaml index 38126cb..e747617 100644 --- a/tests/expected.yaml +++ b/tests/expected.yaml @@ -207,6 +207,10 @@ spec: name: my-volume subPath: data + volumeDevices: + - devicePath: /dev/xvda + name: my-device-volume + containers: - name: cc securityContext: @@ -276,6 +280,9 @@ spec: path: /heals/startup port: http volumes: + - name: my-device-volume + persistentVolumeClaim: + claimName: pvc-name - name: my-volume emptyDir: {} --- diff --git a/tests/values.yaml b/tests/values.yaml index 7b9c3a1..84daf76 100644 --- a/tests/values.yaml +++ b/tests/values.yaml @@ -78,6 +78,9 @@ services: /tmp/my-volume/data: name: my-volume subPath: data + volumeDevices: + /dev/xvda: + name: my-device-volume containers: cc: @@ -107,6 +110,9 @@ services: volumes: my-volume: emptyDir: {} + my-device-volume: + persistentVolumeClaim: + claimName: pvc-name securityContext: runAsNonRoot: true