Code Monkey home page Code Monkey logo

airflow-chart's Introduction

Astronomer's Helm Chart for Apache Airflow

This chart will bootstrap an Airflow deployment on a Kubernetes cluster using the Helm package manager.

The version of this chart does not correlate to any other component. If it happens to align with OSS airflow that is just a coincidence. Users should not expect feature parity between OSS airflow chart and the Astronomer airflow-chart for identical version numbers.

Quickstart

To install this helm chart remotely (using helm 3)

kubectl create namespace airflow

helm repo add astronomer https://helm.astronomer.io
helm install airflow --namespace airflow astronomer/airflow

To install this repository from source

kubectl create namespace airflow
helm install --namespace airflow .

Prerequisites

  • Kubernetes 1.12+
  • Helm 3.6+
  • PV provisioner support in the underlying infrastructure

Installing the Chart

To install the chart with the release name my-release:

helm install --name my-release .

The command deploys Airflow on the Kubernetes cluster in the default configuration. The Parameters section lists the parameters that can be configured during installation.

Tip: List all releases using helm list

Upgrading the Chart

First, look at the updating documentation to identify any backwards-incompatible changes.

To upgrade the chart with the release name my-release:

helm upgrade --name my-release .

Uninstalling the Chart

To uninstall/delete the my-release deployment:

helm delete my-release

The command removes all the Kubernetes components associated with the chart and deletes the release.

Updating DAGs

Bake DAGs in Docker image

The recommended way to update your DAGs with this chart is to build a new docker image with the latest code (docker build -t my-company/airflow:8a0da78 .), push it to an accessible registry (docker push my-company/airflow:8a0da78), then update the Airflow pods with that image:

helm upgrade my-release . \
  --set images.airflow.repository=my-company/airflow \
  --set images.airflow.tag=8a0da78

Docker Images

Parameters

The complete list of parameters supported by the community chart can be found on the Parameteres Reference page, and can be set under the airflow key in this chart.

The following tables lists the configurable parameters of the Astronomer chart and their default values.

Parameter Description Default
ingress.enabled Enable Kubernetes Ingress support false
ingress.acme Add acme annotations to Ingress object false
ingress.tlsSecretName Name of secret that contains a TLS secret ~
ingress.webserverAnnotations Annotations added to Webserver Ingress object {}
ingress.flowerAnnotations Annotations added to Flower Ingress object {}
ingress.baseDomain Base domain for VHOSTs ~
ingress.auth.enabled Enable auth with Astronomer Platform true
extraObjects Extra K8s Objects to deploy (these are passed through tpl). More about Extra Objects. []
sccEnabled Enable security context constraints required for OpenShift false
authSidecar.enabled Enable authSidecar false
authSidecar.repository The image for the auth sidecar proxy nginxinc/nginx-unprivileged
authSidecar.tag The image tag for the auth sidecar proxy stable
authSidecar.pullPolicy The K8s pullPolicy for the the auth sidecar proxy image IfNotPresent
authSidecar.port The port the auth sidecar exposes 8084
gitSyncRelay.enabled Enables git sync relay feature. False
gitSyncRelay.repo.url Upstream URL to the git repo to clone. ~
gitSyncRelay.repo.branch Branch of the upstream git repo to checkout. main
gitSyncRelay.repo.depth How many revisions to check out. Leave as default 1 except in dev where history is needed. 1
gitSyncRelay.repo.wait Seconds to wait before pulling from the upstream remote. 60
gitSyncRelay.repo.subPath Path to the dags directory within the git repository. ~

Specify each parameter using the --set key=value[,key=value] argument to helm install. For example,

helm install --name my-release \
  --set executor=CeleryExecutor \
  --set enablePodLaunching=false .

Walkthrough using kind

Install kind, and create a cluster

We recommend testing with Kubernetes 1.25+, example:

kind create cluster --image kindest/node:v1.25.11

Confirm it's up:

kubectl cluster-info --context kind-kind

Add Astronomer's Helm repo

helm repo add astronomer https://helm.astronomer.io
helm repo update

Create namespace + install the chart

kubectl create namespace airflow
helm install airflow -n airflow astronomer/airflow

It may take a few minutes. Confirm the pods are up:

kubectl get pods --all-namespaces
helm list -n airflow

Run kubectl port-forward svc/airflow-webserver 8080:8080 -n airflow to port-forward the Airflow UI to http://localhost:8080/ to confirm Airflow is working. Login as admin and password admin.

Build a Docker image from your DAGs

  1. Start a project using astro-cli, which will generate a Dockerfile, and load your DAGs in. You can test locally before pushing to kind with astro airflow start.

    mkdir my-airflow-project && cd my-airflow-project
    astro dev init
  2. Then build the image:

    docker build -t my-dags:0.0.1 .
  3. Load the image into kind:

    kind load docker-image my-dags:0.0.1
  4. Upgrade Helm deployment:

    helm upgrade airflow -n airflow \
        --set images.airflow.repository=my-dags \
        --set images.airflow.tag=0.0.1 \
        astronomer/airflow

