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

error when trying to configure monitoring airflow 2.0.1 #699

Closed BorisovEG closed 1 year ago

BorisovEG commented 1 year ago

Checks

Chart Version

8.0.3

Kubernetes Version

Server Version: version.Info{Major:"1", Minor:"19", GitVersion:"v1.19.9", GitCommit:"9dd794e454ac32d97cde41ae10be801ae98f75df", GitTreeState:"clean", BuildDate:"2021-03-18T01:00:06Z", GoVersion:"go1.15.8", Compiler:"gc", Platform:"linux/amd64"}

Helm Version

alpine/helm:3.1.0

Description

Colleagues good afternoon, I will be grateful for any help.

Updating airflow from Airflow 1.10.15 -> Airflow 2.0.1 to the present moment chart v.8.0.3 everything works without errors. When trying to install airflow_exporter=='different versions' (for example "airflow-exporter==1.4.0")

airflow: extraPipPackages: - "airflow-exporter==1.4.0"

I get an error in the container (airflow-web and also airflow-scheduler) "ERROR: You need to upgrade the database. Please run 'airflow db upgrade'. Make sure the command is run using Airflow version 2.5.1."

Same error, received when trying to install pip install 'apache-airflow[statsd]'

Relevant Logs

k logs airflow-scheduler-58f6fccb87-7jn8t -n airflow                                                                               ✔  dev ○  00:17:20 
Defaulted container "airflow-scheduler" out of: airflow-scheduler, dags-git-sync, statsd-exporter, install-pip-packages (init), check-db (init), wait-for-db-migrations (init)
/opt/python/site-packages/airflow/configuration.py:440: DeprecationWarning: The sql_alchemy_conn option in [core] has been moved to the sql_alchemy_conn option in [database] - the old setting has been used, but please update your config.
  is_sqlite = "sqlite" in self.get("database", "sql_alchemy_conn")
/opt/python/site-packages/airflow/configuration.py:360: DeprecationWarning: The sql_alchemy_conn option in [core] has been moved to the sql_alchemy_conn option in [database] - the old setting has been used, but please update your config.
  self._upgrade_postgres_metastore_conn()
/opt/python/site-packages/airflow/settings.py:249 DeprecationWarning: The sql_alchemy_conn option in [core] has been moved to the sql_alchemy_conn option in [database] - the old setting has been used, but please update your config.
/opt/python/site-packages/airflow/cli/cli_parser.py:905 DeprecationWarning: The namespace option in [kubernetes] has been moved to the namespace option in [kubernetes_executor] - the old setting has been used, but please update your config.
/opt/python/site-packages/airflow/models/base.py:49 MovedIn20Warning: Deprecated API features detected! These feature(s) are not compatible with SQLAlchemy 2.0. To prevent incompatible upgrades prior to updating applications, ensure requirements files are pinned to "sqlalchemy<2.0". Set environment variable SQLALCHEMY_WARN_20=1 to show all deprecation warnings.  Set environment variable SQLALCHEMY_SILENCE_UBER_WARNING=1 to silence this message. (Background on SQLAlchemy 2.0 at: https://sqlalche.me/e/b8d9)
/opt/python/site-packages/airflow/models/base.py:70 DeprecationWarning: The sql_alchemy_conn option in [core] has been moved to the sql_alchemy_conn option in [database] - the old setting has been used, but please update your config.
/opt/python/site-packages/airflow/utils/sqlalchemy.py:47 DeprecationWarning: The sql_alchemy_conn option in [core] has been moved to the sql_alchemy_conn option in [database] - the old setting has been used, but please update your config.
ERROR: You need to upgrade the database. Please run `airflow db upgrade`. Make sure the command is run using Airflow version 2.5.1.

Custom Helm Values

---
apiVersion: helm.fluxcd.io/v1
kind: HelmRelease
metadata:
  name: airflow
  namespace: airflow
#   annotations:
#    flux.weave.works/automated: "true"
spec:
  releaseName: airflow
  chart:
    repository: https://*****/chartrepo/chartmuseum/
    name: airflow
    version: v8.0.3
  values:     
     ###################################
    # Airflow - Common Configs
    ###################################
    airflow:

      legacyCommands: false

      image:
        repository: apache/airflow
        tag: 2.0.1-python3.8

        pullPolicy: IfNotPresent
        pullSecret: ""
        uid: 50000
        gid: 50000

      executor: KubernetesExecutor

      fernetKey: "*****************************************="

      config:
        AIRFLOW__CORE__LOAD_EXAMPLES: "False"
        AIRFLOW__KUBERNETES__DELETE_WORKER_PODS: "False"
        AIRFLOW__KUBERNETES__WORKER_CONTAINER_REPOSITORY: apache/airflow
        AIRFLOW__KUBERNETES__WORKER_CONTAINER_TAG: 2.0.1-python3.8
        AIRFLOW__SCHEDULER__DAG_DIR_LIST_INTERVAL: "60"
        AIRFLOW__KUBERNETES__NAMESPACE: "airflow"
        AIRFLOW__KUBERNETES__GIT_SYNC_SUBMODULES: "off"
        AIRFLOW__KUBERNETES__DAGS_VOLUME_SUBPATH: /repo

      users:
        - username: ******
          password: ******
          role: Admin
          email: ****@******.com
          firstName: admin
          lastName: admin

      usersUpdate: true

      connections: []

      connectionsUpdate: false

      variables: []

      variablesUpdate: false

      pools: []

      poolsUpdate: false

      podAnnotations: {}

      extraPipPackages:
        - "apache-airflow[statsd]~=2.0.0"

      extraEnv: []

      extraContainers: []

      extraVolumeMounts: []

      extraVolumes: []

      kubernetesPodTemplate:

        stringOverride: ""

        nodeSelector: {}

        affinity: {}

        tolerations: []

        podAnnotations: {}

        securityContext: {}

        extraPipPackages: []

        extraVolumeMounts: []

        extraVolumes: []

    ###################################
    # Airflow - Scheduler Configs
    ###################################
    scheduler:

      replicas: 1

      resources: {}

      nodeSelector: {}

      affinity: {}

      tolerations: []

      securityContext: {}

      labels: {}

      podLabels: {}

      annotations: {}

      podAnnotations: {}

      safeToEvict: true

      podDisruptionBudget:

        enabled: false

        maxUnavailable: ""

        minAvailable: ""

      numRuns: -1

      livenessProbe:
        enabled: true
        initialDelaySeconds: 10
        periodSeconds: 30
        timeoutSeconds: 10
        failureThreshold: 5

      extraPipPackages: []

      extraVolumeMounts: []

      extraVolumes: []

aInitContainers: []

    ###################################
    # Airflow - WebUI Configs
    ###################################
    web:

      webserverConfig:

        stringOverride: ""

        existingSecret: ""

      replicas: 1

      resources: {}

      nodeSelector: {}

      affinity: {}

      tolerations: []

      securityContext: {}

      labels: {}

      podLabels: {}

      annotations: {}

      podAnnotations: {}

      safeToEvict: true

      podDisruptionBudget:

        enabled: false

        maxUnavailable: ""

        minAvailable: ""

      service:
        annotations: {}
        sessionAffinity: "None"
        sessionAffinityConfig: {}
        type: ClusterIP
        externalPort: 8080
        loadBalancerIP: ""
        loadBalancerSourceRanges: []
        nodePort:
          http: ""

      readinessProbe:
        enabled: true
        initialDelaySeconds: 10
        periodSeconds: 10
        timeoutSeconds: 5
        failureThreshold: 6

      livenessProbe:
        enabled: true
        initialDelaySeconds: 10
        periodSeconds: 10
        timeoutSeconds: 5
        failureThreshold: 6

      extraPipPackages: []

      extraVolumeMounts: []

      extraVolumes: []

    ###################################
    # Airflow - Celery Worker Configs
    ###################################
    workers:

      enabled: false

      replicas: 1

      resources: {}

      nodeSelector: {}

      affinity: {}

      tolerations: []

      securityContext: {}

      labels: {}

      podLabels: {}

      annotations: {}

      podAnnotations: {}

      safeToEvict: true

      podDisruptionBudget:

        enabled: false

        maxUnavailable: ""

        minAvailable: ""

      autoscaling:
        enabled: false
        maxReplicas: 2
        metrics: []

      celery:

        gracefullTermination: false

        gracefullTerminationPeriod: 600

      terminationPeriod: 60

      extraPipPackages: []

      extraVolumeMounts: []

      extraVolumes: []

    ###################################
    # Airflow - Flower Configs
    ###################################
    flower:

      enabled: false

      replicas: 1

      resources: {}

      nodeSelector: {}

      affinity: {}

      tolerations: []

      securityContext: {}

      labels: {}

      podLabels: {}

      annotations: {}

      podAnnotations: {}

      safeToEvict: true

      podDisruptionBudget:

        enabled: false

        maxUnavailable: ""

        minAvailable: ""

      oauthDomains: ""

      basicAuthSecret: ""

      basicAuthSecretKey: ""

      service:
        annotations: {}
        type: ClusterIP
        externalPort: 5555
        loadBalancerIP: ""
        loadBalancerSourceRanges: []
        nodePort:
          http:

      readinessProbe:
        enabled: true
        initialDelaySeconds: 10
        periodSeconds: 10
        timeoutSeconds: 5
        failureThreshold: 6

      livenessProbe:
        enabled: true
        initialDelaySeconds: 10
        periodSeconds: 10
        timeoutSeconds: 5
        failureThreshold: 6

      extraPipPackages: []

      extraVolumeMounts: []

      extraVolumes: []

    ###################################
    # Airflow - Logs Configs
    ###################################
    logs:

      path: /opt/airflow/logs

      persistence:

        enabled: false

        existingClaim: ""

        subPath: ""

        storageClass: ""

        accessMode: ReadWriteMany

        size: 1Gi

    ###################################
    # Airflow - DAGs Configs
    ###################################
    dags:

      path: /opt/airflow/dags

      persistence:

        enabled: false

        existingClaim: ""

        subPath: ""

        storageClass: ""

        accessMode: ReadOnlyMany

        size: 1Gi

      gitSync:

        enabled: true

        image:
          repository: k8s.gcr.io/git-sync/git-sync
          tag: v3.2.2

          pullPolicy: IfNotPresent
          uid: 65533
          gid: 65533

        resources: {}

        repo: "git@***********:airflow/dags.git"

        repoSubPath: ""

        branch: "airflow-dev"

        revision: HEAD

        depth: 1

        syncWait: 60

        syncTimeout: 120

        httpSecret: ""

        httpSecretUsernameKey: username

        httpSecretPasswordKey: ******

        sshSecret: "airflow-git-sync"

        sshSecretKey: "id_rsa"

        sshKnownHosts: ""

    ###################################
    # Kubernetes - Ingress Configs
    ###################################
    ingress:

      enabled: true

      web:

        annotations: {}

        labels: {}

        path: ""

        host: "airflow.***-***.**.***.**"

        tls:

          enabled: false

          secretName: ""

        precedingPaths: []

        succeedingPaths: []

      flower:

        annotations: {}

        labels: {}

        path: ""

        host: ""

        tls:

          enabled: false

          secretName: ""

        precedingPaths: []

        succeedingPaths: []

    ###################################
    # Kubernetes - RBAC
    ###################################
    rbac:

      create: true

      events: false

    ###################################
    # Kubernetes - Service Account
    ###################################
    serviceAccount:

      create: true

      name: ""

      annotations: {}

    ###################################
    # Kubernetes - Extra Manifests
    ###################################

    extraManifests: []

    ###################################
    # Database - PostgreSQL Chart
    # - https://github.com/helm/charts/tree/master/stable/postgresql
    ###################################
    postgresql:

      enabled: false

      postgresqlDatabase: airflow

      postgresqlUsername: *******

      postgresqlPassword: ******

      existingSecret: ""

      existingSecretKey: "postgresql-password"

      persistence:

        enabled: true

        storageClass: ""

        accessModes:
          - ReadWriteOnce

        size: 8Gi

      master:

        podAnnotations:
          cluster-autoscaler.kubernetes.io/safe-to-evict: "true"

    ###################################
    # Database - External Database
    # - these configs are only used when `postgresql.enabled` is false
    ###################################
    externalDatabase:

      type: postgres

      host: airflow-***-*****.com

      port: ****

      database: airflow

      user: *******

      passwordSecret: "airflow-postgres-pwd"

      passwordSecretKey: "********-password"

      properties: ""

    ###################################
    # Database - Redis Chart
    # - https://github.com/helm/charts/tree/master/stable/redis
    ###################################
    redis:

      enabled: false

      password: airflow

      existingSecret: ""

      existingSecretPasswordKey: "redis-password"

      cluster:

        enabled: false

        slaveCount: 1

      master:

        resources: {}

        podAnnotations:
          cluster-autoscaler.kubernetes.io/safe-to-evict: "true"

        persistence:

          enabled: false

          storageClass: ""

          accessModes:
          - ReadWriteOnce

          size: 8Gi

      slave:

        resources: {}

        podAnnotations:
          cluster-autoscaler.kubernetes.io/safe-to-evict: "true"

        persistence:

          enabled: false

          storageClass: ""

          accessModes:
            - ReadWriteOnce

          size: 8Gi

    ###################################
    # Database - External Database
    # - these configs are only used when `redis.enabled` is false
    ###################################
    externalRedis:

      host: localhost

      port: 6379

      databaseNumber: 1

      passwordSecret: ""

      passwordSecretKey: "redis-password"

    ###################################
    # Prometheus Operator - ServiceMonitor
    ###################################
    serviceMonitor:

      enabled: false

      selector:
        prometheus: kube-prometheus

      path: /admin/metrics

      interval: "30s"

    ###################################
    # Prometheus Operator - PrometheusRule
    ###################################
    prometheusRule:

      enabled: false

      additionalLabels: {}

      groups: []
stale[bot] commented 1 year ago

This issue has been automatically marked as stale because it has not had activity in 60 days. It will be closed in 7 days if no further activity occurs.

Thank you for your contributions.


Issues never become stale if any of the following is true:

  1. they are added to a Project
  2. they are added to a Milestone
  3. they have the lifecycle/frozen label