Skip to content
Open
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
74 changes: 74 additions & 0 deletions templates/api-server/api-server-virtualservice.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
{{/*
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License.
*/}}

################################
## Airflow API Server VirtualService
#################################
{{- if and .Values.airflow.istio.enabled (semverCompare ">=3.0.0" .Values.airflow.airflowVersion) }}
{{- $fullname := include "airflow.fullname" . }}
apiVersion: networking.istio.io/v1
kind: VirtualService
metadata:
name: {{ $fullname }}-api-server-virtualservice
labels:
tier: airflow
component: api-server-virtualservice
release: {{ .Release.Name }}
chart: "{{ .Chart.Name }}-{{ .Chart.Version }}"
heritage: {{ .Release.Service }}
{{- with .Values.labels }}
{{- toYaml . | nindent 4 }}
{{- end }}
{{- with .Values.airflow.apiServer.labels }}
{{- toYaml . | nindent 4 }}
{{- end }}
{{- if .Values.airflow.apiServer.annotations }}
annotations: {{- toYaml .Values.airflow.apiServer.annotations | nindent 4 }}
{{- end }}
spec:
hosts:
- {{- include "deployments_subdomain" . | indent 1 }}
{{- if hasKey .Values.airflow.istio "gateway" }}
gateways:
- {{ .Values.airflow.istio.gateway }}
{{- end }}
Comment on lines +47 to +50
http:
Comment thread
pgvishnuram marked this conversation as resolved.
# API Server routes
- match:
- uri:
prefix: "/{{ .Release.Name }}/airflow"
route:
Comment on lines +45 to +56
- destination:
host: {{ $fullname }}-api-server.{{ .Release.Namespace }}.svc.cluster.local
port:
{{- if .Values.authSidecar.enabled }}
number: {{ .Values.authSidecar.port }}
{{- else }}
number: {{ .Values.airflow.ports.apiServer }}
{{- end }}
{{- if hasKey .Values.airflow.istio "virtualService" }}
{{- if hasKey .Values.airflow.istio.virtualService "timeout" }}
timeout: {{ .Values.airflow.istio.virtualService.timeout }}
{{- end }}
{{- if hasKey .Values.airflow.istio.virtualService "retries" }}
retries:
{{- toYaml .Values.airflow.istio.virtualService.retries | nindent 8 }}
{{- end }}
{{- end }}
{{- end }}
78 changes: 78 additions & 0 deletions templates/dag-deploy/dag-server-virtualservice.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
{{/*
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License.
*/}}

################################
## DAG Server VirtualService
#################################
{{- if and .Values.airflow.istio.enabled .Values.dagDeploy.enabled }}
{{- $fullname := include "airflow.fullname" . }}
apiVersion: networking.istio.io/v1
kind: VirtualService
metadata:
name: {{ $fullname }}-dag-server-virtualservice
labels:
tier: airflow
component: dag-server-virtualservice
release: {{ .Release.Name }}
chart: "{{ .Chart.Name }}-{{ .Chart.Version }}"
heritage: {{ .Release.Service }}
{{- with .Values.labels }}
{{- toYaml . | nindent 4 }}
{{- end }}
{{- with .Values.dagDeploy.labels }}
{{- toYaml . | nindent 4 }}
{{- end }}
{{- if .Values.dagDeploy.annotations }}
annotations: {{- toYaml .Values.dagDeploy.annotations | nindent 4 }}
{{- end }}
spec:
hosts:
- {{- include "deployments_subdomain" . | indent 1 }}
{{- if hasKey .Values.airflow.istio "gateway" }}
gateways:
- {{ .Values.airflow.istio.gateway }}
{{- end }}
Comment on lines +47 to +50
http:
Comment thread
pgvishnuram marked this conversation as resolved.
# DAG Server routes
- match:
- uri:
{{- if .Values.authSidecar.enabled }}
prefix: "/{{ .Release.Name }}/dags"
{{- else }}
regex: "/{{ .Release.Name }}/dags/(upload|downloads|healthz)(/.*)?"
{{- end }}
route:
- destination:
host: {{ $fullname }}-dag-server.{{ .Release.Namespace }}.svc.cluster.local
port:
{{- if .Values.authSidecar.enabled }}
number: {{ .Values.authSidecar.port }}
{{- else }}
number: {{ .Values.dagDeploy.ports.dagServerHttp }}
{{- end }}
{{- if hasKey .Values.airflow.istio "virtualService" }}
{{- if hasKey .Values.airflow.istio.virtualService "timeout" }}
timeout: {{ .Values.airflow.istio.virtualService.timeout }}
{{- end }}
{{- if hasKey .Values.airflow.istio.virtualService "retries" }}
retries:
{{- toYaml .Values.airflow.istio.virtualService.retries | nindent 8 }}
{{- end }}
{{- end }}
{{- end }}
74 changes: 74 additions & 0 deletions templates/flower/flower-virtualservice.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
{{/*
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License.
*/}}

################################
## Airflow Flower VirtualService
#################################
{{- if and .Values.airflow.istio.enabled (eq .Values.airflow.executor "CeleryExecutor") }}
{{- $fullname := include "airflow.fullname" . }}
apiVersion: networking.istio.io/v1
kind: VirtualService
metadata:
name: {{ $fullname }}-flower-virtualservice
labels:
tier: airflow
component: flower-virtualservice
release: {{ .Release.Name }}
chart: "{{ .Chart.Name }}-{{ .Chart.Version }}"
heritage: {{ .Release.Service }}
{{- with .Values.labels }}
{{- toYaml . | nindent 4 }}
{{- end }}
{{- with .Values.airflow.flower.labels }}
{{- toYaml . | nindent 4 }}
{{- end }}
{{- if .Values.airflow.flower.annotations }}
annotations: {{- toYaml .Values.airflow.flower.annotations | nindent 4 }}
{{- end }}
spec:
hosts:
- {{- include "deployments_subdomain" . | indent 1 }}
{{- if hasKey .Values.airflow.istio "gateway" }}
gateways:
- {{ .Values.airflow.istio.gateway }}
{{- end }}
Comment on lines +47 to +50
http:
Comment thread
pgvishnuram marked this conversation as resolved.
# Flower routes
- match:
- uri:
prefix: "/{{ .Release.Name }}/flower"
route:
Comment on lines +45 to +56
- destination:
host: {{ $fullname }}-flower.{{ .Release.Namespace }}.svc.cluster.local
port:
{{- if .Values.authSidecar.enabled }}
number: {{ .Values.authSidecar.port }}
{{- else }}
number: {{ .Values.airflow.ports.flowerUI }}
{{- end }}
{{- if hasKey .Values.airflow.istio "virtualService" }}
{{- if hasKey .Values.airflow.istio.virtualService "timeout" }}
timeout: {{ .Values.airflow.istio.virtualService.timeout }}
{{- end }}
{{- if hasKey .Values.airflow.istio.virtualService "retries" }}
retries:
{{- toYaml .Values.airflow.istio.virtualService.retries | nindent 8 }}
{{- end }}
{{- end }}
{{- end }}
1 change: 1 addition & 0 deletions templates/git-sync-relay/git-sync-relay-ingress.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
{{- if and
.Values.gitSyncRelay.enabled
(eq .Values.gitSyncRelay.repoFetchMode "webhook")
(not .Values.airflow.istio.enabled)
}}
Comment on lines 4 to 8
kind: Ingress
apiVersion: "networking.k8s.io/v1"
Expand Down
78 changes: 78 additions & 0 deletions templates/git-sync-relay/git-sync-relay-virtualservice.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
{{/*
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License.
*/}}