Extra Objects

This chart can deploy extra Kubernetes objects (assuming the role used by Helm can manage them). For Astronomer Cloud and Enterprise, the role permissions can be found in the Commander role.

extraObjects:
  - apiVersion: batch/v1beta1
    kind: CronJob
    metadata:
      name: "{{ .Release.Name }}-somejob"
    spec:
      schedule: "*/10 * * * *"
      concurrencyPolicy: Forbid
      jobTemplate:
        spec:
          template:
            spec:
              containers:
                - name: myjob
                  image: ubuntu
                  command:
                    - echo
                  args:
                    - hello
              restartPolicy: OnFailure

Contributing

Check out our contributing guide!

License

Apache 2.0 with Commons Clause

airflow-chart's People

Contributors

aliotta avatar andriisoldatenko avatar andscoop avatar ashb avatar bote795 avatar cwurtz avatar danielhoherd avatar dependabot[bot] avatar dimberman avatar ianstanton avatar jbampton avatar jedcunningham avatar jpweber avatar kaxil avatar kushalmalani avatar mishah334 avatar morhook avatar pgagnon avatar pgvishnuram avatar rishkarajgi avatar ryw avatar santoshr1016 avatar schnie avatar shmanu017 avatar sjmiller609 avatar tedmiston avatar turbaszek avatar vepetkov avatar virajmparekh avatar vsimon avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

airflow-chart's Issues

enabling pgbouncer does not work on k3d

tried this chart using k3d

scheduler, worker and webserver are unable to start

stuck waiting for container wait-for-airflow-migrations, which fails with this error

sqlalchemy.exc.OperationalError: (psycopg2.OperationalError) ERROR:  No such database: airflow-metadata

after some investigation, i see that the issue is the value for pgbouncer.ini in the airflow-pgbouncer-config secret.

here's what it looks like:

airflow-metadata = host=<no value> dbname=postgres port=5432 pool_size=3
airflow-result-backend = host=<no value> dbname=postgres port=5432 pool_size=2

[pgbouncer]
pool_mode = transaction
listen_port = 6543
server_tls_sslmode = prefer
listen_addr = *
auth_type = md5
auth_file = /etc/pgbouncer/users.txt
stats_users = postgres
ignore_startup_parameters = extra_float_digits
max_client_conn = 100
verbose = 0
log_disconnections = 0
log_connections = 0

the problem is the host=<no value>

if we look up the IP for the pgbouncer service and update the secret, it resolves the issue.

i am not sure if this is specific to k3d.

Spark binaries

How could I add Spark binaries to use SparkSubmitOperator?

Syncing dags from multiple git-repos

Is it possible to sync from several repositories into the dags foder using git-sync, example below. The intention being, to have a sort of multi-tenent aiflow cluster, where dags can be deployed from several git repositories

extraContainers:
    - name: gitsync-repo-1
      image: k8s.gcr.io/git-sync/git-sync:v3.2.2
      imagePullPolicy: IfNotPresent
      env:
        - name: GIT_SYNC_REPO
          value: https://github.com/company/repo-1.git
        - name: GIT_SYNC_ROOT
          ......
      volumeMounts:
        - mountPath: /usr/local/airflow/dags
          name: dags
          readOnly: false
      extraVolumeMounts:
        - name: dags
          mountPath: /usr/local/airflow/dags
      extraVolumes:
        - name: dags
          emptyDir: {}

    - name: gitsync-repo-2
      image: k8s.gcr.io/git-sync/git-sync:v3.2.2
      imagePullPolicy: IfNotPresent
      env:
        - name: GIT_SYNC_REPO
          value: https://github.com/company/repo-2.git
        - name: GIT_SYNC_ROOT
          ......
      volumeMounts:
        - mountPath: /usr/local/airflow/dags
          name: dags
          readOnly: false
      extraVolumeMounts:
        - name: dags
          mountPath: /usr/local/airflow/dags
      extraVolumes:
        - name: dags
          emptyDir: {}

Add imagePullSecret as a parameter to pull images from Private Container Registries

According to README.md#parameters, secret name/key pairs can be mount into Airflow pods.

Did not a find a way to do the same with imagePullSecret key.

Current Behavior

Since, I was not able to set imagePullSecret key as a parameter and, in order to make pods Pull an Image from a Private Registry, I had to manually add image pull secret to all Airflow K8s service accounts.

Step-by-step of the applied workaround

This implies, in a "from-scratch" deployment:

  1. Do a first, unsuccessful helm install to get all resources deployed (Helm release status: Failed)
  2. Patch all Airflow K8s service accounts
  3. Delete pods in ImagePullBackOff status so they are recreated with imagePullSecret key correctly set
  4. Run helm upgrade to get a successful Helm release

Expected Behavior

imagePullSecret name/key pairs can be mount into Airflow pods as a parameter, exactly like secret name/key pairs.

This would prevent users from opening up and editing current Helm charts.

readme keda install instructions produce ScaledObject error

I tried following the instructions for keda install (installing locally in k3d)

I got this error:

