Skip to content

Commit

Permalink
feat: add values to set init-container resources (#855)
Browse files Browse the repository at this point in the history
feat: add resources values for init-containers

Signed-off-by: Mathew Wicks <5735406+thesuperzapper@users.noreply.github.com>
  • Loading branch information
thesuperzapper committed May 1, 2024
1 parent b846fcd commit a13412a
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 0 deletions.
1 change: 1 addition & 0 deletions charts/airflow/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -227,6 +227,7 @@ Parameter | Description | Default
`airflow.extraVolumeMounts` | extra VolumeMounts for the airflow Pods | `[]`
`airflow.extraVolumes` | extra Volumes for the airflow Pods | `[]`
`airflow.clusterDomain` | kubernetes cluster domain name | `cluster.local`
`airflow.initContainers.*` | airflow init-containers | `<see values.yaml>`
`airflow.localSettings.*` | airflow_local_settings.py | `<see values.yaml>`
`airflow.kubernetesPodTemplate.*` | pod_template.yaml | `<see values.yaml>`
`airflow.dbMigrations.*` | db-migrations Deployment | `<see values.yaml>`
Expand Down
6 changes: 6 additions & 0 deletions charts/airflow/templates/_helpers/pods.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,8 @@ EXAMPLE USAGE: {{ include "airflow.init_container.check_db" (dict "Release" .Rel
{{- define "airflow.init_container.check_db" }}
- name: check-db
{{- include "airflow.image" . | indent 2 }}
resources:
{{- toYaml .Values.airflow.initContainers.checkDb.resources | nindent 4 }}
envFrom:
{{- include "airflow.envFrom" . | indent 4 }}
env:
Expand Down Expand Up @@ -98,6 +100,8 @@ EXAMPLE USAGE: {{ include "airflow.init_container.wait_for_db_migrations" (dict
{{- define "airflow.init_container.wait_for_db_migrations" }}
- name: wait-for-db-migrations
{{- include "airflow.image" . | indent 2 }}
resources:
{{- toYaml .Values.airflow.initContainers.waitForDbMigrations.resources | nindent 4 }}
envFrom:
{{- include "airflow.envFrom" . | indent 4 }}
env:
Expand Down Expand Up @@ -175,6 +179,8 @@ EXAMPLE USAGE: {{ include "airflow.init_container.install_pip_packages" (dict "R
{{- define "airflow.init_container.install_pip_packages" }}
- name: install-pip-packages
{{- include "airflow.image" . | indent 2 }}
resources:
{{- toYaml .Values.airflow.initContainers.installPipPackages.resources | nindent 4 }}
envFrom:
{{- include "airflow.envFrom" . | indent 4 }}
env:
Expand Down
32 changes: 32 additions & 0 deletions charts/airflow/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -271,6 +271,38 @@ airflow:
##
clusterDomain: "cluster.local"

########################################
## CONFIGS | airflow init-containers
########################################
##
initContainers:
## configs for the "check-db" init-containers
##
checkDb:
## resource requests/limits for the "check-db" init-containers
## - spec for ResourceRequirements:
## https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.20/#resourcerequirements-v1-core
##
resources: {}

## configs for the "wait-for-db-migrations" init-containers
##
waitForDbMigrations:
## resource requests/limits for the "wait-for-db-migrations" init-containers
## - spec for ResourceRequirements:
## https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.20/#resourcerequirements-v1-core
##
resources: {}

## configs for the "install-pip-packages" init-containers
##
installPipPackages:
## resource requests/limits for the "install-pip-packages" init-containers
## - spec for ResourceRequirements:
## https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.20/#resourcerequirements-v1-core
##
resources: {}

########################################
## FILE | airflow_local_settings.py
########################################
Expand Down

0 comments on commit a13412a

Please sign in to comment.