Skip to content

Commit

Permalink
feat: Update oss charts (#15719)
Browse files Browse the repository at this point in the history
* fix: revert extraEnv delition in values.yaml for bootloader

* add newline

* feat: Update bootloader,webapp,server. Add way of defining secrets, update extraEnv usage. Add PodDistributionBudget into all deployments

* feat: Update oss charts, make them able to be ingested in cloud deployment

* fix: include #15685 changes

* fix: Update Chart.yaml. fix minio deployment conditional operator

* fix: fix EOF in worker, update worker HPA conditional

* fix: remove cloud related stuff

* fix: add conditional for hooks

* fix: remove hooks for worker

* fix: update nit, remove gsm

* fix: fix nits

* fix: remove gsm and hpa from values.yaml
  • Loading branch information
xpuska513 authored Aug 19, 2022
1 parent afbe584 commit 626f51f
Show file tree
Hide file tree
Showing 17 changed files with 214 additions and 34 deletions.
23 changes: 23 additions & 0 deletions charts/airbyte-bootloader/templates/bootloader-secrets.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Create secrets only for the local deployment
{{- if .Values.secrets }}
apiVersion: v1
kind: Secret
metadata:
name: bootloader-secrets
labels:
app.kubernetes.io/name: {{ include "airbyte.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
helm.sh/chart: {{ include "airbyte.chart" . }}
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
app.airbyte.io/fullname: {{ include "airbyte.fullname" . }}
annotations:
helm.sh/hook: pre-install,pre-upgrade
helm.sh/hook-weight: "-1"

type: Opaque
data:
{{- range $k, $v := mergeOverwrite .Values.secrets .Values.global.secrets }}
{{ $k }}: {{ if $v }}{{ $v | b64enc }} {{else}}""{{end}}
{{- end }}
{{- end }}
20 changes: 17 additions & 3 deletions charts/airbyte-bootloader/templates/pod.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,22 @@ spec:
name: {{ .Values.global.configMapName | default (printf "%s-airbyte-secrets" .Release.Name) }}
key: DATABASE_USER
{{- end }}
{{- if .Values.extraEnv }}
{{ .Values.extraEnv | toYaml | nindent 10 }}
# Values from secret
{{- if .Values.secrets }}
{{- range $k, $v := .Values.secrets }}
- name: {{ $k }}
valueFrom:
secretKeyRef:
name: bootloader-secrets
key: {{ $k }}
{{- end }}
{{- end }}

resources: {{- toYaml .Values.resources | nindent 8 }}
# Values from env
{{- if .Values.extraEnv }}
{{- range $k, $v := mergeOverwrite .Values.extraEnv .Values.global.env_vars }}
- name: {{ $k }}
value: {{ $v | quote }}
{{- end }}
{{- end }}
resources: {{- toYaml .Values.resources | nindent 8 }}
7 changes: 6 additions & 1 deletion charts/airbyte-bootloader/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ global:
database:
secretName: ""
secretValue: ""
secrets: {}
env_vars: {}


enabled: true
Expand Down Expand Up @@ -61,4 +63,7 @@ resources:
## ref: https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node/#affinity-and-anti-affinity
##
affinity: {}
extraEnv: []
extraEnv: {}
secrets: {}


41 changes: 30 additions & 11 deletions charts/airbyte-server/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -130,26 +130,24 @@ spec:
configMapKeyRef:
name: {{ .Release.Name }}-airbyte-env
key: S3_LOG_BUCKET_REGION
{{- if and .Values.global.logs.accessKey.existingSecret .Values.global.logs.accessKey.existingSecretKey }}
{{- if and .Values.global.logs.accessKey.existingSecret .Values.global.logs.secretKey.existingSecretKey }}
- name: AWS_ACCESS_KEY_ID
valueFrom:
secretKeyRef:
name: {{ .Values.global.logs.accessKey.existingSecret }}
key: {{ .Values.global.logs.accessKey.existingSecretKey }}
{{- else }}
- name: AWS_ACCESS_KEY_ID
valueFrom:
secretKeyRef:
name: {{ .Release.Name }}-minio
key: root-user
{{- end }}
{{- if and .Values.global.logs.secretKey.existingSecret .Values.global.logs.secretKey.existingSecretKey }}
- name: AWS_SECRET_ACCESS_KEY
valueFrom:
secretKeyRef:
name: {{ .Values.global.logs.secretKey.existingSecret }}
key: {{ .Values.global.logs.secretKey.existingSecretKey }}
{{- else }}
{{- end }}
{{- if or .Values.global.logs.minio.enabled .Values.global.logs.externalMinio.enabled }}
- name: AWS_ACCESS_KEY_ID
valueFrom:
secretKeyRef:
name: {{ .Release.Name }}-minio
key: root-user
- name: AWS_SECRET_ACCESS_KEY
valueFrom:
secretKeyRef:
Expand Down Expand Up @@ -187,9 +185,25 @@ spec:
name: {{ .Release.Name }}-airbyte-env
key: JOBS_DATABASE_MINIMUM_FLYWAY_MIGRATION_VERSION
{{- end }}
# Values from secret
{{- if .Values.secrets }}
{{- range $k, $v := .Values.secrets }}
- name: {{ $k }}
valueFrom:
secretKeyRef:
name: server-secrets
key: {{ $k }}
{{- end }}
{{- end }}

# Values from env
{{- if .Values.extraEnv }}
{{ .Values.extraEnv | toYaml | nindent 10 }}
{{- range $k, $v := mergeOverwrite .Values.extraEnv .Values.global.env_vars }}
- name: {{ $k }}
value: {{ $v | quote }}
{{- end }}
{{- end }}

{{- if .Values.livenessProbe.enabled }}
livenessProbe:
httpGet:
Expand Down Expand Up @@ -223,9 +237,12 @@ spec:
securityContext: {{- toYaml .Values.containerSecurityContext | nindent 10 }}
{{- end }}
volumeMounts:
{{- if eq .Values.deploymentMode "oss" }}
- name: gcs-log-creds-volume
mountPath: /secrets/gcs-log-creds
readOnly: true
{{- end }}

{{- if .Values.extraVolumeMounts }}
{{ toYaml .Values.extraVolumeMounts | nindent 8 }}
{{- end }}
Expand All @@ -236,9 +253,11 @@ spec:
{{ toYaml .Values.global.extraContainers | indent 8 }}
{{- end }}
volumes:
{{- if eq .Values.deploymentMode "oss" }}
- name: gcs-log-creds-volume
secret:
secretName: {{ ternary (printf "%s-gcs-log-creds" ( .Release.Name )) (.Values.global.credVolumeOverride) (eq .Values.global.deploymentMode "oss") }}
{{- end }}
{{- if .Values.extraVolumes }}
{{ toYaml .Values.extraVolumes | nindent 6 }}
{{- end }}
20 changes: 20 additions & 0 deletions charts/airbyte-server/templates/secrets.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Create secrets only for the local deployment
{{- if .Values.secrets }}
apiVersion: v1
kind: Secret
metadata:
name: server-secrets
labels:
app.kubernetes.io/name: {{ include "airbyte.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
helm.sh/chart: {{ include "airbyte.chart" . }}
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
app.airbyte.io/fullname: {{ include "airbyte.fullname" . }}
annotations:
type: Opaque
data:
{{- range $k, $v := mergeOverwrite .Values.secrets .Values.global.secrets }}
{{ $k }}: {{ if $v }}{{ $v | b64enc }} {{else}}""{{end}}
{{- end }}
{{- end }}
2 changes: 1 addition & 1 deletion charts/airbyte-server/templates/service.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
apiVersion: v1
kind: Service
metadata:
name: {{ include "common.names.fullname" . }}
name: airbyte-server-svc
spec:
type: {{ .Values.service.type }}
ports:
Expand Down
6 changes: 4 additions & 2 deletions charts/airbyte-server/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ log:
## extraEnv:
## - name: SAMPLE_ENV_VAR
## value: "key=sample-value"
extraEnv: []
extraEnv: {}

## @param server.extraVolumeMounts [array] Additional volumeMounts for server container(s).
## Examples (when using `server.containerSecurityContext.readOnlyRootFilesystem=true`):
Expand All @@ -185,4 +185,6 @@ extraVolumes: []

extraContainers: []

extraInitContainers: []
extraInitContainers: []

secrets: {}
23 changes: 22 additions & 1 deletion charts/airbyte-webapp/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,23 @@ spec:
name: {{ .Release.Name }}-airbyte-env
key: INTERNAL_API_HOST
{{- end }}
# Values from secret
{{- if .Values.secrets }}
{{- range $k, $v := .Values.secrets }}
- name: {{ $k }}
valueFrom:
secretKeyRef:
name: webapp-secrets
key: {{ $k }}
{{- end }}
{{- end }}

# Values from env
{{- if .Values.extraEnv }}
{{ .Values.extraEnv | toYaml | nindent 10 }}
{{- range $k, $v := mergeOverwrite .Values.extraEnv .Values.global.env_vars }}
- name: {{ $k }}
value: {{ $v | quote }}
{{- end }}
{{- end }}
{{- if .Values.livenessProbe.enabled }}
livenessProbe:
Expand Down Expand Up @@ -114,6 +129,9 @@ spec:
{{- if .Values.extraVolumeMounts }}
{{ toYaml .Values.extraVolumeMounts | nindent 8 }}
{{- end }}
{{- if .Values.global.extraVolumeMounts }}
{{ toYaml .Values.global.extraVolumeMounts | nindent 8 }}
{{- end }}
{{- if .Values.extraContainers }}
{{ toYaml .Values.extraContainers | indent 8 }}
{{- end }}
Expand All @@ -123,4 +141,7 @@ spec:
volumes:
{{- if .Values.extraVolumes }}
{{ toYaml .Values.extraVolumes | nindent 6 }}
{{- end }}
{{- if .Values.global.extraVolumes }}
{{ toYaml .Values.global.extraVolumes | nindent 6 }}
{{- end }}
20 changes: 20 additions & 0 deletions charts/airbyte-webapp/templates/secrets.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Create secrets only for the local deployment
{{- if .Values.secrets }}
apiVersion: v1
kind: Secret
metadata:
name: webapp-secrets
labels:
app.kubernetes.io/name: {{ include "airbyte.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
helm.sh/chart: {{ include "airbyte.chart" . }}
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
app.airbyte.io/fullname: {{ include "airbyte.fullname" . }}
annotations:
type: Opaque
data:
{{- range $k, $v := mergeOverwrite .Values.secrets .Values.global.secrets }}
{{ $k }}: {{ if $v }}{{ $v | b64enc }} {{else}}""{{end}}
{{- end }}
{{- end }}
2 changes: 1 addition & 1 deletion charts/airbyte-webapp/templates/service.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
apiVersion: v1
kind: Service
metadata:
name: {{ include "common.names.fullname" . }}
name: airbyte-webapp-svc
{{- with .Values.service.annotations }}
annotations:
{{- toYaml . | nindent 4 }}
Expand Down
6 changes: 4 additions & 2 deletions charts/airbyte-webapp/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ fullstory:
## extraEnv:
## - name: SAMPLE_ENV_VAR
## value: "key=sample-value"
extraEnv: []
extraEnv: {}

## @param webapp.extraVolumeMounts [array] Additional volumeMounts for webapp container(s).
## Examples (when using `webapp.containerSecurityContext.readOnlyRootFilesystem=true`):
Expand All @@ -177,4 +177,6 @@ extraVolumeMounts: []
##
extraVolumes: []

extraContainers: []
extraContainers: []

secrets: {}
42 changes: 34 additions & 8 deletions charts/airbyte-worker/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -189,20 +189,20 @@ spec:
secretKeyRef:
name: {{ .Values.global.logs.accessKey.existingSecret }}
key: {{ .Values.global.logs.accessKey.existingSecretKey }}
{{- else }}
- name: AWS_ACCESS_KEY_ID
valueFrom:
secretKeyRef:
name: {{ .Release.Name }}-minio
key: root-user
{{- end }}
{{- if and .Values.global.logs.secretKey.existingSecret .Values.global.logs.secretKey.existingSecretKey }}
- name: AWS_SECRET_ACCESS_KEY
valueFrom:
secretKeyRef:
name: {{ .Values.global.logs.secretKey.existingSecret }}
key: {{ .Values.global.logs.secretKey.existingSecretKey }}
{{- else }}
{{- end }}
{{- if or .Values.global.logs.minio.enabled .Values.global.logs.externalMinio.enabled }}
- name: AWS_ACCESS_KEY_ID
valueFrom:
secretKeyRef:
name: {{ .Release.Name }}-minio
key: root-user
- name: AWS_SECRET_ACCESS_KEY
valueFrom:
secretKeyRef:
Expand Down Expand Up @@ -300,9 +300,25 @@ spec:
name: {{ .Release.Name }}-airbyte-env
key: USE_STREAM_CAPABLE_STATE
{{- end }}
# Values from secret
{{- if .Values.secrets }}
{{- range $k, $v := .Values.secrets }}
- name: {{ $k }}
valueFrom:
secretKeyRef:
name: worker-secrets
key: {{ $k }}
{{- end }}
{{- end }}

# Values from env
{{- if .Values.extraEnv }}
{{ .Values.extraEnv | toYaml | nindent 10 }}
{{- range $k, $v := mergeOverwrite .Values.extraEnv .Values.global.env_vars }}
- name: {{ $k }}
value: {{ $v | quote }}
{{- end }}
{{- end }}

{{- if .Values.livenessProbe.enabled }}
livenessProbe:
httpGet:
Expand Down Expand Up @@ -364,23 +380,33 @@ spec:
{{- if .Values.containerSecurityContext }}
securityContext: {{- toYaml .Values.containerSecurityContext | nindent 10 }}
{{- end }}
{{- if eq .Values.global.deploymentMode "oss" }}
volumeMounts:
- name: gcs-log-creds-volume
mountPath: /secrets/gcs-log-creds
readOnly: true
{{- end }}
{{- if .Values.extraVolumeMounts }}
{{ toYaml .Values.extraVolumeMounts | nindent 8 }}
{{- end }}
{{- if .Values.global.extraVolumeMounts }}
{{ toYaml .Values.global.extraVolumeMounts | nindent 8 }}
{{- end }}
{{- if .Values.extraContainers }}
{{ toYaml .Values.extraContainers | indent 8 }}
{{- end }}
{{- if .Values.global.extraContainers }}
{{ toYaml .Values.global.extraContainers | indent 8 }}
{{- end }}
volumes:
{{- if eq .Values.global.deploymentMode "oss" }}
- name: gcs-log-creds-volume
secret:
secretName: {{ ternary (printf "%s-gcs-log-creds" ( .Release.Name )) (.Values.global.credVolumeOverride) (eq .Values.global.deploymentMode "oss") }}
{{- end }}
{{- if .Values.extraVolumes }}
{{ toYaml .Values.extraVolumes | nindent 6 }}
{{- end }}
{{- if .Values.global.extraVolumes }}
{{ toYaml .Values.global.extraVolumes | nindent 6 }}
{{- end }}
Loading

0 comments on commit 626f51f

Please sign in to comment.