반응형
1. values.yaml
# values.yaml
config:
webserver:
expose_config: 'True' # by default this is 'False'i
postgresql:
enabled: true
postgresqlPassword: postgres
postgresqlUsername: postgres
volumePermissions:
enabled: true
createUserJob:
useHelmHooks: false
migrateDatabaseJob:
useHelmHooks: false
persistence:
enabled: false
volumePermissions:
enabled: true
executor: "KubernetesExecutor"
2. pv.yaml
kind: PersistentVolume
apiVersion: v1
metadata:
name: airflow-postgres-pv-volume
namespace: airflow
labels:
type: local
app: data-airflow-postgresql-0
spec:
storageClassName: manual
capacity:
storage: 5Gi
accessModes:
- ReadWriteMany
hostPath:
path: "/data"
---
kind: PersistentVolume
apiVersion: v1
metadata:
name: airflow-logs-pv-volume
namespace: airflow
labels:
type: local
app: airflow
spec:
storageClassName: manual
capacity:
storage: 5Gi
accessModes:
- ReadWriteMany
hostPath:
path: "/data"
---
kind: PersistentVolumeClaim
apiVersion: v1
metadata:
name: data-airflow-postgresql-0
namespace: airflow
labels:
app: data
spec:
storageClassName: manual
# volumeName: airflow-postgres-pv-volume
accessModes:
- ReadWriteMany
resources:
requests:
storage: 5Gi
---
kind: PersistentVolume
apiVersion: v1
metadata:
name: airflow-redis-pv-volume
namespace: airflow
labels:
type: local
app: redis-db
spec:
storageClassName: manual
capacity:
storage: 5Gi
accessModes:
- ReadWriteMany
hostPath:
path: "/data"
---
kind: PersistentVolumeClaim
apiVersion: v1
metadata:
name: redis-db-airflow-redis-0
namespace: airflow
labels:
app: redis-db
spec:
storageClassName: manual
accessModes:
- ReadWriteMany
resources:
requests:
storage: 5Gi
---
kind: PersistentVolumeClaim
apiVersion: v1
metadata:
name: logs-airflow-worker-0
namespace: airflow
labels:
app: airflow-worker
spec:
storageClassName: manual
accessModes:
- ReadWriteMany
resources:
requests:
storage: 5Gi
---
3. add repo
#!/bin/zsh
helm repo add apache-airflow https://airflow.apache.org
helm upgrade --install airflow apache-airflow/airflow --set volumePermissions.enabled=true --namespace airflow --create-namespace --timeout 30m --debug -f values.yaml #-f example-example-values.yaml
4. ingress
apiVersion: networking.k8s.io/v1
kind: IngressClass
metadata:
namespace: airflow
name: airflow-ing-class
spec:
controller: k8s.io/ingress-nginx
---
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: airflow-ingress
namespace: airflow
spec:
ingressClassName: airflow-ing-class # changed kube-dashboard-ing-class -> nginx
tls:
- hosts:
- "*.your host"
secretName: airflow-fernet-key
rules:
- host: your host
http:
paths:
- path: /
pathType: Prefix
backend:
service:
name: airflow-webserver
port:
number: 8080
반응형
'데이터 엔지니어' 카테고리의 다른 글
데이터 엔지니어 스택 쌓기 (0) | 2022.10.21 |
---|