############################################
## Git Sync Relay webhook VirtualService. ##
############################################
{{- if and
.Values.gitSyncRelay.enabled .Values.airflow.istio.enabled
(eq .Values.gitSyncRelay.repoFetchMode "webhook")
}}
{{- $fullname := include "airflow.fullname" . }}
apiVersion: networking.istio.io/v1
kind: VirtualService
metadata:
name: {{ $fullname }}-git-sync-relay-virtualservice
labels:
tier: airflow
component: git-sync-relay-virtualservice
release: {{ .Release.Name }}
chart: "{{ .Chart.Name }}-{{ .Chart.Version }}"
heritage: {{ .Release.Service }}
{{- with .Values.airflow.labels }}
{{- toYaml . | nindent 4 }}
{{- end }}
{{- if .Values.gitSyncRelay.annotations }}
annotations: {{- toYaml .Values.gitSyncRelay.annotations | nindent 4 }}
{{- end }}
spec:
hosts:
- {{- include "deployments_subdomain" . | indent 1 }}
{{- if hasKey .Values.airflow.istio "gateway" }}
gateways:
- {{ .Values.airflow.istio.gateway }}
{{- end }}
Comment on lines +47 to +50
http:
Comment thread
pgvishnuram marked this conversation as resolved.
# git sync relay webhook Server routes
- match:
- uri:
{{- if and .Values.authSidecar.enabled (eq .Values.gitSyncRelay.repoFetchMode "webhook")}}
exact: "/{{ .Release.Name }}/git_sync"
{{- else }}
regex: "/{{ .Release.Name }}/git_sync(/|$)(.*)"
{{- end }}
route:
- destination:
host: {{ $fullname }}-git-sync-relay.{{ .Release.Namespace }}.svc.cluster.local
port:
{{- if and .Values.authSidecar.enabled (eq .Values.gitSyncRelay.repoFetchMode "webhook")}}
number: {{ .Values.authSidecar.port }}
{{- else }}
number: {{ .Values.gitSyncRelay.gitSync.webhookPort }}
{{- end }}
{{- if hasKey .Values.airflow.istio "virtualService" }}
{{- if hasKey .Values.airflow.istio.virtualService "timeout" }}
timeout: {{ .Values.airflow.istio.virtualService.timeout }}
{{- end }}
{{- if hasKey .Values.airflow.istio.virtualService "retries" }}
retries:
{{- toYaml .Values.airflow.istio.virtualService.retries | nindent 8 }}
{{- end }}
{{- end }}
{{- end }}
2 changes: 1 addition & 1 deletion templates/ingress.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,7 @@ spec:
{{- end }}
{{- end }}
{{- end }}
{{- if and .Values.dagDeploy.enabled }}
{{- if and .Values.dagDeploy.enabled (not .Values.airflow.istio.enabled) }}
---
kind: Ingress
apiVersion: networking.k8s.io/v1
Expand Down
74 changes: 74 additions & 0 deletions templates/webserver/webserver-virtualservice.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
{{/*
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License.
*/}}

################################
## Airflow Webserver VirtualService
#################################
{{- if and .Values.airflow.istio.enabled (semverCompare "<3.0.0" .Values.airflow.airflowVersion) }}
{{- $fullname := include "airflow.fullname" . }}
apiVersion: networking.istio.io/v1
Comment on lines +23 to +25
kind: VirtualService
metadata:
name: {{ $fullname }}-webserver-virtualservice
labels:
tier: airflow
component: webserver-virtualservice
release: {{ .Release.Name }}
chart: "{{ .Chart.Name }}-{{ .Chart.Version }}"
heritage: {{ .Release.Service }}
{{- with .Values.labels }}
{{- toYaml . | nindent 4 }}
{{- end }}
{{- with .Values.airflow.webserver.labels }}
{{- toYaml . | nindent 4 }}
{{- end }}
{{- if .Values.airflow.webserver.annotations }}
annotations: {{- toYaml .Values.airflow.webserver.annotations | nindent 4 }}
{{- end }}
spec:
hosts:
- {{- include "deployments_subdomain" . | indent 1 }}
{{- if hasKey .Values.airflow.istio "gateway" }}
gateways:
- {{ .Values.airflow.istio.gateway }}
{{- end }}
Comment on lines +47 to +50
http:
Comment thread
pgvishnuram marked this conversation as resolved.
# Webserver routes
- match:
- uri:
prefix: "/{{ .Release.Name }}/airflow"
route:
Comment on lines +45 to +56
- destination:
host: {{ $fullname }}-webserver.{{ .Release.Namespace }}.svc.cluster.local
port:
{{- if .Values.authSidecar.enabled }}
number: {{ .Values.authSidecar.port }}
{{- else }}
number: {{ .Values.airflow.ports.airflowUI }}
{{- end }}
{{- if hasKey .Values.airflow.istio "virtualService" }}
{{- if hasKey .Values.airflow.istio.virtualService "timeout" }}
timeout: {{ .Values.airflow.istio.virtualService.timeout }}
{{- end }}
{{- if hasKey .Values.airflow.istio.virtualService "retries" }}
retries:
{{- toYaml .Values.airflow.istio.virtualService.retries | nindent 8 }}
{{- end }}
{{- end }}
{{- end }}
Loading