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

feat: Add airbyte-cron Helm chart #18542

Merged
merged 7 commits into from
Oct 31, 2022
Merged
Show file tree
Hide file tree
Changes from all 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
4 changes: 2 additions & 2 deletions .github/workflows/publish-helm-charts.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:
tag_prefix: "v"
major_pattern: "feat:"
minor_pattern: "fix:"
format: "${major}.${minor}.${patch}"
format: "${major}.${minor}.${/}"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what does ${/} do?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

change_path: "./charts"
bump_each_commit: true
namespace: helm
Expand Down Expand Up @@ -72,7 +72,7 @@ jobs:
- name: "Helm package"
shell: bash
run: |
declare -a StringArray=("airbyte-bootloader" "airbyte-server" "airbyte-temporal" "airbyte-webapp" "airbyte-pod-sweeper" "airbyte-worker" "airbyte-metrics")
declare -a StringArray=("airbyte-bootloader" "airbyte-server" "airbyte-temporal" "airbyte-webapp" "airbyte-pod-sweeper" "airbyte-worker" "airbyte-metrics" "airbyte-cron")
for val in ${StringArray[@]}; do
cd ./airbyte/charts/${val} && helm dep update && cd $GITHUB_WORKSPACE
sed -i -E 's/version: \"[0-9]+\.[0-9]+\.[0-9]+\"/version: \"${{ needs.generate-semantic-version.outputs.next-version }}\"/' ./airbyte/charts/${val}/Chart.yaml
Expand Down
6 changes: 6 additions & 0 deletions charts/airbyte-cron/Chart.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
dependencies:
- name: common
repository: https://charts.bitnami.com/bitnami
version: 1.17.1
digest: sha256:dacc73770a5640c011e067ff8840ddf89631fc19016c8d0a9e5ea160e7da8690
generated: "2022-10-25T16:47:38.253767-04:00"
32 changes: 32 additions & 0 deletions charts/airbyte-cron/Chart.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
apiVersion: v2
name: airbyte-cron
description: Helm chart to deploy airbyte-cron

# A chart can be either an 'application' or a 'library' chart.
#
# Application charts are a collection of templates that can be packaged into versioned archives
# to be deployed.
#
# Library charts provide useful utilities or functions for the chart developer. They're included as
# a dependency of application charts to inject those utilities and functions into the rendering
# pipeline. Library charts do not define any templates and therefore cannot be deployed.
type: application

# This is the chart version. This version number should be incremented each time you make changes
# to the chart and its templates, including the app version.
# Versions are expected to follow Semantic Versioning (https://semver.org/)
version: 0.1.0

# This is the version number of the application being deployed. This version number should be
# incremented each time you make changes to the application. Versions are not expected to
# follow Semantic Versioning. They should reflect the version the application is using.
# It is recommended to use it with quotes.
appVersion: "0.40.17"

dependencies:
- name: common
repository: https://charts.bitnami.com/bitnami
tags:
- bitnami-common
version: 1.x.x

59 changes: 59 additions & 0 deletions charts/airbyte-cron/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
# airbyte-cron

