Add server.hostNetwork option (#775)

This commit is contained in:
Tom Proctor 2022-09-12 15:17:24 +01:00 committed by GitHub
parent c15d83e397
commit 7e21a09ebd
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 32 additions and 1 deletions

View file

@ -49,6 +49,10 @@ spec:
shareProcessNamespace: true shareProcessNamespace: true
{{ end }} {{ end }}
{{- template "server.statefulSet.securityContext.pod" . }} {{- template "server.statefulSet.securityContext.pod" . }}
{{- if not .Values.global.openshift }}
hostNetwork: {{ .Values.server.hostNetwork }}
{{- end }}
volumes: volumes:
{{ template "vault.volumes" . }} {{ template "vault.volumes" . }}
- name: home - name: home

View file

@ -1784,3 +1784,25 @@ load _helpers
yq -r '.spec.template.spec.containers[0].securityContext.foo' | tee /dev/stderr) yq -r '.spec.template.spec.containers[0].securityContext.foo' | tee /dev/stderr)
[ "${actual}" = "bar" ] [ "${actual}" = "bar" ]
} }
#--------------------------------------------------------------------
# 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" ]
}

View file

@ -979,6 +979,9 @@
"null", "null",
"array" "array"
] ]
},
"hostNetwork": {
"type": "boolean"
} }
} }
}, },

View file

@ -876,6 +876,8 @@ server:
pod: {} pod: {}
container: {} container: {}
# Should the server pods run on the host network
hostNetwork: false
# Vault UI # Vault UI
ui: ui: