Skip to content

Commit

Permalink
Add hostAliases support for Triggerer in helm chart (#41725)
Browse files Browse the repository at this point in the history
  • Loading branch information
HassanAlahmed authored Aug 28, 2024
1 parent 45740b1 commit e55ecd5
Show file tree
Hide file tree
Showing 4 changed files with 47 additions and 0 deletions.
3 changes: 3 additions & 0 deletions chart/templates/triggerer/triggerer-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,9 @@ spec:
{{- end }}
tolerations: {{- toYaml $tolerations | nindent 8 }}
topologySpreadConstraints: {{- toYaml $topologySpreadConstraints | nindent 8 }}
{{- if .Values.triggerer.hostAliases }}
hostAliases: {{- toYaml .Values.triggerer.hostAliases | nindent 8 }}
{{- end }}
terminationGracePeriodSeconds: {{ .Values.triggerer.terminationGracePeriodSeconds }}
restartPolicy: Always
serviceAccountName: {{ include "triggerer.serviceAccountName" . }}
Expand Down
22 changes: 22 additions & 0 deletions chart/values.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -2806,6 +2806,28 @@
"type": "boolean",
"default": true
},
"hostAliases": {
"description": "HostAliases for the triggerer pod.",
"items": {
"$ref": "#/definitions/io.k8s.api.core.v1.HostAlias"
},
"type": "array",
"default": [],
"examples": [
{
"ip": "127.0.0.1",
"hostnames": [
"foo.local"
]
},
{
"ip": "10.1.2.3",
"hostnames": [
"foo.remote"
]
}
]
},
"livenessProbe": {
"description": "Liveness probe configuration for triggerer.",
"type": "object",
Expand Down
9 changes: 9 additions & 0 deletions chart/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1623,6 +1623,15 @@ triggerer:
tolerations: []
topologySpreadConstraints: []

# hostAliases for the triggerer pod
hostAliases: []
# - ip: "127.0.0.1"
# hostnames:
# - "foo.local"
# - ip: "10.1.2.3"
# hostnames:
# - "foo.remote"

priorityClassName: ~

# annotations for the triggerer deployment
Expand Down
13 changes: 13 additions & 0 deletions helm_tests/airflow_core/test_triggerer.py
Original file line number Diff line number Diff line change
Expand Up @@ -638,6 +638,19 @@ def test_should_add_component_specific_annotations(self):
assert "annotations" in jmespath.search("metadata", docs[0])
assert jmespath.search("metadata.annotations", docs[0])["test_annotation"] == "test_annotation_value"

def test_triggerer_pod_hostaliases(self):
docs = render_chart(
values={
"triggerer": {
"hostAliases": [{"ip": "127.0.0.1", "hostnames": ["foo.local"]}],
},
},
show_only=["templates/triggerer/triggerer-deployment.yaml"],
)

assert "127.0.0.1" == jmespath.search("spec.template.spec.hostAliases[0].ip", docs[0])
assert "foo.local" == jmespath.search("spec.template.spec.hostAliases[0].hostnames[0]", docs[0])

def test_triggerer_template_storage_class_name(self):
docs = render_chart(
values={"triggerer": {"persistence": {"storageClassName": "{{ .Release.Name }}-storage-class"}}},
Expand Down

0 comments on commit e55ecd5

Please sign in to comment.