airflow-helm / charts

The User-Community Airflow Helm Chart is the standard way to deploy Apache Airflow on Kubernetes with Helm. Originally created in 2017, it has since helped thousands of companies create production-ready deployments of Airflow on Kubernetes.
https://github.com/airflow-helm/charts/tree/main/charts/airflow
Apache License 2.0
631 stars 473 forks source link

`PodDisruptionBudget` and `HorizontalPodAutoscaler` use unavailable apis (fix Kubernetes 1.25+) #679

Closed fbertos closed 1 year ago

fbertos commented 1 year ago

Checks

Motivation

Hi,

We would like to deploy Airflow v2.3.3 with Chart version 8.6.1 on Kubernetes 1.23.12 with the following worker configuration:

  podDisruptionBudget:
    enabled: true
    minAvailable: "1"

  autoscaling:
    enabled: true
    maxReplicas: 16
    metrics:
    - type: Resource
      resource:
        name: memory
        target:
          type: Utilization
          averageUtilization: 80

However it is not working correctly and we receive this warning:

W1212 17:03:04.202853    6021 warnings.go:70] policy/v1beta1 PodDisruptionBudget is deprecated in v1.21+, unavailable in v1.25+; use policy/v1 PodDisruptionBudget
W1212 17:03:08.336673    6021 warnings.go:70] autoscaling/v2beta2 HorizontalPodAutoscaler is deprecated in v1.23+, unavailable in v1.26+; use autoscaling/v2 HorizontalPodAutoscaler

Implementation

To change the templates of the worker:

To use the API version policy/v1 and autoscaling/v2 for these specs.

Are you willing & able to help?

thesuperzapper commented 1 year ago

@fbertos I think we can add a new template file for each of these resources, so people are able to set the apiVersion with a helm value depending on what Kubernetes version they are using.

We already have a very similar thing for Ingress, and the ingress.apiVersion value:

Obviously, if there is no actual difference between the apiVersions (need to confirm), this change will be very simple. Also, our default helm values should set the apiVersion which supports the current most common version of Kubernetes in use.

fbertos commented 1 year ago

Hi @thesuperzapper, great, that would be perfect. Thanks!

karakanb commented 1 year ago

@thesuperzapper hey, I believe I have fixed this issue with #685, do you think we can get v8.7.0 released only with this fix?

I'd really like to avoid forking or overriding the templates in some other ways to get this one working on my infra, it'd be helpful for me if we could get it going with as low effort from your side as possible.

thesuperzapper commented 1 year ago

@karakanb I agree that we should get this fix out ASAP, I have done a review of your PR, but it needs some small changes, see: https://github.com/airflow-helm/charts/pull/685#pullrequestreview-1286232585

hakuno commented 1 year ago

+1 Waiting for that.