Skip to content

Commit

Permalink
Helm Chart: add JOB_KUBE_ANNOTATIONS andJOB_KUBE_NODE_SELECTORS (#11754)
Browse files Browse the repository at this point in the history
* [helm chart] only add JOB_KUBE_ANNOTATIONS/JOB_KUBE_NODE_SELECTORS when set via values

* fix wording on values

* fix JOB_KUBE_NODE_SELECTORS, add JOB_KUBE_TOLERATIONS

Co-authored-by: Marcos Marx <marcosmarxm@users.noreply.github.com>
  • Loading branch information
2 people authored and suhomud committed May 23, 2022
1 parent a3c1d0c commit 93b7267
Show file tree
Hide file tree
Showing 4 changed files with 48 additions and 1 deletion.
11 changes: 11 additions & 0 deletions charts/airbyte/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -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 -}}
9 changes: 9 additions & 0 deletions charts/airbyte/templates/env-configmap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand Down
11 changes: 11 additions & 0 deletions charts/airbyte/templates/worker/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
18 changes: 17 additions & 1 deletion charts/airbyte/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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: {}
Expand Down Expand Up @@ -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: []

0 comments on commit 93b7267

Please sign in to comment.