diff --git a/chart/Chart.lock b/chart/Chart.lock index bf25c5d6c7911..cb849f9de3d20 100644 --- a/chart/Chart.lock +++ b/chart/Chart.lock @@ -1,5 +1,6 @@ dependencies: - name: postgresql + repository: "" version: 10.5.3 -digest: sha256:7104938113e866364a96f78802697be6bd121526cccbd06cae6a38827b7b36f9 -generated: "2022-06-11T22:19:11.389661+02:00" +digest: sha256:dec7bef840458bc699efeef81c709a48d837a02fbfc31da488b6d71c3733310d +generated: "2022-08-18T18:37:10.493213-03:00" diff --git a/chart/templates/webserver/webserver-deployment.yaml b/chart/templates/webserver/webserver-deployment.yaml index 0a3033a0292f1..d946fd74a928a 100644 --- a/chart/templates/webserver/webserver-deployment.yaml +++ b/chart/templates/webserver/webserver-deployment.yaml @@ -114,6 +114,11 @@ spec: {{ toYaml $tolerations | indent 8 }} topologySpreadConstraints: {{ toYaml $topologySpreadConstraints | indent 8 }} +{{- if .Values.webserver.hostAliases }} + hostAliases: +{{ toYaml .Values.webserver.hostAliases | indent 8 }} +{{- end }} + restartPolicy: Always securityContext: {{ $securityContext | nindent 8 }} {{- if or .Values.registry.secretName .Values.registry.connection }} diff --git a/chart/values.schema.json b/chart/values.schema.json index 1fd996d18ae83..048af3f716b26 100644 --- a/chart/values.schema.json +++ b/chart/values.schema.json @@ -3551,6 +3551,28 @@ "$ref": "#/definitions/io.k8s.api.core.v1.TopologySpreadConstraint" } }, + "hostAliases": { + "description": "Specify HostAliases for webserver.", + "items": { + "$ref": "#/definitions/io.k8s.api.core.v1.HostAlias" + }, + "type": "array", + "default": [], + "examples": [ + { + "ip": "127.0.0.2", + "hostnames": [ + "test.hostname.one" + ] + }, + { + "ip": "127.0.0.3", + "hostnames": [ + "test.hostname.two" + ] + } + ] + }, "podAnnotations": { "description": "Annotations to add to the webserver pods.", "type": "object", diff --git a/chart/values.yaml b/chart/values.yaml index 20edc3405611f..1067fc8ebc8d9 100644 --- a/chart/values.yaml +++ b/chart/values.yaml @@ -1015,6 +1015,16 @@ webserver: # weight: 100 tolerations: [] topologySpreadConstraints: [] + # hostAliases to use in webserver pods. + # See: + # https://kubernetes.io/docs/concepts/services-networking/add-entries-to-pod-etc-hosts-with-host-aliases/ + hostAliases: [] + # - ip: "127.0.0.2" + # hostnames: + # - "test.hostname.one" + # - ip: "127.0.0.3" + # hostnames: + # - "test.hostname.two" podAnnotations: {} diff --git a/tests/charts/test_webserver.py b/tests/charts/test_webserver.py index 53e51ffd2801f..f5beb60033755 100644 --- a/tests/charts/test_webserver.py +++ b/tests/charts/test_webserver.py @@ -151,6 +151,20 @@ def test_should_add_volume_and_volume_mount_when_exist_webserver_config(self): "readOnly": True, } in jmespath.search("spec.template.spec.containers[0].volumeMounts", docs[0]) + def test_workers_host_aliases(self): + docs = render_chart( + values={ + "executor": "CeleryExecutor", + "webserver": { + "hostAliases": [{"ip": "127.0.0.2", "hostnames": ["test.hostname"]}], + }, + }, + show_only=["templates/webserver/webserver-deployment.yaml"], + ) + + assert "127.0.0.2" == jmespath.search("spec.template.spec.hostAliases[0].ip", docs[0]) + assert "test.hostname" == jmespath.search("spec.template.spec.hostAliases[0].hostnames[0]", docs[0]) + def test_should_add_extra_containers(self): docs = render_chart( values={