![Version: 0.1.0](https://img.shields.io/badge/Version-0.1.0-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 0.40.17](https://img.shields.io/badge/AppVersion-0.40.17-informational?style=flat-square)

Helm chart to deploy airbyte-cron

## Requirements

| Repository | Name | Version |
|------------|------|---------|
| https://charts.bitnami.com/bitnami | common | 1.x.x |

## Values

| Key | Type | Default | Description |
|-----|------|---------|-------------|
| affinity | object | `{}` | |
| containerSecurityContext | object | `{}` | |
| enabled | bool | `true` | |
| env_vars | object | `{}` | |
| extraContainers | list | `[]` | |
| extraEnv | list | `[]` | |
| extraInitContainers | list | `[]` | |
| extraVolumeMounts | list | `[]` | |
| extraVolumes | list | `[]` | |
| global.configMapName | string | `""` | |
| global.database.host | string | `"example.com"` | |
| global.database.port | string | `"5432"` | |
| global.database.secretName | string | `""` | |
| global.database.secretValue | string | `""` | |
| global.deploymentMode | string | `"oss"` | |
| global.extraContainers | list | `[]` | |
| global.secretName | string | `""` | |
| global.serviceAccountName | string | `"placeholderServiceAccount"` | |
| image.pullPolicy | string | `"IfNotPresent"` | |
| image.repository | string | `"airbyte/cron"` | |
| livenessProbe.enabled | bool | `true` | |
| livenessProbe.failureThreshold | int | `3` | |
| livenessProbe.initialDelaySeconds | int | `30` | |
| livenessProbe.periodSeconds | int | `10` | |
| livenessProbe.successThreshold | int | `1` | |
| livenessProbe.timeoutSeconds | int | `1` | |
| nodeSelector | object | `{}` | |
| podAnnotations | object | `{}` | |
| readinessProbe.containerSecurityContext | object | `{}` | |
| readinessProbe.enabled | bool | `true` | |
| readinessProbe.failureThreshold | int | `3` | |
| readinessProbe.initialDelaySeconds | int | `10` | |
| readinessProbe.periodSeconds | int | `10` | |
| readinessProbe.successThreshold | int | `1` | |
| readinessProbe.timeoutSeconds | int | `1` | |
| replicaCount | int | `1` | |
| resources.limits | object | `{}` | |
| resources.requests | object | `{}` | |
| secrets | object | `{}` | |
| tolerations | list | `[]` | |

----------------------------------------------
Autogenerated from chart metadata using [helm-docs v1.11.0](https://github.com/norwoodj/helm-docs/releases/v1.11.0)
73 changes: 73 additions & 0 deletions charts/airbyte-cron/templates/_helpers.tpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
{{/*
Expand the name of the chart.
*/}}
{{- define "airbyte.name" -}}
{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }}
{{- end }}

{{/*
Create a default fully qualified app name.
We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).
If release name contains chart name it will be used as a full name.
*/}}
{{- define "airbyte.fullname" -}}
{{- if .Values.fullnameOverride }}
{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" }}
{{- else }}
{{- $name := default .Chart.Name .Values.nameOverride }}
{{- if contains $name .Release.Name }}
{{- .Release.Name | trunc 63 | trimSuffix "-" }}
{{- else }}
{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" }}
{{- end }}
{{- end }}
{{- end }}

{{/*
Create chart name and version as used by the chart label.
*/}}
{{- define "airbyte.chart" -}}
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }}
{{- end }}

{{/*
Common labels
*/}}
{{- define "airbyte.labels" -}}
helm.sh/chart: {{ include "airbyte.chart" . }}
{{ include "airbyte.selectorLabels" . }}
{{- if .Chart.AppVersion }}
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
{{- end }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
{{- end }}

{{/*
Selector labels
*/}}
{{- define "airbyte.selectorLabels" -}}
app.kubernetes.io/name: {{ include "airbyte.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
{{- end }}

{{/*
Define db secret
*/}}

{{- define "database.secret.name" -}}
{{- printf "%s-postgresql" .Release.Name }}
{{- end }}

{{/*
Define imageTag
*/}}

{{- define "cron.imageTag" -}}
{{- if ((.Values.global.image).tag) }}
{{- printf "%s" .Values.global.image.tag }}
{{- else if .Values.image.tag }}
{{- printf "%s" .Values.image.tag }}
{{- else }}
{{- printf "%s" .Chart.AppVersion }}
{{- end }}
{{- end }}
145 changes: 145 additions & 0 deletions charts/airbyte-cron/templates/deployment.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,145 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ include "common.names.fullname" . }}
labels:
{{- include "airbyte.labels" . | nindent 4 }}
spec:
replicas: 1
selector:
matchLabels:
{{- include "airbyte.selectorLabels" . | nindent 6 }}
template:
metadata:
labels:
{{- include "airbyte.selectorLabels" . | nindent 8 }}
{{- if .Values.podAnnotations }}
annotations:
{{- include "common.tplvalues.render" (dict "value" .Values.podAnnotations "context" $) | nindent 8 }}
{{- end }}
spec:
serviceAccountName: {{ .Values.global.serviceAccountName }}
automountServiceAccountToken: true
{{- if .Values.global.imagePullSecrets }}
imagePullSecrets:
{{- range .Values.global.imagePullSecrets }}
{{- printf "- name: %s" .name | nindent 8 }}
{{- end }}
{{- end }}
{{- if .Values.nodeSelector }}
nodeSelector: {{- include "common.tplvalues.render" (dict "value" .Values.nodeSelector "context" $) | nindent 8 }}
{{- end }}
{{- if .Values.tolerations }}
tolerations: {{- include "common.tplvalues.render" (dict "value" .Values.tolerations "context" $) | nindent 8 }}
{{- end }}
{{- if .Values.affinity }}
affinity: {{- include "common.tplvalues.render" (dict "value" .Values.affinity "context" $) | nindent 8 }}
{{- end }}
{{- if .Values.extraInitContainers }}
initContainers:
{{- toYaml .Values.extraInitContainers | nindent 6 }}
{{- end }}
containers:
- name: airbyte-cron
image: {{ printf "%s:%s" .Values.image.repository (include "cron.imageTag" .) }}
imagePullPolicy: "{{ .Values.image.pullPolicy }}"
env:
{{- if eq .Values.global.deploymentMode "oss" }}
- name: AIRBYTE_ROLE
valueFrom:
configMapKeyRef:
name: {{ .Release.Name }}-airbyte-env
key: AIRBYTE_ROLE
- name: AIRBYTE_VERSION
valueFrom:
configMapKeyRef:
name: {{ .Release.Name }}-airbyte-env
key: AIRBYTE_VERSION
- name: CONFIGS_DATABASE_INITIALIZATION_TIMEOUT_MS
valueFrom:
configMapKeyRef:
name: {{ .Release.Name }}-airbyte-env
key: CONFIGS_DATABASE_INITIALIZATION_TIMEOUT_MS
- name: CONFIGS_DATABASE_MINIMUM_FLYWAY_MIGRATION_VERSION
valueFrom:
configMapKeyRef:
name: {{ .Release.Name }}-airbyte-env
key: CONFIGS_DATABASE_MINIMUM_FLYWAY_MIGRATION_VERSION
- name: DATABASE_PASSWORD
valueFrom:
secretKeyRef:
name: {{ .Values.global.database.secretName | default (printf "%s-airbyte-secrets" .Release.Name ) }}
key: {{ .Values.global.database.secretValue | default "DATABASE_PASSWORD" }}
- name: DATABASE_URL
valueFrom:
configMapKeyRef:
name: {{ .Release.Name }}-airbyte-env
key: DATABASE_URL
- name: DATABASE_USER
valueFrom:
secretKeyRef:
name: {{ .Release.Name }}-airbyte-secrets
key: DATABASE_USER
- name: MICRONAUT_ENVIRONMENTS
valueFrom:
configMapKeyRef:
name: {{ .Release.Name }}-airbyte-env
key: CRON_MICRONAUT_ENVIRONMENTS
- name: REMOTE_CONNECTOR_CATALOG_URL
valueFrom:
configMapKeyRef:
name: {{ .Release.Name }}-airbyte-env
key: REMOTE_CONNECTOR_CATALOG_URL
- name: TRACKING_STRATEGY
valueFrom:
configMapKeyRef:
name: {{ .Release.Name }}-airbyte-env
key: TRACKING_STRATEGY
- name: UPDATE_DEFINITIONS_CRON_ENABLED
valueFrom:
configMapKeyRef:
name: {{ .Release.Name }}-airbyte-env
key: UPDATE_DEFINITIONS_CRON_ENABLED
- name: WORKFLOW_FAILURE_RESTART_DELAY_SECONDS
valueFrom:
configMapKeyRef:
name: {{ .Release.Name }}-airbyte-env
key: WORKFLOW_FAILURE_RESTART_DELAY_SECONDS
- name: WORKSPACE_DOCKER_MOUNT
valueFrom:
configMapKeyRef:
name: {{ .Release.Name }}-airbyte-env
key: WORKSPACE_DOCKER_MOUNT
- name: WORKSPACE_ROOT
valueFrom:
configMapKeyRef:
name: {{ .Release.Name }}-airbyte-env
key: WORKSPACE_ROOT
{{- end }}

# Values from secret
{{- if .Values.secrets }}
{{- range $k, $v := .Values.secrets }}
- name: {{ $k }}
valueFrom:
secretKeyRef:
name: cron-secrets
key: {{ $k }}
{{- end }}
{{- end }}

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

{{- if .Values.containerSecurityContext }}
securityContext: {{- toYaml .Values.containerSecurityContext | nindent 12 }}
{{- end }}

{{- if .Values.resources }}
resources: {{- toYaml .Values.resources | nindent 10 }}
{{- end }}
Loading