Skip to main content
Version 3.0

Create, schedule, and monitor
your workflows with Airflow.

Six common scenarios, from the first installation to the integration with the rest of the platform. Each one covers: what the chart already provides, what changes in the cluster, the values file commented line by line, and a step-by-step with verification.

ChartVersion3.0.3TypeapplicationAppVersion3.0.2
CompatibilityKubernetes1.32+OpenShift4.19+Rancher2.10.x+
Feature SupportLDAPsupportedS3supportedExternal DBsupportedIngresssupportedGateway APIsupported

The tdp-airflow chart brings up Apache Airflow with the KubernetesExecutor, which runs each task in its own pod, an embedded PostgreSQL for the metadata and persistent volumes for the DAGs, the Python files that describe each workflow. The database, the storage, the access and the integrations are your decisions, and each scenario below deals with one of them. For the architecture, see Apache Airflow - Concepts.

Your environment

If you fill in your environment details here, the examples and commands on the page use what you entered. The namespace, the release name and the values file are your choices, not the chart.

Scenarios​

Install with the chart defaults, open the interface from your machine and sign in as admin.

You want to see Airflow working before deciding on database, volumes or access. You will install without a values file, open the interface from your own machine and sign in with the administrator user that the chart creates. What comes up is the API Server, which serves the interface and the API; the Scheduler, which triggers the tasks, each in its own pod; the DAG Processor, which reads the DAG files; the Triggerer, which handles the deferred tasks; and a PostgreSQL for the metadata. The other scenarios start from this state.

Executor

KubernetesExecutor: the Scheduler creates one pod per task, from the chart pod template.

Metadata database

Embedded PostgreSQL (postgresql.enabled), not recommended for production. Scenario 2 replaces it with an external PostgreSQL.

Volumes

DAGs PVC and Triggerer logs PVC on, in the cluster default StorageClass. Task logs PVC off.

Access

Internal Service (ClusterIP) of the API Server, with no Ingress. Login with the admin user and a temporary password, the same as the TDP charts.

Time zone

America/Sao_Paulo, in config.core.default_timezone.

What comes up in the namespace with the chart defaults

namespace <NAMESPACE>port-forwardcreatesreadsmetadataWho accessesport-forwardService<RELEASE_NAME>-api-serverAPI Serverweb interface and APISchedulertriggers the tasksDAG Processorreads the DAG filesTask pods ×3one per taskTriggererdeferred tasksTriggerer PVClogs-…-triggerer-0DAGs PVC<RELEASE_NAME>-dagsLogs PVCoffPostgreSQLembedded
  1. Who accesses. Without external exposure, each person opens a tunnel from their own machine to the API Server Service with kubectl port-forward. Chart default: no external exposure (port-forward).
  2. API Server Service. The internal address of the Airflow web interface and API in the cluster. The name is always the release name followed by -api-server. Chart default: ClusterIP, with the ports from apiServer.service.ports. (tdp-airflow.apiServer.service.type · tdp-airflow.apiServer.service.ports)
  3. API Server. Serves the Airflow web interface and REST API. The interface login is the admin user, created by the chart at installation. Chart default: admin user with a temporary password; LDAP off. (tdp-airflow.webserver.defaultUser.password)
  4. Scheduler. Follows the DAGs and, with the KubernetesExecutor, creates a pod for each task from the chart pod template. Chart default: KubernetesExecutor executor. (tdp-airflow.executor)
  5. DAG Processor. Parses the DAG files from the DAGs PVC, mounted at /opt/airflow/dags, and writes the DAGs to the metadata database.
  6. Task pods. With the KubernetesExecutor, each task runs in its own pod, which ends with it. The base resources of these pods come from workers.resources. Chart default: KubernetesExecutor. (tdp-airflow.workers.resources)
  7. Triggerer. Runs the deferred tasks, the ones that wait for an event. Its logs live in a PVC of their own. Chart default: logs PVC on. (tdp-airflow.triggerer.persistence.enabled)
  8. Triggerer PVC. Volume for the Triggerer logs. It stays in the cluster after helm uninstall. Chart default: on, size in triggerer.persistence.size. (tdp-airflow.triggerer.persistence)
  9. DAGs PVC. Volume where the DAG files live, mounted at /opt/airflow/dags by the DAG Processor, the Triggerer and the task pods. It requires a default StorageClass in the cluster, or the one set in dags.persistence.storageClassName. helm uninstall deletes this PVC, unless it is a PVC of your own, set in dags.persistence.existingClaim. Chart default: on, ReadWriteOnce, size in dags.persistence.size. (tdp-airflow.dags.persistence)
  10. Logs PVC. Shared volume for the task logs. Chart default: off, size in logs.persistence.size. (tdp-airflow.logs.persistence.enabled)
  11. Embedded PostgreSQL. The Airflow metadata database, in a StatefulSet of the release itself. It is not recommended for production. Its volume stays in the cluster after helm uninstall. Chart default: on. (tdp-airflow.postgresql.enabled)
What comes up in the namespace with the chart defaults. Click an element to see what it is and the matching default.

Check the TDP license

The chart requires a valid TDP license installed in the cluster.

Terminal input
kubectl get platformlicenses -A

It worked when

The license appears in the list with STATE VALID. If it does not, or if it appears with another state, install or renew it before continuing (License Configuration).

Create the pull Secret in the namespace

The Airflow images come from the Tecnisys registry, with your credential, read from the tdp-registry Secret in the release namespace.

Terminal input
kubectl -n <NAMESPACE> create secret docker-registry tdp-registry \
--docker-server=registry.tecnisys.com.br \
--docker-username=<REGISTRY_USERNAME> --docker-password=<REGISTRY_CLI_SECRET>

It worked when

Terminal input
kubectl -n <NAMESPACE> get secret tdp-registry

The Secret appears in the namespace.

If the namespace does not exist yet

Create it first, with kubectl create namespace <NAMESPACE>, and repeat the command. The registry user and CLI secret are in Prerequisites.

Install with the defaults

Without a values file, the chart comes up exactly as in the figure above.

The cluster needs a default StorageClass, because the DAGs and Triggerer PVCs come on. Without --version, Helm installs the latest published version of the chart. The commands on this page pin the version of this documentation.

Terminal input
helm upgrade --install <RELEASE_NAME> oci://registry.tecnisys.com.br/tdp/charts/tdp-airflow \
--version 3.0.3 \
-n <NAMESPACE> --create-namespace --timeout 10m

Since release 3.0.1, Airflow is compatible with Red Hat OpenShift 4.19+. On OpenShift, add --set tdp-airflow.securityContexts.containers.runAsNonRoot=true, required by the Security Context Constraints:

Terminal input
helm upgrade --install <RELEASE_NAME> oci://registry.tecnisys.com.br/tdp/charts/tdp-airflow \
--version 3.0.3 \
-n <NAMESPACE> --create-namespace --timeout 10m \
--set tdp-airflow.securityContexts.containers.runAsNonRoot=true

It worked when

Terminal input
kubectl -n <NAMESPACE> get pods

The API Server, Scheduler, DAG Processor, Triggerer and PostgreSQL pods reach Running, and the database migration and admin user creation Jobs finish.

If a pod does not start

The namespace events, in time order, show the reason:

Terminal input
kubectl -n <NAMESPACE> get events --sort-by=.lastTimestamp

Then look for the message in When something goes wrong.

Open the interface from your machine

Without external exposure, kubectl opens a tunnel from your machine to the API Server Service.

Terminal input
kubectl -n <NAMESPACE> port-forward svc/<RELEASE_NAME>-api-server 8080:8080

It worked when

The Airflow interface opens at http://localhost:8080 and accepts the admin user with the temporary password. The password, and how to change it before any real use, are in Security - Airflow.

With the defaults, the DAG list starts empty: the example DAGs come off. To bring your DAGs to Airflow, see scenario 3.

When something goes wrong​

Troubleshooting

Paste the error message or pick the symptom. The answer comes with the cause, what to do and the command.

  1. Installation refused: license check failed. Cause: The TDP license is missing or invalid in the cluster. What to do: Check the license with the command below. If it is not VALID, install or renew it (License Configuration) and repeat the installation.
  2. ImagePullBackOff on the Airflow images. Cause: The tdp-registry pull Secret does not exist in the release namespace. What to do: Create the tdp-registry Secret in the namespace, with your registry credential (First contact scenario).
  3. PVCs in Pending. Cause: The cluster has no default StorageClass, and the DAGs and Triggerer PVCs come on. What to do: Set a default StorageClass in the cluster or set one in dags.persistence.storageClassName and triggerer.persistence.storageClassName.
  4. My DAGs do not appear. Cause: With the defaults, Airflow starts without DAGs: the files must be in /opt/airflow/dags. A file with an import error does not load. What to do: Copy the files to the DAGs PVC or use git-sync (DAGs and volumes scenario) and check the import errors in the DAG Processor pod.
  5. The DAGs from Git do not arrive. Cause: With dags.persistence.enabled on, the chart does not create the git-sync container and the DAGs never arrive. What to do: Turn off dags.persistence.enabled together with dags.gitSync.enabled (DAGs and volumes scenario).
  6. Pods stuck waiting for the database migrations. Cause: scheduler, worker, api-server, triggerer and dag-processor wait for the metadata database migrations, all at the same time and against the same PostgreSQL, up to the images.migrationsWaitTimeout limit. What to do: If the database takes long to finish the migrations, increase images.migrationsWaitTimeout.
  7. PostgreSQL did not become ready in time. Cause: The <RELEASE_NAME>-check-db-ready Job did not reach the external PostgreSQL at the host and port of data.metadataConnection. What to do: Check the host and port in data.metadataConnection and whether the PostgreSQL is up and reachable from the Airflow namespace.
  8. Database creation Job failed (external database). Cause: The <RELEASE_NAME>-create-db Job could not create the database and the user in the external PostgreSQL: administrator Secret, address or password. What to do: The failed Job stays in the cluster, with its pod and log. Fix the cause and run the same helm upgrade --install: it replaces the failed Job.
  9. OpenShift refuses the pods (Security Context Constraints). Cause: On OpenShift, the Security Context Constraints require runAsNonRoot in the containers. What to do: Install with --set tdp-airflow.securityContexts.containers.runAsNonRoot=true (First contact scenario).
  10. The new admin password does not work. Cause: webserver.defaultUser.password only applies when the admin user is first created. What to do: Change the admin password in the Airflow interface.
  11. The published hostname does not open. Cause: The hostname does not resolve to the Ingress controller or to the Gateway. What to do: Point the hostname to the external IP of the controller (or of the Gateway) in DNS or in /etc/hosts. On OpenShift, check the Route.
  12. Two Airflow releases in the same namespace interfere with each other. Cause: Three internal Secrets of the chart, those of the Fernet key, the Redis password and the broker URL, have a fixed name and are shared by the releases of the same namespace. What to do: Install each Airflow in its own namespace. Details in Security - Airflow.
  13. Another problem. Cause: Start with the pod state and the namespace events. What to do: The events in time order show what keeps the pod from starting.

What stays after uninstalling​

Terminal input
helm uninstall <RELEASE_NAME> -n <NAMESPACE>

After helm uninstall:

  • The StatefulSet volumes stay: the embedded PostgreSQL one and the Triggerer logs one. A new installation in the same namespace finds the old database again.
  • The three Secrets with the Airflow internal keys stay, <RELEASE_NAME>-api-secret-key, <RELEASE_NAME>-jwt-secret and <RELEASE_NAME>-webserver-secret-key, created outside the release so they do not change between updates. A new installation reuses them.
  • The DAGs PVC, <RELEASE_NAME>-dags, is deleted, with the DAGs in it, unless it is a PVC of your own, in dags.persistence.existingClaim (scenario 3).

To start from scratch, also delete the volumes and Secrets that stayed:

Terminal input
kubectl -n <NAMESPACE> delete pvc data-<RELEASE_NAME>-postgresql-0 logs-<RELEASE_NAME>-triggerer-0
kubectl -n <NAMESPACE> delete secret <RELEASE_NAME>-api-secret-key <RELEASE_NAME>-jwt-secret <RELEASE_NAME>-webserver-secret-key

The removal order for all components and the platform is in Uninstallation.

All parameters​

Filter by name or by group. The chart prefix is already filled in. Keys without a prefix live at the root of the values file.

45 of 45 parameters

ParameterDescriptionChart default
tdp-airflow.enabledGeneralEnables the Airflow deploymenttrue
tdp-airflow.defaultAirflowTagGeneralTag of the TDP Airflow image3.0.2-1
tdp-airflow.executorGeneralAirflow executorKubernetesExecutor
tdp-airflow.config.core.default_timezoneGeneralAirflow default time zoneAmerica/Sao_Paulo
tdp-airflow.securityContexts.containers.runAsNonRootGeneraltrue on OpenShift, required by the Security Context Constraintsfalse
tdp-airflow.images.migrationsWaitTimeoutGeneralSeconds to wait for the metadata database migrations before giving up300
tdp-airflow.apiServer.service.typeAccessType of the API Server ServiceClusterIP
tdp-airflow.apiServer.service.portsAccessPorts of the API Server Serviceapi-server, port 8080
tdp-airflow.webserver.defaultUser.passwordAccessPassword of the interface admin user. Only applies when the user is first createdChangeMe!T3c
tdp-airflow.ldap.enabledAccessEnables LDAP authenticationfalse
tdp-airflow.ldap.apiServerConfigAccessFlask-AppBuilder LDAP configurationsee Security - Airflow
tdp-airflow.extraEnvAccessExtra environment variables, such as references to Secrets""
tdp-airflow.postgresql.enabledDatabaseEmbedded PostgreSQLtrue
tdp-airflow.postgresql.auth.postgresPasswordDatabasePassword of the postgres superuser of the embedded PostgreSQL, equal to data.metadataConnection.passChangeMe!T3c
tdp-airflow.dataDatabaseSecret with the broker URL and the metadata database connection (embedded password; host, user and database for an external one)connection password: ChangeMe!T3c
TDP-Settings.externalDatabase.enabledDatabaseExternal database helpers. Required with the embedded one offfalse
TDP-Settings.externalDatabase.recreateDatabaseDeletes and recreates the database and the user at each installation or updatefalse
TDP-Settings.externalDatabase.externalSecret.releaseNameDatabaseSecret with the PostgreSQL administrator password (postgres-password key)tdp-postgresql-auth
tdp-airflow.dags.persistence.enabledVolumesDAGs PVCtrue
tdp-airflow.dags.persistence.sizeVolumesSize of the DAGs PVC5Gi
tdp-airflow.dags.persistence.storageClassNameVolumesStorageClass of the DAGs PVC (empty uses the cluster default)""
tdp-airflow.dags.persistence.accessModeVolumesAccess mode of the DAGs PVCReadWriteOnce
tdp-airflow.dags.persistence.existingClaimVolumesDAGs PVC created by you. The chart uses it and never deletes it""
tdp-airflow.dags.gitSync.enabledDAGs from Gitgit-sync container that clones the DAGs repository. Requires dags.persistence.enabled: falsefalse
tdp-airflow.dags.gitSync.repoDAGs from GitURL of the DAGs repositoryhttps://github.com/apache/airflow.git
tdp-airflow.dags.gitSync.branchDAGs from GitRepository branchv2-2-stable
tdp-airflow.dags.gitSync.refDAGs from GitBranch, tag or commit used by git-syncv2-2-stable
tdp-airflow.dags.gitSync.subPathDAGs from GitDAGs folder inside the repository (empty for the root)""
tdp-airflow.dags.gitSync.periodDAGs from GitInterval between the searches for changes in the repository5s
tdp-airflow.dags.gitSync.credentialsSecretDAGs from GitSecret with the credentials of a private repository over HTTPS (GITSYNC_USERNAME, GITSYNC_PASSWORD, GIT_SYNC_USERNAME, GIT_SYNC_PASSWORD)not set
tdp-airflow.dags.gitSync.sshKeySecretDAGs from GitSecret with the gitSshKey key, for an SSH URLnot set
tdp-airflow.triggerer.persistence.enabledVolumesTriggerer logs PVCtrue
tdp-airflow.triggerer.persistence.sizeVolumesSize of the Triggerer logs PVC5Gi
tdp-airflow.logs.persistence.enabledVolumesTask logs PVCfalse
tdp-airflow.logs.persistence.sizeVolumesSize of the task logs PVC5Gi
TDP-Settings.s3Connection.enabledIntegrationCreates the Airflow S3 Secret and connectionfalse
TDP-Settings.s3Connection.secretNameIntegrationName of the S3 connection Secrettdp-airflow-minio-connection
TDP-Settings.s3Connection.uriIntegrationURI of the S3 endpointhttps://<s3-endpoint>
TDP-Settings.gateway.ingress.enabledExposureRenders the Ingressfalse
TDP-Settings.gateway.gatewayApi.enabledExposureRenders the Gateway API HTTPRoutefalse
ingress.ingressClassNameExposureIngress class""
ingress.hostsExposureIngress hostnames and pathsairflow.tdp.local, path /
gatewayApi.gateway.enabledExposureCreates a Gateway in the release namespacefalse
gatewayApi.parentRefsExposureGateway the HTTPRoute links to[]
gatewayApi.airflow.hostnamesExposureHTTPRoute hostnamesairflow.tdp.local

For the complete list of parameters, see the chart values.yaml or run helm show values for the installed version.

Next steps​