feat: add hostAliases for statefulset (#955)
This commit is contained in:
parent
c3b2b14ffd
commit
3387881451
4 changed files with 34 additions and 1 deletions
|
@ -61,6 +61,10 @@ spec:
|
||||||
{{ template "vault.volumes" . }}
|
{{ template "vault.volumes" . }}
|
||||||
- name: home
|
- name: home
|
||||||
emptyDir: {}
|
emptyDir: {}
|
||||||
|
{{- if .Values.server.hostAliases }}
|
||||||
|
hostAliases:
|
||||||
|
{{ toYaml .Values.server.hostAliases | nindent 8}}
|
||||||
|
{{- end }}
|
||||||
{{- if .Values.server.extraInitContainers }}
|
{{- if .Values.server.extraInitContainers }}
|
||||||
initContainers:
|
initContainers:
|
||||||
{{ toYaml .Values.server.extraInitContainers | nindent 8}}
|
{{ toYaml .Values.server.extraInitContainers | nindent 8}}
|
||||||
|
|
|
@ -1826,6 +1826,28 @@ load _helpers
|
||||||
[ "${actual}" = "true" ]
|
[ "${actual}" = "true" ]
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#--------------------------------------------------------------------
|
||||||
|
# hostAliases
|
||||||
|
|
||||||
|
@test "server/StatefulSet: server.hostAliases not set" {
|
||||||
|
cd `chart_dir`
|
||||||
|
local actual=$(helm template \
|
||||||
|
--show-only templates/server-statefulset.yaml \
|
||||||
|
. | tee /dev/stderr |
|
||||||
|
yq -r '.spec.template.spec.hostAliases' | tee /dev/stderr)
|
||||||
|
[ "${actual}" = "null" ]
|
||||||
|
}
|
||||||
|
|
||||||
|
@test "server/StatefulSet: server.hostAliases is set" {
|
||||||
|
cd `chart_dir`
|
||||||
|
local actual=$(helm template \
|
||||||
|
--show-only templates/server-statefulset.yaml \
|
||||||
|
--set 'server.hostAliases[0]=foo' \
|
||||||
|
. | tee /dev/stderr |
|
||||||
|
yq -r '.spec.template.spec.hostAliases[]' | tee /dev/stderr)
|
||||||
|
[ "${actual}" = "foo" ]
|
||||||
|
}
|
||||||
|
|
||||||
#--------------------------------------------------------------------
|
#--------------------------------------------------------------------
|
||||||
# extraPorts
|
# extraPorts
|
||||||
|
|
||||||
|
|
|
@ -740,6 +740,9 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"hostAliases": {
|
||||||
|
"type": "array"
|
||||||
|
},
|
||||||
"image": {
|
"image": {
|
||||||
"type": "object",
|
"type": "object",
|
||||||
"properties": {
|
"properties": {
|
||||||
|
|
|
@ -444,7 +444,11 @@ server:
|
||||||
# - secretName: chart-example-tls
|
# - secretName: chart-example-tls
|
||||||
# hosts:
|
# hosts:
|
||||||
# - chart-example.local
|
# - chart-example.local
|
||||||
|
# hostAliases is a list of aliases to be added to /etc/hosts. Specified as a YAML list.
|
||||||
|
hostAliases: []
|
||||||
|
# - ip: 127.0.0.1
|
||||||
|
# hostnames:
|
||||||
|
# - chart-example.local
|
||||||
# OpenShift only - create a route to expose the service
|
# OpenShift only - create a route to expose the service
|
||||||
# By default the created route will be of type passthrough
|
# By default the created route will be of type passthrough
|
||||||
route:
|
route:
|
||||||
|
|
Loading…
Reference in a new issue