From e19f7bc8cba4cb5bf65ee1ac98eeee6f69549508 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Brunner?= Date: Fri, 17 Mar 2023 14:14:03 +0100 Subject: [PATCH] Add Volume Device --- templates/deployment.yaml | 8 ++++++-- tests/expected.yaml | 7 +++++++ tests/values.yaml | 6 ++++++ 3 files changed, 19 insertions(+), 2 deletions(-) diff --git a/templates/deployment.yaml b/templates/deployment.yaml index 7e5055b..a958391 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 18659f7..4c05f65 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: @@ -279,6 +283,9 @@ spec: periodSeconds: 20 timeoutSeconds: 10 volumes: + - name: my-device-volume + persistentVolumeClaim: + claimName: pvc-name - name: my-volume emptyDir: {} --- diff --git a/tests/values.yaml b/tests/values.yaml index b9e0b1a..7264757 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