Skip to content

Instantly share code, notes, and snippets.

View holypriest's full-sized avatar

Marcelo Rabello Rossi holypriest

View GitHub Profile
@holypriest
holypriest / export_yamls.sh
Created July 17, 2020 01:59
Exporting resource yaml files from Airflow helm chart
mkdir yamls
helm template --output-dir './yamls' '<folder-containing-the-helm-chart>'
@holypriest
holypriest / dags-pv.yaml
Last active March 9, 2022 12:34
PersistentVolume configuration to store Apache Airflow DAG files
apiVersion: v1
kind: PersistentVolume
metadata:
name: dags-pv
labels:
store: dags
spec:
capacity:
storage: 10Gi
volumeMode: Filesystem
@holypriest
holypriest / dags-pvc.yaml
Created July 17, 2020 02:13
PersistentVolumeClaim configuration to store Apache Airflow DAG files
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: dags-pvc
namespace: airflow-on-k8s
spec:
selector:
matchLabels:
store: dags
accessModes:
@holypriest
holypriest / efs-sc.yaml
Last active July 20, 2020 04:36
StorageClass configuration for an AWS EFS-based storage
kind: StorageClass
apiVersion: storage.k8s.io/v1
metadata:
name: efs-sc
provisioner: efs.csi.aws.com
@holypriest
holypriest / deployment-scheduler.yaml
Last active May 26, 2021 10:03
Deployment configuration for the Airflow scheduler
kind: Deployment
apiVersion: apps/v1
metadata:
name: airflow-scheduler
namespace: airflow-on-k8s
spec:
replicas: 1
selector:
matchLabels:
tier: airflow
@holypriest
holypriest / service-webserver.yaml
Created July 17, 2020 02:29
Service configuration for Airflow webserver
kind: Service
apiVersion: v1
metadata:
name: webserver-svc
namespace: airflow-on-k8s
spec:
type: ClusterIP
selector:
tier: airflow
component: webserver
@holypriest
holypriest / serviceaccount-scheduler.yaml
Created July 17, 2020 02:32
ServiceAccount configuration for Airflow scheduler
kind: ServiceAccount
apiVersion: v1
metadata:
name: scheduler-sva
namespace: airflow-on-k8s
@holypriest
holypriest / assume-role-policy.json
Last active July 20, 2020 04:10
AssumeRole policy to allow Kubernetes ServiceAccounts to access AWS resources
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "",
"Effect": "Allow",
"Principal": {
"Federated": "arn:aws:iam::<your-aws-account>:oidc-provider/oidc.eks.us-east-1.amazonaws.com/id/<oidc-of-your-eks-cluster>"
},
"Action": "sts:AssumeRoleWithWebIdentity",
@holypriest
holypriest / serviceaccount-pods.yaml
Last active July 20, 2020 04:06
Example of a ServiceAccount for the pods, associating them with an AWS IAM role
apiVersion: v1
kind: ServiceAccount
metadata:
name: tasks-sva
namespace: airflow-on-k8s
annotations:
eks.amazonaws.com/role-arn: arn:aws:iam::<your-aws-account-id>:role/AirflowK8SRole
@holypriest
holypriest / namespace.yaml
Created July 20, 2020 04:22
Declaration of the airflow-on-k8s namespace
kind: Namespace
apiVersion: v1
metadata:
name: airflow-on-k8s