Skip to content
MasterData
  • Home
  • All Courses
  • Blog
    • Apache Spark
Start Learning
Start Learning
MasterData
  • Home
  • All Courses
  • Blog
    • Apache Spark

Apache Airflow

2
  • Apache Airflow: What, Why, and How?
  • How to Deploy Apache Airflow on Kubernetes

Apache Iceberg

3
  • [01] – Introduction to Apache Iceberg
  • [02] – Getting Started with Apache Iceberg
  • [03] – Apache Iceberg Architecture

Apache Spark

4
  • [00] – Apache Spark By Example Course
  • [01] – What is Apache Spark?
  • [02] – Installing Apache Spark Locally
  • [03] – Deploy Apache Spark with Kubernetes (K8s)

Data Build Tool (DBT)

7
  • [00] – dbt by Example Course
  • [01] – dbt : What it is, Why and How?
  • [02] – Install dbt in local
  • [03] – Explore dbt Models
  • [04] – Sources in dbt
  • [05] – Seeds in dbt
  • [06] – Jinja Templates and Macros in dbt

SQL - Advanced

2
  • [02] – View vs Materialized View
  • [03] – Window function in SQL

SQL - Basics

1
  • 02 – Understanding SQL Operations (DML, DDL, DCL, and TCL)

SQL - Intermediate

1
  • SQL Joins: Understanding INNER, LEFT, RIGHT, and FULL Joins
  • Home
  • Docs
  • Data Orchestration
  • Apache Airflow
  • How to Deploy Apache Airflow on Kubernetes
View Categories

How to Deploy Apache Airflow on Kubernetes

kerrache.massipssa

In this tutorial, you’ll learn how to install Apache Airflow on a Kubernetes cluster. We’ll first deploy Airflow on Kubernetes using Helm, run a sample DAG, and then clean up the installation. By the end, you’ll have a fully functional Airflow setup on Kubernetes.

Please note that a basic understanding of Kubernetes is required to follow this tutorial.

Prerequisites #

Before you start, make sure that the following tools are installed on your local system.

Prerequisites
  • A Kubernetes cluster (Or a local Kubernetes cluster with installation of Docker Desktop or MiniKube)
  • kubectl to manage Kubernetes resources
  • Helm to deploy resources based on Helm charts

Step 1: Create airflow namespace #

To start, let’s create a dedicated namespace for Airflow within the Kubernetes cluster. Using a separate namespace helps isolate Airflow’s resources, making it easier to manage, monitor, and troubleshoot while preventing conflicts with other deployments.

kubectl create ns airflow

Step 2: Add Airflow Helm repository #

Now that the Airflow namespace is in place, we need to add the Airflow Helm repository. Use the following commands:

helm repo add apache-airflow https://airflow.apache.org
helm repo update
helm search repo airflow

To confirm that the Airflow repository has been added, run:

helm repo list

The result should include the name of the Airflow repository.

NAME        URL
apache-airflow   https://airflow.apache.org

With the repository configured, it’s time to deploy Apache Airflow to your Kubernetes cluster Helm install command bellow.

helm install airflow apache-airflow/airflow --namespace airflow --debug

Step 3: Verify the Deployment #

To ensure that Airflow has been deployed successfully, you can check the status of the pods.

kubectl get pods -n airflow

You should get results similar to the following.

NAME                                     READY   STATUS    RESTARTS   AGE
airflow-postgresql-0                     1/1     Running   0          5m17s
airflow-redis-0                          1/1     Running   0          5m17s
airflow-scheduler-6f48fcad45-kkxmr       2/2     Running   0          5m17s
airflow-statsd-7d985bcb6f-b42t7          1/1     Running   0          5m17s
airflow-triggerer-0                      2/2     Running   0          5m17s
airflow-webserver-9f64f5b98-gv4sk        1/1     Running   0          5m17s
airflow-worker-0                         2/2     Running   0          5m17s

Step 4: Port Forwarding for Airflow #

Once Airflow is deployed, a service named airflow-webserver is also deployed. To get the name of the service, run the command:

kubectl get svc -n airflow

The result should resemble the screen below

NAME                   TYPE        CLUSTER-IP       EXTERNAL-IP   PORT(S)               AGE
airflow-postgresql     ClusterIP   10.108.13.202    <none>        5432/TCP              6m47s
airflow-postgresql-hl  ClusterIP   None             <none>        5432/TCP              6m47s
airflow-redis          ClusterIP   10.101.6.45      <none>        6379/TCP              6m47s
airflow-statsd         ClusterIP   10.102.16.173    <none>        9125/UDP, 9102/TCP    6m47s
airflow-triggerer      ClusterIP   None             <none>        8794/TCP              6m47s
airflow-webserver      ClusterIP   10.109.38.86     <none>        8080/TCP              6m47s
airflow-worker         ClusterIP   None             <none>        8793/TCP              6m47s

Now, run the following command tu to forward the service’s port to your local machine.

kubectl port-forward svc/airflow-webserver 8080:8080 -n airflow

Step 5: Log in to Airflow #

After setting up Apache Airflow, please wait for a moment.

Open a web browser and navigate to http://localhost:8080. You should see the Apache Airflow login page.

Log in using the following credentials:

  • Username: admin
  • Password: admin

Please note that you should not use these for production environments.

Step 6: Cleanup #

Once you’ve completed your tasks and want to uninstall the Airflow Helm Charts Release, you can use the following command:

helm uninstall airflow  --namespace airflow

You might also find it necessary to keep an eye on your Airflow installation. To achieve this, you can establish a monitoring platform by following the instructions in our guide Deploy Prometheus Operator in Kubernetes.

Updated on March 1, 2025

Leave a Reply Cancel reply

You must be logged in to post a comment.

Table of Contents
  • Prerequisites
  • Step 1: Create airflow namespace
  • Step 2: Add Airflow Helm repository
  • Step 3: Verify the Deployment
  • Step 4: Port Forwarding for Airflow
  • Step 5: Log in to Airflow
  • Step 6: Cleanup

Copyright © 2025 MasterData

Powered by MasterData

Manage Consent
To provide the best experiences, we use technologies like cookies to store and/or access device information. Consenting to these technologies will allow us to process data such as browsing behavior or unique IDs on this site. Not consenting or withdrawing consent, may adversely affect certain features and functions.
Functional Always active
The technical storage or access is strictly necessary for the legitimate purpose of enabling the use of a specific service explicitly requested by the subscriber or user, or for the sole purpose of carrying out the transmission of a communication over an electronic communications network.
Preferences
The technical storage or access is necessary for the legitimate purpose of storing preferences that are not requested by the subscriber or user.
Statistics
The technical storage or access that is used exclusively for statistical purposes. The technical storage or access that is used exclusively for anonymous statistical purposes. Without a subpoena, voluntary compliance on the part of your Internet Service Provider, or additional records from a third party, information stored or retrieved for this purpose alone cannot usually be used to identify you.
Marketing
The technical storage or access is required to create user profiles to send advertising, or to track the user on a website or across several websites for similar marketing purposes.
Manage options Manage services Manage {vendor_count} vendors Read more about these purposes
View preferences
{title} {title} {title}