diff --git a/CHANGELOG.md b/CHANGELOG.md index 98aa02038..07c1ef0cd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,10 @@ Changes: * Default `vault` version updated to 1.17.3 * Default `vault-csi-provider` version updated to 1.5.0 +Features: + +* csi: Allow modification of the hostNetwork parameter on the DaemonSet [GH-1046](https://github.com/hashicorp/vault-helm/pull/1046) + Bugs: * Properly handle JSON formatted server config [GH-1049](https://github.com/hashicorp/vault-helm/pull/1049) diff --git a/templates/csi-daemonset.yaml b/templates/csi-daemonset.yaml index b019f3dc4..aacce0a27 100644 --- a/templates/csi-daemonset.yaml +++ b/templates/csi-daemonset.yaml @@ -43,6 +43,7 @@ spec: {{- if .Values.csi.priorityClassName }} priorityClassName: {{ .Values.csi.priorityClassName }} {{- end }} + hostNetwork: {{ .Values.csi.hostNetwork }} serviceAccountName: {{ template "vault.fullname" . }}-csi-provider {{- template "csi.pod.tolerations" . }} {{- template "csi.pod.nodeselector" . }} diff --git a/test/unit/csi-daemonset.bats b/test/unit/csi-daemonset.bats index b603b745a..d536a4085 100644 --- a/test/unit/csi-daemonset.bats +++ b/test/unit/csi-daemonset.bats @@ -561,6 +561,30 @@ load _helpers [ "${actual}" = "true" ] } +#-------------------------------------------------------------------- +# hostNetwork + +@test "csi/daemonset: csi.hostNetwork not set" { + cd `chart_dir` + local actual=$(helm template \ + --show-only templates/csi-daemonset.yaml \ + --set 'csi.enabled=true' \ + . | tee /dev/stderr | + yq -r '.spec.template.spec.hostNetwork' | tee /dev/stderr) + [ "${actual}" = "false" ] +} + +@test "csi/daemonset: csi.hostNetwork is set" { + cd `chart_dir` + local actual=$(helm template \ + --show-only templates/csi-daemonset.yaml \ + --set 'csi.enabled=true' \ + --set 'csi.hostNetwork=true' \ + . | tee /dev/stderr | + yq -r '.spec.template.spec.hostNetwork' | tee /dev/stderr) + [ "${actual}" = "true" ] +} + #-------------------------------------------------------------------- # Readiness/liveness probes diff --git a/values.schema.json b/values.schema.json index 34d413179..b361ef4d9 100644 --- a/values.schema.json +++ b/values.schema.json @@ -102,6 +102,9 @@ "hmacSecretName": { "type": "string" }, + "hostNetwork": { + "type": "boolean" + }, "image": { "type": "object", "properties": { diff --git a/values.yaml b/values.yaml index f46e5fdbd..0f45050b0 100644 --- a/values.yaml +++ b/values.yaml @@ -1120,6 +1120,10 @@ csi: # generating secret versions. hmacSecretName: "" + # Allow modification of the hostNetwork parameter to avoid the need of a + # dedicated pod ip + hostNetwork: false + # Settings for the daemonSet used to run the provider. daemonSet: updateStrategy: