From 70aa5ead1dc0bfe6392d091cbf469fe2ac657765 Mon Sep 17 00:00:00 2001 From: larrywax Date: Mon, 18 Sep 2023 10:34:50 +0200 Subject: [PATCH] create secret for serviceaccount if k8s version >= 1.24 --- charts/airbyte/templates/serviceaccount.yaml | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/charts/airbyte/templates/serviceaccount.yaml b/charts/airbyte/templates/serviceaccount.yaml index 71f9e962bf8..3ec6e022b83 100644 --- a/charts/airbyte/templates/serviceaccount.yaml +++ b/charts/airbyte/templates/serviceaccount.yaml @@ -12,6 +12,18 @@ metadata: {{- with .Values.serviceAccount.annotations }} {{- toYaml . | nindent 4 }} {{- end }} +{{- if semverCompare ">=1.24.0" .Capabilities.KubeVersion.GitVersion -}} +--- +apiVersion: v1 +kind: Secret +metadata: + name: {{ include "airbyte.serviceAccountName" . }}.service-account-token + annotations: + helm.sh/hook: pre-install,pre-upgrade + helm.sh/hook-weight: "-10" + kubernetes.io/service-account.name: {{ include "airbyte.serviceAccountName" . }} +type: kubernetes.io/service-account-token +{{- end }} --- apiVersion: rbac.authorization.k8s.io/v1 kind: Role