apiVersion: v1 kind: Service metadata: name: airflow spec: selector: app: airflow ports: - port: 8080 targetPort: 8080 --- apiVersion: apps/v1 kind: Deployment metadata: name: airflow spec: replicas: 1 strategy: type: Recreate selector: matchLabels: app: airflow template: metadata: labels: app: airflow spec: containers: - name: airflow image: ${AIRFLOW_IMAGE} args: ["standalone"] env: - name: AIRFLOW__CORE__EXECUTOR value: LocalExecutor - name: AIRFLOW__CORE__LOAD_EXAMPLES value: "false" - name: AIRFLOW__DATABASE__SQL_ALCHEMY_CONN valueFrom: secretKeyRef: {name: airflow-connections, key: SQL_ALCHEMY_CONN} - name: AIRFLOW_CONN_APP_DB valueFrom: secretKeyRef: {name: airflow-connections, key: AIRFLOW_CONN_APP_DB} - name: AIRFLOW__CORE__FERNET_KEY valueFrom: secretKeyRef: {name: airflow, key: FERNET_KEY} - name: _AIRFLOW_WWW_USER_USERNAME valueFrom: secretKeyRef: {name: airflow, key: ADMIN_USER} - name: _AIRFLOW_WWW_USER_PASSWORD valueFrom: secretKeyRef: {name: airflow, key: ADMIN_PASSWORD} ports: - containerPort: 8080 volumeMounts: - name: dags mountPath: /opt/airflow/dags readinessProbe: httpGet: path: /health port: 8080 # First boot runs the whole migration before it serves anything. initialDelaySeconds: 60 periodSeconds: 15 failureThreshold: 20 volumes: - name: dags configMap: name: airflow-dags optional: true