โฏ helm install airflow \                                                                                                                                                                             <aws:edm-dstandish>
    --set executor=CeleryExecutor \
    --set workers.keda.enabled=true \
    --set workers.persistence.enabled=false \
    --namespace airflow \
    astronomer/airflow
Error: unable to build kubernetes objects from release manifest: unable to recognize "": no matches for kind "ScaledObject" in version "keda.k8s.io/v1alpha1"

configmap sourced env values

Chart assumes clients will only want to add environment variables as name/values.
Client won't be able to do something like

- name: ENV_VAR
   valueFrom:
       configMapKeyRef:
           name: configmap-name
           key: configmap-field

Using Google Cloud Storage remote logging

Hello ๐Ÿง‘โ€๐Ÿš€ folks,

While using this chart, I'm trying to configure Google Cloud Storage remote logging: https://airflow.apache.org/docs/apache-airflow-providers-google/stable/logging/gcs.html

As per the documentation says, I need to:
a. Tweak the Airflow config to pass the proper params (Service Account PATH, GCS bucket name, ...)
b. Write the JSON credentials Key of a Google Service Account alongside Airflow (e.g. in the Airflow Pods).

To configure Airflow (a.), it's quite simple, I use the Airflow config env variables (AIRFLOW__LOGGING__XXXX) that I inject in this Chart through the .Values.env value. ๐Ÿ‘

However, I don't see any way of writing the Google Service Account credentials JSON file into the Airflow Pods. I currently have the credentials file stored into a Kubernetes secret and I would like to inject it as a file into Airflow Pods.

