Files
service-catalog/manifests/helm/airflow/1.16.0/templates/webserver/webserver-ingress-static.yaml
T
wbsong111 a8530d3968 airflow: OIDC 인증 제외 경로 Ingress 추가 (#24)
세션이 없는 상태로 접속하면 Airflow UI 한 페이지가 /static 자원을 수십 개
동시에 요청하고, 각 요청이 저마다 APISIX openid-connect 로그인 플로우를
시작한다. 세션은 state를 하나만 보관하므로 콜백이 동시에 돌아오면 마지막
하나를 뺀 전부가 state 검증에 실패해 500이 난다.

templates/webserver/webserver-ingress-static.yaml 은 업스트림 Apache Airflow
차트에 없는 PaaSup 추가 템플릿이다. dip.unauthenticatedPaths 가 있을 때만
애노테이션 없는 Ingress를 하나 더 렌더해 해당 경로를 인증 없이 통과시킨다.
애노테이션을 전부 비우는 것은 의도된 것으로, plugin-config-name 을 빼는 게
목적이고 cert-manager.io/* 까지 빼는 이유는 웹 Ingress와 같은 TLS Secret 을
두고 Certificate 를 중복 생성하지 않게 하기 위해서다.

값을 ingress.web 아래가 아니라 dip 아래에 두는 이유는 values.schema.json 의
ingress.web 이 additionalProperties: false 라 그 아래 새 키를 넣으면 스키마
검증에서 배포가 실패하기 때문이다. qdrant·litellm 의 dip.mainPath 와 같은
자리를 쓴다.

webserver-ingress.yaml 과 동일한 조건으로 렌더하므로 Airflow 3.0
(webserver → api-server) 전환 시 함께 재작업이 필요하다. 업스트림 파일은
수정하지 않았고 fork 델타는 신규 템플릿 1개뿐이다.

이슈 #24 는 dip-console 이 차트 밖에서 생성하는 방안(B안)을 권고했으나,
실제로 증상이 재현되는 서비스가 airflow 하나로 좁혀져 차트 템플릿(A안)으로
갔다. dip-console 로 옮길 때는 dip.unauthenticatedPaths 를 비우면 된다.

redirect_uri 고정은 여전히 dip-console 몫으로 남는다.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-18 11:19:01 +09:00

70 lines
3.0 KiB
YAML

{{/*
PaaSup 추가 템플릿 — 업스트림 Apache Airflow 차트에는 없다.
목적: APISIX openid-connect 플러그인을 우회하는 인증 제외 경로 전용 Ingress.
세션이 없는 상태에서 Airflow UI 한 페이지가 /static 자원을 수십 개 *동시에* 요청하면
각 요청이 저마다 OIDC 로그인 플로우를 시작한다. 세션은 state를 하나만 보관하므로
콜백이 동시에 돌아오면 마지막 하나를 뺀 전부가 state 검증에 실패해 500이 난다.
Airflow 웹서버는 Flask-AppBuilder 구조라 번들링 없이 CSS/JS를 개별로 받기 때문에
동시 요청 수가 커서 이 경합이 실제로 터진다 (paasup/dip-catalog#24).
이 Ingress는 애노테이션을 하나도 붙이지 않는다. 의도된 것이다:
- k8s.apisix.apache.org/plugin-config-name 미지정 → OIDC 플러그인 미적용 (이 파일의 목적)
- cert-manager.io/* 미지정 → 웹 Ingress와 같은 TLS Secret을 두고 Certificate를 중복
생성하지 않는다
tls 블록도 두지 않는다. 같은 호스트의 SNI 인증서는 웹 Ingress가 이미 제공한다.
업스트림 차트 업그레이드 시 이 파일을 함께 이관한다. webserver-ingress.yaml과 동일한
조건으로 렌더하므로 Airflow 3.0(webserver → api-server) 전환 시 함께 재작업해야 한다.
값은 ingress.web 이 아니라 dip 아래에 둔다 — values.schema.json 의 ingress.web 이
additionalProperties: false 라 그 아래 새 키를 넣으면 스키마 검증에서 배포가 실패한다.
*/}}
{{- if and .Values.webserver.enabled (semverCompare "<3.0.0" .Values.airflowVersion) }}
{{- if or .Values.ingress.web.enabled .Values.ingress.enabled }}
{{- $paths := (.Values.dip | default dict).unauthenticatedPaths }}
{{- if $paths }}
{{- $fullname := (include "airflow.fullname" .) }}
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: {{ $fullname }}-ingress-unauth
labels:
tier: airflow
component: airflow-ingress
release: {{ .Release.Name }}
chart: "{{ .Chart.Name }}-{{ .Chart.Version }}"
heritage: {{ .Release.Service }}
{{- if or (.Values.labels) (.Values.webserver.labels) }}
{{- mustMerge .Values.webserver.labels .Values.labels | toYaml | nindent 4 }}
{{- end }}
spec:
rules:
{{- range .Values.ingress.web.hosts | default (list .Values.ingress.web.host) }}
{{- $hostname := . -}}
{{- if . | kindIs "string" | not }}
{{- $hostname = .name -}}
{{- end }}
- http:
paths:
{{- range $paths }}
- path: {{ . | quote }}
pathType: Prefix
backend:
service:
name: {{ $fullname }}-webserver
port:
name: airflow-ui
{{- end }}
{{- if $hostname }}
host: {{ tpl $hostname $ | quote }}
{{- end }}
{{- end }}
{{- if .Values.ingress.web.ingressClassName }}
ingressClassName: {{ .Values.ingress.web.ingressClassName }}
{{- end }}
{{- end }}
{{- end }}
{{- end }}