Skip to content

Commit

Permalink
Allow modification of the hostNetwork parameter to avoid the need of … (
Browse files Browse the repository at this point in the history
#1046)

Allow modification of the hostNetwork parameter to avoid the need of a
dedicated pod ip.

---------

Co-authored-by: Theron Voran <[email protected]>
  • Loading branch information
shuyanl-qualtrics and tvoran authored Aug 30, 2024
1 parent 0fa7697 commit efa3ec5
Show file tree
Hide file tree
Showing 5 changed files with 36 additions and 0 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
1 change: 1 addition & 0 deletions templates/csi-daemonset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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" . }}
Expand Down
24 changes: 24 additions & 0 deletions test/unit/csi-daemonset.bats
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
3 changes: 3 additions & 0 deletions values.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,9 @@
"hmacSecretName": {
"type": "string"
},
"hostNetwork": {
"type": "boolean"
},
"image": {
"type": "object",
"properties": {
Expand Down
4 changes: 4 additions & 0 deletions values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit efa3ec5

Please sign in to comment.