Kubernetes
We use Kubernetes to run our Apache Airflow instances in Azure AKS (Azure Kubernetes Service).
Overview
Clusters:
- Stage:
stage-bankV2-use2-aks - Production:
prod-bankV2-use2-aks
Namespace: datateam
Primary Use: Running Airflow scheduler, webserver, and worker pods
Prerequisites
Install kubectl
Install the Kubernetes command-line tool:
Verify installation:
Install Azure CLI
See the Azure setup guide for Azure CLI installation and authentication.
Connect to VPN
Ensure you're connected to Warp VPN before accessing Kubernetes resources.
VS Code Extension
Install the Kubernetes extension for VS Code.
This extension allows you to:
- 🔍 Browse clusters, namespaces, and resources
- 📊 View pod logs
- 🔧 Debug and troubleshoot
Connecting to Clusters
Get Cluster Credentials
Connect to the Stage cluster:
Connect to the Production cluster:
Verify Connection
List available contexts:
You should see both clusters listed.
Switch Between Clusters
Set the current cluster context:
# Switch to stage
kubectl config use-context stage-bankV2-use2-aks
# Switch to prod
kubectl config use-context prod-bankV2-use2-aks
Set Default Namespace
Set the Data Team namespace as default:
Now all commands will use the datateam namespace by default.
Common Operations
List Pods
View all pods in the current namespace:
View pods in a specific namespace:
View with more details:
Describe a Pod
Get detailed information about a pod:
View Pod Logs
Stream logs from a pod:
Execute Commands in Pod
Open a shell in a pod:
Run a single command:
Port Forwarding
Forward a local port to a pod:
Now you can access the pod's service at localhost:8080.