Skip to content

Commit

Permalink
fix: set appProtocol on Service ports (for Istio) (#854)
Browse files Browse the repository at this point in the history
Signed-off-by: Mathew Wicks <5735406+thesuperzapper@users.noreply.github.com>
  • Loading branch information
thesuperzapper authored May 1, 2024
1 parent d645492 commit b846fcd
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 1 deletion.
15 changes: 14 additions & 1 deletion charts/airflow/templates/_helpers/common.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,8 @@ true
{{- end -}}
{{/*
The scheme (HTTP, HTTPS) used by the webserver
The scheme (HTTP, HTTPS) used by the webserver.
NOTE: this is used in the liveness/readiness probes of the webserver
*/}}
{{- define "airflow.web.scheme" -}}
{{- if and (.Values.airflow.config.AIRFLOW__WEBSERVER__WEB_SERVER_SSL_CERT) (.Values.airflow.config.AIRFLOW__WEBSERVER__WEB_SERVER_SSL_KEY) -}}
Expand All @@ -72,6 +73,18 @@ HTTP
{{- end -}}
{{- end -}}
{{/*
The app protocol used by the webserver.
NOTE: this sets the `appProtocol` of the Service port (only important for Istio users)
*/}}
{{- define "airflow.web.appProtocol" -}}
{{- if and (.Values.airflow.config.AIRFLOW__WEBSERVER__WEB_SERVER_SSL_CERT) (.Values.airflow.config.AIRFLOW__WEBSERVER__WEB_SERVER_SSL_KEY) -}}
https
{{- else -}}
http
{{- end -}}
{{- end -}}
{{/*
The path containing DAG files
*/}}
Expand Down
2 changes: 2 additions & 0 deletions charts/airflow/templates/flower/flower-service.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ spec:
release: {{ .Release.Name }}
ports:
- name: flower
## NOTE: flower always uses http (only important for Istio users)
appProtocol: http
protocol: TCP
port: {{ .Values.flower.service.externalPort }}
{{- if and (eq .Values.flower.service.type "NodePort") (.Values.flower.service.nodePort.http) }}
Expand Down
2 changes: 2 additions & 0 deletions charts/airflow/templates/pgbouncer/pgbouncer-service.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ spec:
release: {{ .Release.Name }}
ports:
- name: pgbouncer
## NOTE: pgbouncer should be treated as opaque TCP (only important for Istio users)
appProtocol: tcp
protocol: TCP
port: 6432
{{- end }}
1 change: 1 addition & 0 deletions charts/airflow/templates/webserver/webserver-service.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ spec:
{{- end }}
ports:
- name: web
appProtocol: {{ include "airflow.web.appProtocol" . | quote }}
protocol: TCP
port: {{ .Values.web.service.externalPort | default 8080 }}
{{- if and (eq .Values.web.service.type "NodePort") (.Values.web.service.nodePort.http) }}
Expand Down
3 changes: 3 additions & 0 deletions charts/airflow/templates/worker/worker-service.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ metadata:
spec:
ports:
- name: worker
## NOTE: the worker logs port is always http (only important for Istio users)
## https://github.com/apache/airflow/blob/2.9.0/airflow/utils/log/file_task_handler.py#L415
appProtocol: http
protocol: TCP
port: 8793
clusterIP: None
Expand Down

0 comments on commit b846fcd

Please sign in to comment.