Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions chart/Chart.lock
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
dependencies:
- name: postgresql
repository: ""

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you make this change in a separate PR?

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"
5 changes: 5 additions & 0 deletions chart/templates/webserver/webserver-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand Down
22 changes: 22 additions & 0 deletions chart/values.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
10 changes: 10 additions & 0 deletions chart/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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: {}

Expand Down
14 changes: 14 additions & 0 deletions tests/charts/test_webserver.py
Original file line number Diff line number Diff line change
Expand Up @@ -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={
Expand Down