Things that I tried but didn't work:
1/ I found ways to bind Kubernetes Secrets to env variables with this Chart (.Values.secrets[]) but I need a file, not an Env variable (Google auth libs wants to have the credentials into Files, not Env vars, see: https://cloud.google.com/docs/authentication/production#automatically).
2/ I saw that there was a way to mount files into the worker and scheduler (.Values.workers.extraVolumeMounts / .Values.workers.extraVolumes / .Values.scheduler.extraVolumeMounts / .Values.scheduler.extraVolumes) but I don't see it possible for the webserver and as I want the Airflow UI to fetch the logs from GCS when reading a task log, I guess that it won't work (Airflow would write the logs but wouldn't be able to read them)

Did I miss anything?

If needed I can open a PR to propose a way to mount any volume, such as .Values.extraVolumeMounts / .Values.extraVolumes.

The README file in this repo has a bad link - [404:NotFound]

The markup version of the readme that is displayed for the main page in this repo contains the following link:
Status code [404:NotFound] - Link: https://github.com/astronomer/astronomer/tree/master/docker/airflow
(The link in the readmeโ€™s raw markdown may appear in a different format to the link above

This bad link was found by a tool I very recently created as part of an new experimental hobby project: https://github.com/MrCull/GitHub-Repo-ReadMe-Dead-Link-Finder
I (a human) verified that this link is broken and have manually logged this Issue (i.e. this Issue has not been created by a bot).
If this has been in any way helpful then please consider giving the above Repo a Star.
If you have any feedback on the information provided here, or on the tool itself, then please feel free to share your thoughts and pass on the feedback.

Task logs not found in Web-UI

This might be a simple fix, but what should I alter in the chart/templates to be able to access the task logs in the Airflow Web UI?

Currently using the default KubernetesExecutor and getting a "Log file does not exist:" error. Also not seeing a Persistent Volume Claims for the workers?

Bitnami postgres controller never becomes READY

postgres is stuck in a loop:

postgresql 15:52:19.71 INFO  ==> ** Starting PostgreSQL **
2020-03-27 15:52:20.199 GMT [1] LOG:  listening on IPv4 address "0.0.0.0", port 5432
2020-03-27 15:52:20.199 GMT [1] LOG:  listening on IPv6 address "::", port 5432
2020-03-27 15:52:20.312 GMT [1] LOG:  listening on Unix socket "/tmp/.s.PGSQL.5432"
2020-03-27 15:52:21.240 GMT [140] LOG:  database system was interrupted; last known up at 2020-03-27 15:52:18 GMT
2020-03-27 15:52:33.866 GMT [147] FATAL:  the database system is starting up
2020-03-27 15:52:43.657 GMT [154] FATAL:  the database system is starting up
2020-03-27 15:52:53.223 GMT [160] FATAL:  the database system is starting up
2020-03-27 15:52:53.669 GMT [167] FATAL:  the database system is starting up
2020-03-27 15:53:03.209 GMT [173] FATAL:  the database system is starting up
2020-03-27 15:53:03.676 GMT [180] FATAL:  the database system is starting up
2020-03-27 15:53:11.002 GMT [140] LOG:  database system was not properly shut down; automatic recovery in progress
2020-03-27 15:53:11.398 GMT [140] LOG:  invalid record length at 0/1000178: wanted 24, got 0
2020-03-27 15:53:11.398 GMT [140] LOG:  redo is not required
2020-03-27 15:53:12.890 GMT [1] LOG:  database system is ready to accept connections
2020-03-27 15:53:12.890 GMT [184] FATAL:  could not open relation mapping file "global/pg_filenode.map": No such file or directory
2020-03-27 15:53:12.891 GMT [186] FATAL:  could not open relation mapping file "global/pg_filenode.map": No such file or directory
2020-03-27 15:53:13.000 GMT [1] LOG:  autovacuum launcher process (PID 184) exited with exit code 1
2020-03-27 15:53:13.000 GMT [1] LOG:  terminating any other active server processes
2020-03-27 15:53:13.000 GMT [1] LOG:  background worker "logical replication launcher" (PID 186) exited with exit code 1
2020-03-27 15:53:13.154 GMT [1] LOG:  all server processes terminated; reinitializing
2020-03-27 15:53:13.537 GMT [187] LOG:  database system was interrupted; last known up at 2020-03-27 15:53:12 GMT
2020-03-27 15:53:14.086 GMT [193] FATAL:  the database system is in recovery mode
2020-03-27 15:53:14.178 GMT [200] FATAL:  the database system is in recovery mode
2020-03-27 15:53:23.215 GMT [206] FATAL:  the database system is in recovery mode
2020-03-27 15:53:23.660 GMT [213] FATAL:  the database system is in recovery mode

This is 1.15.9 and a plain vanilla install via helm3 into namespec airflow:

helm install airflow --namespace airflow astronomer/airflow

postgres will shutdown and then the container will restart and the cycle repeats. There is a postgres create user job that is forever stuck as well since postgres never appears ready.

confused about elasticsearch logs

Hi,

i have a nicely working airflow cluster using your chart, its running in GKE, in the same namespace i run the Elasticsearch helm chart from elastic. Both work nicely, and can talk to each other.

This is the relevant yaml part

elasticsearch:
    enabled: true
    connection:
        host: elasticsearch-master
        port: 9200

But i dont see the logs, could you point me to what i am doing wrong?

Any helm upgrade with KEDA errors the scheduler

Doing a simple helm install with KEDA and a custom image (simple astro dev init) as specified in the README ends with scheduler erroring like this:

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/usr/local/bin/airflow", line 8, in <module>
    sys.exit(main())
  File "/usr/local/lib/python3.7/site-packages/airflow/__main__.py", line 40, in main
    args.func(args)
  File "/usr/local/lib/python3.7/site-packages/airflow/cli/cli_parser.py", line 48, in command
    return func(*args, **kwargs)
  File "/usr/local/lib/python3.7/site-packages/airflow/utils/cli.py", line 91, in wrapper
    return f(*args, **kwargs)
  File "/usr/local/lib/python3.7/site-packages/airflow/cli/commands/scheduler_command.py", line 64, in scheduler
    job.run()
  File "/usr/local/lib/python3.7/site-packages/airflow/jobs/base_job.py", line 245, in run
    self._execute()
  File "/usr/local/lib/python3.7/site-packages/airflow/jobs/scheduler_job.py", line 1305, in _execute
    self._run_scheduler_loop()
  File "/usr/local/lib/python3.7/site-packages/astronomer/airflow/version_check/plugin.py", line 29, in run_before
    fn(*args, **kwargs)
  File "/usr/local/lib/python3.7/site-packages/airflow/jobs/scheduler_job.py", line 1398, in _run_scheduler_loop
    num_queued_tis = self._do_scheduling(session)
  File "/usr/local/lib/python3.7/site-packages/airflow/jobs/scheduler_job.py", line 1494, in _do_scheduling
    self._create_dagruns_for_dags(guard, session)
  File "/usr/local/lib/python3.7/site-packages/airflow/utils/retries.py", line 76, in wrapped_function
    for attempt in run_with_db_retries(max_retries=retries, logger=logger, **retry_kwargs):
  File "/usr/local/lib/python3.7/site-packages/tenacity/__init__.py", line 390, in __iter__
    do = self.iter(retry_state=retry_state)
  File "/usr/local/lib/python3.7/site-packages/tenacity/__init__.py", line 356, in iter
    return fut.result()
  File "/usr/local/lib/python3.7/concurrent/futures/_base.py", line 428, in result
    return self.__get_result()
  File "/usr/local/lib/python3.7/concurrent/futures/_base.py", line 384, in __get_result
    raise self._exception
  File "/usr/local/lib/python3.7/site-packages/airflow/utils/retries.py", line 85, in wrapped_function
    return func(*args, **kwargs)
  File "/usr/local/lib/python3.7/site-packages/airflow/jobs/scheduler_job.py", line 1585, in _create_dagruns_for_dags
    self._create_dag_runs(query.all(), session)
  File "/usr/local/lib/python3.7/site-packages/sqlalchemy/orm/query.py", line 3373, in all
    return list(self)
  File "/usr/local/lib/python3.7/site-packages/sqlalchemy/orm/query.py", line 3535, in __iter__
    return self._execute_and_instances(context)
  File "/usr/local/lib/python3.7/site-packages/sqlalchemy/orm/query.py", line 3560, in _execute_and_instances
    result = conn.execute(querycontext.statement, self._params)
  File "/usr/local/lib/python3.7/site-packages/sqlalchemy/engine/base.py", line 1011, in execute
    return meth(self, multiparams, params)
  File "/usr/local/lib/python3.7/site-packages/sqlalchemy/sql/elements.py", line 298, in _execute_on_connection
    return connection._execute_clauseelement(self, multiparams, params)
  File "/usr/local/lib/python3.7/site-packages/sqlalchemy/engine/base.py", line 1130, in _execute_clauseelement
    distilled_params,
  File "/usr/local/lib/python3.7/site-packages/sqlalchemy/engine/base.py", line 1317, in _execute_context
    e, statement, parameters, cursor, context
  File "/usr/local/lib/python3.7/site-packages/sqlalchemy/engine/base.py", line 1511, in _handle_dbapi_exception
    sqlalchemy_exception, with_traceback=exc_info[2], from_=e
  File "/usr/local/lib/python3.7/site-packages/sqlalchemy/util/compat.py", line 182, in raise_
    raise exception
  File "/usr/local/lib/python3.7/site-packages/sqlalchemy/engine/base.py", line 1277, in _execute_context
    cursor, statement, parameters, context
  File "/usr/local/lib/python3.7/site-packages/sqlalchemy/engine/default.py", line 608, in do_execute
    cursor.execute(statement, parameters)
sqlalchemy.exc.ProgrammingError: (psycopg2.errors.UndefinedColumn) column dag.last_parsed_time does not exist
LINE 1: ...AS dag_is_subdag, dag.is_active AS dag_is_active, dag.last_p...
                                                             ^

[SQL: SELECT dag.dag_id AS dag_dag_id, dag.root_dag_id AS dag_root_dag_id, dag.is_paused AS dag_is_paused, dag.is_subdag AS dag_is_subdag, dag.is_active AS dag_is_active, dag.last_parsed_time AS dag_last_parsed_time, dag.last_pickled AS dag_last_pickled, dag.last_expired AS dag_last_expired, dag.scheduler_lock AS dag_scheduler_lock, dag.pickle_id AS dag_pickle_id, dag.fileloc AS dag_fileloc, dag.owners AS dag_owners, dag.description AS dag_description, dag.default_view AS dag_default_view, dag.schedule_interval AS dag_schedule_interval, dag.concurrency AS dag_concurrency, dag.has_task_concurrency_limits AS dag_has_task_concurrency_limits, dag.next_dagrun AS dag_next_dagrun, dag.next_dagrun_create_after AS dag_next_dagrun_create_after
FROM dag
WHERE dag.is_paused IS false AND dag.is_active IS true AND dag.next_dagrun_create_after <= now() ORDER BY dag.next_dagrun_create_after
 LIMIT %(param_1)s FOR UPDATE OF dag SKIP LOCKED]
[parameters: {'param_1': 10}]
(Background on this error at: http://sqlalche.me/e/13/f405)

Of course in normal airflow a simple airflow db upgrade would suffice but this is k8s where I cannot just run a command in the pod and that will persist

Default ImagePullPolicy

Should the default imagePullPolicy for all images be Always to enable a more secure default installation?

Fast failure when attempting to install chart

Immediate failure when running the following command:

helm install . --generate-name --debug

Error: found in Chart.yaml, but missing in charts/ directory: postgresql
helm.go:75: [debug] found in Chart.yaml, but missing in charts/ directory: postgresql
helm.sh/helm/v3/pkg/action.CheckDependencies
        /home/circleci/helm.sh/helm/pkg/action/install.go:608
main.runInstall
        /home/circleci/helm.sh/helm/cmd/helm/install.go:193
main.newInstallCmd.func1
        /home/circleci/helm.sh/helm/cmd/helm/install.go:116
github.com/spf13/cobra.(*Command).execute
        /go/pkg/mod/github.com/spf13/[email protected]/command.go:826
github.com/spf13/cobra.(*Command).ExecuteC
        /go/pkg/mod/github.com/spf13/[email protected]/command.go:914
github.com/spf13/cobra.(*Command).Execute
        /go/pkg/mod/github.com/spf13/[email protected]/command.go:864
main.main
        /home/circleci/helm.sh/helm/cmd/helm/helm.go:74
runtime.main
        /usr/local/go/src/runtime/proc.go:203
runtime.goexit
        /usr/local/go/src/runtime/asm_amd64.s:1357

Invalid image name when the image tag is integer

I used commit short SHA to tag image. When the image tag is integer the image tag being passed to kubernetes resources are invalid.

Example:

I have image tag 5060547

helm template

helm template astronomer-main astronomer/airflow --set images.airflow.tag=5060547

Result:

...
      containers:
        - name: create-user
          image: quay.io/astronomer/ap-airflow:%!s(int64=5060547)
...

I think it is because of this helper implementation

{{ define "airflow_image" -}}
{{ printf "%s:%s" .Values.images.airflow.repository (default .Values.defaultAirflowTag .Values.images.airflow.tag) }}
{{- end }}

Astronomer maintenance of this repo?

Hello,

I noticed that several issues have been outstanding in this repo for several months. I was looking to adopt this helm chart. Are you all still maintaining this?

Otherwise, is there an alternative you can recommend to get started with?

airflow command error: argument GROUP_OR_COMMAND: invalid choice: 'serve_logs'

Hi! I'm trying to upgrade to Airflow 2.0 with this chart. When I upgrade, I get an error:

airflow command error: argument GROUP_OR_COMMAND: invalid choice: 'serve_logs'

Here is where serve_logs is getting invoked:

args: ["airflow", "serve_logs"]

But AFAICT, this command does not exist in Airflow 2.0.

Am I missing something? Or is this chart not compatible with Airflow 2.0?

Thanks!

fernetKey when using airflow as dependency

When running this chart on its own, it worked great for me as expected. However, when I defined it as a dependency in my Chart.yaml, the airflow containers fail to start up correctly, and I get something like this:

image

It seems to be related to this helm secret yaml file, but beyond that I'm having trouble debugging. I tried specifying different values for fernetKeySecretName and fernetKey in the helm values config, but haven't had any luck getting passed this.

Any suggestions?

KEDA v2 Supports StatefulSet

KEDA v2 supports not only Deployment but also StatefulSet. PR #731 Currently, this chart forces users to use deployment for Airflow workers instead of statefulsets. Is there any plan on auto-scaling Airflow workers as statefulsets via KEDA v2? If not can I contribute to this Chart?

Enabling Ingress raises Ingress extensions is invalid

Running:

helm install airflow \
    --set ingress.enabled=true \
    --namespace airflow \
    astronomer/airflow

returns:

Error: Ingress.extensions "airflow-airflow-ingress" is invalid: [spec.rules[0].host: Invalid value: "deployments.%!s(<nil>)": a DNS-1123 subdomain must consist of lower case alphanumeric characters, '-' or '.', and must start and end with an alphanumeric character (e.g. 'example.com', regex used for validation is '[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*'), spec.rules[1].host: Invalid value: "airflow-airflow.": a DNS-1123 subdomain must consist of lower case alphanumeric characters, '-' or '.', and must start and end with an alphanumeric character (e.g. 'example.com', regex used for validation is '[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*'), spec.tls[0].hosts: Invalid value: "deployments.%!s(<nil>)": a DNS-1123 subdomain must consist of lower case alphanumeric characters, '-' or '.', and must start and end with an alphanumeric character (e.g. 'example.com', regex used for validation is '[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*'), spec.tls[1].hosts: Invalid value: "airflow-airflow.": a DNS-1123 subdomain must consist of lower case alphanumeric characters, '-' or '.', and must start and end with an alphanumeric character (e.g. 'example.com', regex used for validation is '[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*')]

Am I missing something?

Can not change webserver.defaultUser.password when install by helm

Hello! Thanks for helm chart for airflow

I try install helm chart or airflow from astronomer

helm repo add astronomer https://helm.astronomer.io
helm repo update
helm install --set webserver.defaultUser.password=new_password,airflowVersion=2.0.0,defaultAirflowTag=2.0.0-buster,ingress.enabled=true,ingress.baseDomain=192.168.22.7.sslip.io airflow astronomer/airflow

I login to airflow as admin:admin.
But i think login as admin:new_password

If use 1.10.14-buster error alembic.script.revision.ResolutionError: No such revision or branch 'e959f08ac86c'

Hello! Thanks for helm for airflow

helm repo add astronomer https://helm.astronomer.io
helm install --set airflowVersion=1.10.14,defaultAirflowTag=1.10.14-buster,ingress.enabled=true,ingress.baseDomain=192.168.22.7.sslip.io airflow astronomer/airflow

logs

kubectl logs airflow-run-airflow-migrations-g58jq
Waiting for host: airflow-postgresql.default.svc.cluster.local. 5432
DB: postgresql://postgres:***@airflow-postgresql.default.svc.cluster.local.:5432/postgres?sslmode=disable
[2021-03-19 05:21:13,487] {db.py:378} INFO - Creating tables
INFO  [alembic.runtime.migration] Context impl PostgresqlImpl.
INFO  [alembic.runtime.migration] Will assume transactional DDL.
Traceback (most recent call last):
  File "/usr/local/lib/python3.7/site-packages/alembic/script/base.py", line 162, in _catch_revision_errors
    yield
  File "/usr/local/lib/python3.7/site-packages/alembic/script/base.py", line 364, in _upgrade_revs
    revs = list(revs)
  File "/usr/local/lib/python3.7/site-packages/alembic/script/revision.py", line 765, in _iterate_revisions
    requested_lowers = self.get_revisions(lower)
  File "/usr/local/lib/python3.7/site-packages/alembic/script/revision.py", line 319, in get_revisions
    return sum([self.get_revisions(id_elem) for id_elem in id_], ())
  File "/usr/local/lib/python3.7/site-packages/alembic/script/revision.py", line 319, in <listcomp>
    return sum([self.get_revisions(id_elem) for id_elem in id_], ())
  File "/usr/local/lib/python3.7/site-packages/alembic/script/revision.py", line 324, in get_revisions
    for rev_id in resolved_id
  File "/usr/local/lib/python3.7/site-packages/alembic/script/revision.py", line 324, in <genexpr>
    for rev_id in resolved_id
  File "/usr/local/lib/python3.7/site-packages/alembic/script/revision.py", line 397, in _revision_for_ident
    resolved_id,
alembic.script.revision.ResolutionError: No such revision or branch 'e959f08ac86c'

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/usr/local/bin/airflow", line 37, in <module>
    args.func(args)
  File "/usr/local/lib/python3.7/site-packages/airflow/utils/cli.py", line 81, in wrapper
    return f(*args, **kwargs)
  File "/usr/local/lib/python3.7/site-packages/airflow/bin/cli.py", line 1681, in upgradedb
    db.upgradedb()
  File "/usr/local/lib/python3.7/site-packages/astronomer/airflow/version_check/plugin.py", line 29, in run_before
    fn(*args, **kwargs)
  File "/usr/local/lib/python3.7/site-packages/airflow/utils/db.py", line 386, in upgradedb
    command.upgrade(config, 'heads')
  File "/usr/local/lib/python3.7/site-packages/alembic/command.py", line 298, in upgrade
    script.run_env()
  File "/usr/local/lib/python3.7/site-packages/alembic/script/base.py", line 489, in run_env
    util.load_python_file(self.dir, "env.py")
  File "/usr/local/lib/python3.7/site-packages/alembic/util/pyfiles.py", line 98, in load_python_file
    module = load_module_py(module_id, path)
  File "/usr/local/lib/python3.7/site-packages/alembic/util/compat.py", line 184, in load_module_py
    spec.loader.exec_module(module)
  File "<frozen importlib._bootstrap_external>", line 728, in exec_module
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
  File "/usr/local/lib/python3.7/site-packages/airflow/migrations/env.py", line 97, in <module>
    run_migrations_online()
  File "/usr/local/lib/python3.7/site-packages/airflow/migrations/env.py", line 91, in run_migrations_online
    context.run_migrations()
  File "<string>", line 8, in run_migrations
  File "/usr/local/lib/python3.7/site-packages/alembic/runtime/environment.py", line 846, in run_migrations
    self.get_context().run_migrations(**kw)
  File "/usr/local/lib/python3.7/site-packages/alembic/runtime/migration.py", line 511, in run_migrations
    for step in self._migrations_fn(heads, self):
  File "/usr/local/lib/python3.7/site-packages/alembic/command.py", line 287, in upgrade
    return script._upgrade_revs(revision, rev)
  File "/usr/local/lib/python3.7/site-packages/alembic/script/base.py", line 369, in _upgrade_revs
    for script in reversed(list(revs))
  File "/usr/local/lib/python3.7/contextlib.py", line 130, in __exit__
    self.gen.throw(type, value, traceback)
  File "/usr/local/lib/python3.7/site-packages/alembic/script/base.py", line 194, in _catch_revision_errors
    compat.raise_from_cause(util.CommandError(resolution))
  File "/usr/local/lib/python3.7/site-packages/alembic/util/compat.py", line 308, in raise_from_cause
    reraise(type(exception), exception, tb=exc_tb, cause=exc_value)
  File "/usr/local/lib/python3.7/site-packages/alembic/util/compat.py", line 301, in reraise
    raise value.with_traceback(tb)
  File "/usr/local/lib/python3.7/site-packages/alembic/script/base.py", line 162, in _catch_revision_errors
    yield
  File "/usr/local/lib/python3.7/site-packages/alembic/script/base.py", line 364, in _upgrade_revs
    revs = list(revs)
  File "/usr/local/lib/python3.7/site-packages/alembic/script/revision.py", line 765, in _iterate_revisions
    requested_lowers = self.get_revisions(lower)
  File "/usr/local/lib/python3.7/site-packages/alembic/script/revision.py", line 319, in get_revisions
    return sum([self.get_revisions(id_elem) for id_elem in id_], ())
  File "/usr/local/lib/python3.7/site-packages/alembic/script/revision.py", line 319, in <listcomp>
    return sum([self.get_revisions(id_elem) for id_elem in id_], ())
  File "/usr/local/lib/python3.7/site-packages/alembic/script/revision.py", line 324, in get_revisions
    for rev_id in resolved_id
  File "/usr/local/lib/python3.7/site-packages/alembic/script/revision.py", line 324, in <genexpr>
    for rev_id in resolved_id
  File "/usr/local/lib/python3.7/site-packages/alembic/script/revision.py", line 397, in _revision_for_ident
    resolved_id,
alembic.util.exc.CommandError: Can't locate revision identified by 'e959f08ac86c'

No gitSync config in values.yml

Hi I don't see any where in the values.yml file config for gitSync. But in the image in the scheduler a gitSync sidecar is running.

Log Grooming script envvars

    scheduler:
      logGroomerSidecar:
        enabled: True
        retentionDays: 7
        args: ["/usr/local/bin/clean-airflow-logs"]

Setting the following I would expect the logGroomer to clean the logs of anything older than 7 days.

This translates to setting an envvar in the sidecar of AIRFLOW__LOG_RETENTION_DAYS, however in /usr/local/bin/clean-airflow-logs its looking for RETENTION=${ASTRONOMER__AIRFLOW__WORKER_LOG_RETENTION_DAYS:-15}

Is there a setting I'm missing to create the astronomer envvar for the logGroomerSidecar?

Logs By Attempts Not coming

When I check for logs by attempts, I get this, anyone have any idea on this?
its not persisting i think ,

*** Log file does not exist: /usr/local/airflow/logs/candidate_sharing/train/2020-07-31T08:55:14.478919+00:00/1.log
*** Fetching from: http://candidatesharingtrain-38b4497e1ac045b683f6b0bd2ce15d23:8793/log/candidate_sharing/train/2020-07-31T08:55:14.478919+00:00/1.log
*** Failed to fetch log file from worker. HTTPConnectionPool(host='candidatesharingtrain-38b4497e1ac045b683f6b0bd2ce15d23', port=8793): Max retries exceeded with url: /log/candidate_sharing/train/2020-07-31T08:55:14.478919+00:00/1.log (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7fdbf1227990>: Failed to establish a new connection: [Errno -2] Name or service not known'))

Help needed - additionalVolume not parsable by helm with version 0.25.8

Hello,
Astronomer helm chart version: 0.25.8

////// Config
astronomer:
  astroUI:
    resources:
      requests:
        cpu: "100m"
        memory: "256Mi"
      limits:
        cpu: "500m"
        memory: "1024Mi"
  houston:
    resources:
      requests:
        cpu: "500m"
        memory: "1024Mi"
      limits:
        cpu: "1000m"
        memory: "2048Mi"
    config:
      executor: "CeleryExecutor"
      publicSignups: true
      email:
        enabled: true
        reply: "[email protected]"
      deployments:
        helm:
          workers:
            additionalVolume:
              enabled: true
              capacity: 100Gi
              storageClassName: "efs"
              mountPath: "/data"
              volumePlugin: {}

And I get the following error in houston pod logs:
astronomer-houston-upgrade-deployments-b7wk7 post-upgrade-job 2021-10-13T17:58:25 INFO Response from #updateDeployment: {"result":{"message":"YAML parse error on airflow/templates/workers/worker-persistentvolume.yaml: error converting YAML to JSON: yaml: line 20: did not find expected key"},"deployment":{}}

https://github.com/astronomer/airflow-chart/blob/v0.20.1/templates/workers/worker-persistentvolume.yaml -> this is the template that throws the error. Am I doing something wrong or is the template the problem?

[question] license

Is it possible to use this chart and astronomerinc/ap-airflow image without an astronomer license?

Getting Airflow 404 = Lots of circles Error

Hi Astronomer Team,

We are deploying this chart in our K8 cluster to run airflow. We are using nginx proxy to route to airflow. All pods & services are running. But while accessing the airflow URL we are getting Airflow 404 = Lots of circles Error. Is this because we have not set ingress.baseDomain while installing chart?

Please help.
Thanks,
Kapil.

Ingress setting the path to /

Ingress exposing the airflow Web server UI to <SUB>.<DOMAIN>.COM/<RELEASE-NAME>/airflow
I wanted to set it to <SUB>.<DOMAIN>.COM/ instead,

I tried to do it by editing the ingress path, but it's still pointing to the same. (I have tried deleting and reinstalling the ingress object)

Sharing steps for prototyping installation on Docker-for-Mac + Kubernetes

Hi Folks,

We've been evaluating Apache Airflow and are going ahead with it :)
I recently came across @schnie post on dev@airflow so started looking at this repository. You guys have done an EXCELLENT job! kudos.

In parallel with having our SRE prototype installation into our test env, I wanted our developers to be able to write, deploy and test their own DAG's even before they interact with the test env. The following therefore documents what I had to do to get this working.

Install astronomer/airflow helm chart on docker-deskop (Kubernetes)

brew install helm
kubectl create namespace airflow
helm repo add astronomer https://helm.astronomer.io
helm repo update
helm install airflow astronomer/airflow
kubectl get pods --all-namespaces
helm list -n airflow
kubectl port-forward svc/airflow-webserver 8080:8080 -n airflow
# access Airflow dashboard via localhost:8080

Deploy container DAG's into Airflow

brew install astronomer/tap/astro
mkdir sample-airflow-project && cd sample-airflow-project
astro dev init
docker build -t sample-airflow-dag:0.0.1 .
helm upgrade airflow -n airflow --set images.airflow.repository=sample-airflow-dag --set images.airflow.tag=0.0.1 astronomer/airflow
kubectl port-forward svc/airflow-webserver 8080:8080
#access Airflow dashboard via localhost:8080

I'm not sure what you guys want to do with this info... maybe a wiki entry?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.