Skip to content

Commit

Permalink
Add server.hostNetwork option
Browse files Browse the repository at this point in the history
  • Loading branch information
tomhjp committed Aug 17, 2022
1 parent 999b0b7 commit e7d9700
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 0 deletions.
1 change: 1 addition & 0 deletions templates/server-statefulset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ spec:
shareProcessNamespace: true
{{ end }}
{{- if not .Values.global.openshift }}
hostNetwork: {{ .Values.server.hostNetwork }}
securityContext:
runAsNonRoot: true
runAsGroup: {{ .Values.server.gid | default 1000 }}
Expand Down
22 changes: 22 additions & 0 deletions test/unit/server-statefulset.bats
Original file line number Diff line number Diff line change
Expand Up @@ -1723,3 +1723,25 @@ load _helpers
yq -r -c '.spec.template.spec.containers[0].env[] | select(.name == "VAULT_LICENSE_PATH")' | tee /dev/stderr)
[ "${actual}" = '' ]
}

#--------------------------------------------------------------------
# hostNetwork

@test "server/StatefulSet: server.hostNetwork not set" {
cd `chart_dir`
local actual=$(helm template \
--show-only templates/server-statefulset.yaml \
. | tee /dev/stderr |
yq -r '.spec.template.spec.hostNetwork' | tee /dev/stderr)
[ "${actual}" = "false" ]
}

@test "server/StatefulSet: server.hostNetwork is set" {
cd `chart_dir`
local actual=$(helm template \
--show-only templates/server-statefulset.yaml \
--set 'server.hostNetwork=true' \
. | tee /dev/stderr |
yq -r '.spec.template.spec.hostNetwork' | tee /dev/stderr)
[ "${actual}" = "true" ]
}
3 changes: 3 additions & 0 deletions values.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -903,6 +903,9 @@
"null",
"array"
]
},
"hostNetwork": {
"type": "boolean"
}
}
},
Expand Down
3 changes: 3 additions & 0 deletions values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -807,6 +807,9 @@ server:
# to the statefulSet.
annotations: {}

# Should the server pods run on the host network
hostNetwork: false

# Vault UI
ui:
# True if you want to create a Service entry for the Vault UI.
Expand Down

0 comments on commit e7d9700

Please sign in to comment.