Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Helm Chart: add JOB_KUBE_ANNOTATIONS andJOB_KUBE_NODE_SELECTORS #11754

Merged
merged 5 commits into from
Apr 20, 2022
Merged
Show file tree
Hide file tree
Changes from 4 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
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.0-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: []