https://github.com/apache/airflow/blob/main/chart/values.yaml https://github.com/airflow-helm/charts/blob/main/charts/airflow/values.yaml https://airflow.apache.org/docs/helm-chart/stable/manage-dags-files.html
Official Helm Chart version 1.11.0
Apache Airflow version 2.7.1
airflow needs to store data in volumes, dynamic volumes as soon as the airflow needs volume k8s cluster will create for us. That said in order to create that volume with EBS, we need to install the corresponding driver https://github.com/kubernetes-sigs/aws-ebs-csi-driver/blob/master/docs/install.md
Helm chart for AWS EBS CSI Driver
Add the aws-ebs-csi-driver Helm repository.
helm repo add aws-ebs-csi-driver https://kubernetes-sigs.github.io/aws-ebs-csi-driver
helm repo update
Install the latest release of the driver.
helm upgrade --install aws-ebs-csi-driver
--namespace kube-system
aws-ebs-csi-driver/aws-ebs-csi-driver
helm repo: in order to deploy airflow we use helm chart and we should inform flux where to find this helm chart: so we create a repository object. The goal of the repo object is to define where the helm chart of airflow is. flux will check in 1m intervals if there is a new airflow helm chart in url .. airflow apache.org. if we push that file flux will create the coreesponding object in k8s cluster helm release object is used to deploy airflow based on its helmchart in cluster - helm release is an instance of the chart in cluster release name is the release for helm, name is helmrelease for flux (terraform) airflow version : version of the airflow to be deployed
flux logs --follow --level=error --all-namespaces
flux delete helmrelease airflow -n dev
flux get all
dags: persistence: enabled: False gitSync: enabled: True repo: [email protected]:Hilalem/airflow-private-dags.git branch: master maxFailures: 0 subPath: "" wait: 60 sshKeySecret: airflow-ssh-secret extraSecrets: airflow-ssh-secret: data: | gitSshKey: 'LS0tLS1CRUdJTiBPUEVOU1NIIFBSSVZBVEUgS0VZLS0tLS0KYjNCbGJuTnphQzFyWlhrdGRqRUFBQUFBQkc1dmJtVUFBQUFFYm05dVpRQUFBQUFBQUFBQkFBQUNGd0FBQUFkemMyZ3RjbgpOaEFBQUFBd0VBQVFBQUFnRUF0bkxldzZNRDNnN1JhRkdQMkdGcllNT1VKQytXVGNCcS9adEh2UVo4dStmVUFYV1R1ZEFMCmhnN0V0VlBWM0xBU2pvSlM4Q3c5MnFVU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ZFhSbExtbHVkR1Z5Ym1Gc0FRSURCQVU9Ci0tLS0tRU5EIE9QRU5TU0ggUFJJVkFURSBLRVktLS0tLQo='
Ingress:
1)IAM folder contains iam policies, roles, role bindings
airflow-rbac-role-alb-ingress.yml contains cluster role, cluster role binding and service account used by ingress controller to interact with resources in the eks cluster
- creating the IAM policy will be used by the ingress controller to interact with aws services # Create an IAM policy ALBIngressControllerIAMPolicy to alllow ALB makes API calls on your behalf Copy the Policy.Arn value "Arn": "arn:aws:iam::339712758698:policy/ALBIngressControllerIAMPolicy",
aws iam create-policy
--policy-name ALBIngressControllerIAMPolicy
--policy-document file://airflow-materials-aws/section-7/iam/iam-alb-policy.json
arn:aws:iam::339712758698:policy/ALBIngressControllerIAMPolicy
3)# Create a service account and an IAM role for the pod running AWS ALB Ingress controller
eksctl create iamserviceaccount
--cluster=airflow
--namespace=kube-system
--name=alb-ingress-controller
--attach-policy-arn=$PolicyARN
--override-existing-serviceaccounts
--approve