Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: set appProtocol on Service ports (for Istio) #854

Merged
Merged
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
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 }}
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
Loading