diff --git a/charts/airflow/templates/flower/flower-pdb.yaml b/charts/airflow/templates/flower/flower-pdb.yaml index 1dc58470..e920d1de 100644 --- a/charts/airflow/templates/flower/flower-pdb.yaml +++ b/charts/airflow/templates/flower/flower-pdb.yaml @@ -1,5 +1,5 @@ {{- if and (.Values.flower.enabled) (.Values.flower.podDisruptionBudget.enabled) }} -apiVersion: policy/v1beta1 +apiVersion: {{ .Values.flower.podDisruptionBudget.apiVersion }} kind: PodDisruptionBudget metadata: name: {{ include "airflow.fullname" . }}-flower diff --git a/charts/airflow/templates/pgbouncer/pgbouncer-pdb.yaml b/charts/airflow/templates/pgbouncer/pgbouncer-pdb.yaml index ea5c14b2..cc5af7a9 100644 --- a/charts/airflow/templates/pgbouncer/pgbouncer-pdb.yaml +++ b/charts/airflow/templates/pgbouncer/pgbouncer-pdb.yaml @@ -1,5 +1,5 @@ {{- if and (include "airflow.pgbouncer.should_use" .) (.Values.pgbouncer.podDisruptionBudget.enabled) }} -apiVersion: policy/v1beta1 +apiVersion: {{ .Values.pgbouncer.podDisruptionBudget.apiVersion }} kind: PodDisruptionBudget metadata: name: {{ include "airflow.fullname" . }}-pgbouncer diff --git a/charts/airflow/templates/scheduler/scheduler-pdb.yaml b/charts/airflow/templates/scheduler/scheduler-pdb.yaml index 79bfb670..ddd7d820 100644 --- a/charts/airflow/templates/scheduler/scheduler-pdb.yaml +++ b/charts/airflow/templates/scheduler/scheduler-pdb.yaml @@ -1,5 +1,5 @@ {{- if .Values.scheduler.podDisruptionBudget.enabled }} -apiVersion: policy/v1beta1 +apiVersion: {{ .Values.scheduler.podDisruptionBudget.apiVersion }} kind: PodDisruptionBudget metadata: name: {{ include "airflow.fullname" . }}-scheduler diff --git a/charts/airflow/templates/triggerer/triggerer-pdb.yaml b/charts/airflow/templates/triggerer/triggerer-pdb.yaml index 5cc518c4..9080348a 100644 --- a/charts/airflow/templates/triggerer/triggerer-pdb.yaml +++ b/charts/airflow/templates/triggerer/triggerer-pdb.yaml @@ -1,5 +1,5 @@ {{- if and (include "airflow.triggerer.should_use" .) (.Values.triggerer.podDisruptionBudget.enabled) }} -apiVersion: policy/v1beta1 +apiVersion: {{ .Values.triggerer.podDisruptionBudget.apiVersion }} kind: PodDisruptionBudget metadata: name: {{ include "airflow.fullname" . }}-triggerer diff --git a/charts/airflow/templates/webserver/webserver-pdb.yaml b/charts/airflow/templates/webserver/webserver-pdb.yaml index 3e680cb6..88d769c3 100644 --- a/charts/airflow/templates/webserver/webserver-pdb.yaml +++ b/charts/airflow/templates/webserver/webserver-pdb.yaml @@ -1,5 +1,5 @@ {{- if .Values.web.podDisruptionBudget.enabled }} -apiVersion: policy/v1beta1 +apiVersion: {{ .Values.web.podDisruptionBudget.apiVersion }} kind: PodDisruptionBudget metadata: name: {{ include "airflow.fullname" . }}-web diff --git a/charts/airflow/templates/worker/worker-hpa.yaml b/charts/airflow/templates/worker/worker-hpa.yaml index 21945c80..c4b09a01 100644 --- a/charts/airflow/templates/worker/worker-hpa.yaml +++ b/charts/airflow/templates/worker/worker-hpa.yaml @@ -1,5 +1,5 @@ {{- if and (.Values.workers.enabled) (.Values.workers.autoscaling.enabled) }} -apiVersion: autoscaling/v2beta2 +apiVersion: {{ .Values.workers.autoscaling.apiVersion }} kind: HorizontalPodAutoscaler metadata: name: {{ include "airflow.fullname" . }}-worker diff --git a/charts/airflow/templates/worker/worker-pdb.yaml b/charts/airflow/templates/worker/worker-pdb.yaml index 0028e1c0..b0812bfe 100644 --- a/charts/airflow/templates/worker/worker-pdb.yaml +++ b/charts/airflow/templates/worker/worker-pdb.yaml @@ -1,5 +1,5 @@ {{- if and (.Values.workers.enabled) (.Values.workers.podDisruptionBudget.enabled) }} -apiVersion: policy/v1beta1 +apiVersion: {{ .Values.workers.podDisruptionBudget.apiVersion }} kind: PodDisruptionBudget metadata: name: {{ include "airflow.fullname" . }}-worker diff --git a/charts/airflow/values.yaml b/charts/airflow/values.yaml index 9b7b987d..b1579fd8 100644 --- a/charts/airflow/values.yaml +++ b/charts/airflow/values.yaml @@ -559,6 +559,12 @@ scheduler: ## enabled: false + ## the `apiVersion` to use for PodDisruptionBudget resources + ## - for Kubernetes 1.21 and later: "policy/v1" + ## - for Kubernetes 1.20 and before: "policy/v1beta1" + ## + apiVersion: policy/v1 + ## the maximum unavailable pods/percentage for the scheduler ## maxUnavailable: "" @@ -747,6 +753,12 @@ web: ## enabled: false + ## the `apiVersion` to use for PodDisruptionBudget resources + ## - for Kubernetes 1.21 and later: "policy/v1" + ## - for Kubernetes 1.20 and before: "policy/v1beta1" + ## + apiVersion: policy/v1 + ## the maximum unavailable pods/percentage for the web Deployment ## maxUnavailable: "" @@ -877,6 +889,12 @@ workers: ## enabled: false + ## the `apiVersion` to use for PodDisruptionBudget resources + ## - for Kubernetes 1.21 and later: "policy/v1" + ## - for Kubernetes 1.20 and before: "policy/v1beta1" + ## + apiVersion: policy/v1 + ## the maximum unavailable pods/percentage for the worker StatefulSet ## maxUnavailable: "" @@ -906,6 +924,12 @@ workers: maxReplicas: 2 metrics: [] + ## the `apiVersion` to use for HorizontalPodAutoscaler resources + ## - for Kubernetes 1.23 and later: "autoscaling/v2" + ## - for Kubernetes 1.22 and before: "autoscaling/v2beta2" + ## + apiVersion: autoscaling/v2 + ## configs for the celery worker Pods ## celery: @@ -1047,6 +1071,12 @@ triggerer: ## enabled: false + ## the `apiVersion` to use for PodDisruptionBudget resources + ## - for Kubernetes 1.21 and later: "policy/v1" + ## - for Kubernetes 1.20 and before: "policy/v1beta1" + ## + apiVersion: policy/v1 + ## the maximum unavailable pods/percentage for the triggerer Deployment ## maxUnavailable: "" @@ -1158,6 +1188,12 @@ flower: ## enabled: false + ## the `apiVersion` to use for PodDisruptionBudget resources + ## - for Kubernetes 1.21 and later: "policy/v1" + ## - for Kubernetes 1.20 and before: "policy/v1beta1" + ## + apiVersion: policy/v1 + ## the maximum unavailable pods/percentage for the flower Deployment ## maxUnavailable: "" @@ -1705,6 +1741,12 @@ pgbouncer: ## enabled: false + ## the `apiVersion` to use for PodDisruptionBudget resources + ## - for Kubernetes 1.21 and later: "policy/v1" + ## - for Kubernetes 1.20 and before: "policy/v1beta1" + ## + apiVersion: policy/v1 + ## the maximum unavailable pods/percentage for the pgbouncer Deployment ## maxUnavailable: