From 0eef377a9cbaa019d4a95b9e972ea2a4ce57d4ac Mon Sep 17 00:00:00 2001 From: Aurelien Busutil Date: Fri, 23 Aug 2024 17:53:32 +0200 Subject: [PATCH 1/2] fix svc name --- airbyte-webapp/.githooks/pre-commit | 1 + .../templates/ingress.yaml | 62 +++++++++++++++++++ 2 files changed, 63 insertions(+) create mode 100644 charts/airbyte-workload-api-server/templates/ingress.yaml diff --git a/airbyte-webapp/.githooks/pre-commit b/airbyte-webapp/.githooks/pre-commit index f696e1bf578..349835dc84c 100755 --- a/airbyte-webapp/.githooks/pre-commit +++ b/airbyte-webapp/.githooks/pre-commit @@ -1,3 +1,4 @@ + # Find the airbyte-webapp folder (which might be either inside oss/ or on the root) if [ -d "./oss/airbyte-webapp" ]; then webappDir="./oss/airbyte-webapp" diff --git a/charts/airbyte-workload-api-server/templates/ingress.yaml b/charts/airbyte-workload-api-server/templates/ingress.yaml new file mode 100644 index 00000000000..4b7a12820f6 --- /dev/null +++ b/charts/airbyte-workload-api-server/templates/ingress.yaml @@ -0,0 +1,62 @@ +--- +{{ if .Values.ingress.enabled -}} +{{- $fullName := include "airbyte.fullname" . -}} +{{- $svcPort := .Values.service.port -}} +{{- if and .Values.ingress.className (not (semverCompare ">=1.18-0" .Capabilities.KubeVersion.GitVersion)) }} + {{- if not (hasKey .Values.ingress.annotations "kubernetes.io/ingress.class") }} + {{- $_ := set .Values.ingress.annotations "kubernetes.io/ingress.class" .Values.ingress.className}} + {{- end }} +{{- end }} +{{- if semverCompare ">=1.19-0" .Capabilities.KubeVersion.GitVersion -}} +apiVersion: networking.k8s.io/v1 +{{- else if semverCompare ">=1.14-0" .Capabilities.KubeVersion.GitVersion -}} +apiVersion: networking.k8s.io/v1beta1 +{{- else -}} +apiVersion: extensions/v1beta1 +{{- end }} +kind: Ingress +metadata: + name: {{ $fullName }} + labels: + {{- include "airbyte.labels" . | nindent 4 }} + {{- with .Values.ingress.annotations }} + annotations: + {{- toYaml . | nindent 4 }} + {{- end }} +spec: + {{- if and .Values.ingress.className (semverCompare ">=1.18-0" .Capabilities.KubeVersion.GitVersion) }} + ingressClassName: {{ .Values.ingress.className }} + {{- end }} + {{- if .Values.ingress.tls }} + tls: + {{- range .Values.ingress.tls }} + - hosts: + {{- range .hosts }} + - {{ . | quote }} + {{- end }} + secretName: {{ .secretName }} + {{- end }} + {{- end }} + rules: + {{- range .Values.ingress.hosts }} + - host: {{ .host | quote }} + http: + paths: + {{- range .paths }} + - path: {{ .path }} + {{- if and .pathType (semverCompare ">=1.18-0" $.Capabilities.KubeVersion.GitVersion) }} + pathType: {{ .pathType }} + {{- end }} + backend: + {{- if semverCompare ">=1.19-0" $.Capabilities.KubeVersion.GitVersion }} + service: + name: {{ $.Release.Name }}-airbyte-workload-api-server-svc + port: + number: {{ $svcPort }} + {{- else }} + serviceName: {{ $fullName }}-svc + servicePort: {{ $svcPort }} + {{- end }} + {{- end }} + {{- end }} +{{- end }} From baa45a0ac027c72989398608ee8375e12e0e15ea Mon Sep 17 00:00:00 2001 From: Aurelien Busutil Date: Fri, 23 Aug 2024 17:55:12 +0200 Subject: [PATCH 2/2] revert precommit --- airbyte-webapp/.githooks/pre-commit | 1 - 1 file changed, 1 deletion(-) diff --git a/airbyte-webapp/.githooks/pre-commit b/airbyte-webapp/.githooks/pre-commit index 349835dc84c..f696e1bf578 100755 --- a/airbyte-webapp/.githooks/pre-commit +++ b/airbyte-webapp/.githooks/pre-commit @@ -1,4 +1,3 @@ - # Find the airbyte-webapp folder (which might be either inside oss/ or on the root) if [ -d "./oss/airbyte-webapp" ]; then webappDir="./oss/airbyte-webapp"