diff --git a/charts/airbyte/templates/_helpers.tpl b/charts/airbyte/templates/_helpers.tpl index 47b3fa6a954e6..a9db9ae199c77 100644 --- a/charts/airbyte/templates/_helpers.tpl +++ b/charts/airbyte/templates/_helpers.tpl @@ -227,3 +227,14 @@ Returns the Temporal Image. TODO: This will probably be replaced if we move to u {{- define "airbyte.temporalImage" -}} {{- include "common.images.image" (dict "imageRoot" .Values.temporal.image "global" .Values.global) -}} {{- end -}} + +{{/* +Construct comma separated list of key/value pairs from object (useful for ENV var values) +*/}} +{{- define "airbyte.flattenMap" -}} +{{- $kvList := list -}} +{{- range $key, $value := . -}} +{{- $kvList = printf "%s=%s" $key $value | mustAppend $kvList -}} +{{- end -}} +{{ join "," $kvList }} +{{- end -}} diff --git a/charts/airbyte/templates/env-configmap.yaml b/charts/airbyte/templates/env-configmap.yaml index cf49bbe47ee5d..e4eeb215a024d 100644 --- a/charts/airbyte/templates/env-configmap.yaml +++ b/charts/airbyte/templates/env-configmap.yaml @@ -21,6 +21,15 @@ data: GOOGLE_APPLICATION_CREDENTIALS: {{ include "airbyte.gcpLogCredentialsPath" . | quote }} INTERNAL_API_HOST: {{ include "common.names.fullname" . }}-server:{{ .Values.server.service.port }} IS_DEMO: {{ ternary "true" "false" .Values.webapp.isDemo | quote }} +{{- if $.Values.jobs.kube.annotations }} + JOB_KUBE_ANNOTATIONS: {{ $.Values.jobs.kube.annotations | include "airbyte.flattenMap" | quote }} +{{- end }} +{{- if $.Values.jobs.kube.nodeSelector }} + JOB_KUBE_NODE_SELECTORS: {{ $.Values.jobs.kube.nodeSelector | include "airbyte.flattenMap" | quote }} +{{- end }} +{{- if $.Values.jobs.kube.tolerations }} + JOB_KUBE_TOLERATIONS: {{ $.Values.jobs.kube.tolerations | include "airbyte.flattenMap" | quote }} +{{- end }} JOB_MAIN_CONTAINER_CPU_LIMIT: {{ ((.Values.jobs.resources | default dict).limits | default dict).cpu | default "" | quote }} JOB_MAIN_CONTAINER_CPU_REQUEST: {{ ((.Values.jobs.resources | default dict).requests | default dict).cpu | default "" | quote }} JOB_MAIN_CONTAINER_MEMORY_LIMIT: {{ ((.Values.jobs.resources | default dict).limits | default dict).memory | default "" | quote }} diff --git a/charts/airbyte/templates/worker/deployment.yaml b/charts/airbyte/templates/worker/deployment.yaml index 631a0624f8300..655dd506bac0d 100644 --- a/charts/airbyte/templates/worker/deployment.yaml +++ b/charts/airbyte/templates/worker/deployment.yaml @@ -112,16 +112,27 @@ spec: valueFrom: fieldRef: fieldPath: metadata.namespace +{{- if $.Values.jobs.kube.annotations }} - name: JOB_KUBE_ANNOTATIONS valueFrom: configMapKeyRef: name: airbyte-env key: JOB_KUBE_ANNOTATIONS +{{- end }} +{{- if $.Values.jobs.kube.nodeSelector }} - name: JOB_KUBE_NODE_SELECTORS valueFrom: configMapKeyRef: name: airbyte-env key: JOB_KUBE_NODE_SELECTORS +{{- end }} +{{- if $.Values.jobs.kube.tolerations }} + - name: JOB_KUBE_TOLERATIONS + valueFrom: + configMapKeyRef: + name: airbyte-env + key: JOB_KUBE_TOLERATIONS +{{- end }} - name: SUBMITTER_NUM_THREADS valueFrom: configMapKeyRef: diff --git a/charts/airbyte/values.yaml b/charts/airbyte/values.yaml index a524270a66927..7f288e4ea3a26 100644 --- a/charts/airbyte/values.yaml +++ b/charts/airbyte/values.yaml @@ -700,7 +700,7 @@ bootloader: repository: airbyte/bootloader pullPolicy: IfNotPresent tag: 0.36.1-alpha - + ## @param bootloader.podAnnotations [object] Add extra annotations to the bootloader pod ## podAnnotations: {} @@ -961,3 +961,19 @@ jobs: ## cpu: 200m ## memory: 1Gi limits: {} + + kube: + ## JOB_KUBE_ANNOTATIONS + ## pod annotations of the sync job and the default pod annotations fallback for others jobs + ## @params jobs.kube.annotations [object] key/value annotations applied to kube jobs + annotations: {} + + ## JOB_KUBE_NODE_SELECTORS + ## pod node selector of the sync job and the default pod node selector fallback for others jobs + ## @params jobs.kubeSelector [object] key/value node selector applied to kube jobs + nodeSelector: {} + + ## JOB_KUBE_TOLERATIONS + ## @param jobs.kube.tolerations [array] Tolerations for jobs.kube pod assignment. + ## ref: https://kubernetes.io/docs/concepts/configuration/taint-and-toleration/ + tolerations: []