apiVersion: apps/v1
kind: Deployment
metadata:
  labels:
    chart: airflow-1.4.0
    component: webserver
    heritage: Helm
    release: RELEASE-NAME
    tier: airflow
  name: RELEASE-NAME-webserver
spec:
  replicas: 1
  selector:
    matchLabels:
      component: webserver
      release: RELEASE-NAME
      tier: airflow
  strategy:
    rollingUpdate:
      maxSurge: 1
      maxUnavailable: 0
    type: RollingUpdate
  template:
    metadata:
      annotations:
        checksum/airflow-config: 708936888fa3858db029c48b74c491386b92b6f1b4a6c41ae7476b17dc274f10
        checksum/extra-configmaps: 2e44e493035e2f6a255d08f8104087ff10d30aef6f63176f1b18f75f73295598
        checksum/extra-secrets: bb91ef06ddc31c0c5a29973832163d8b0b597812a793ef911d33b622bc9d1655
        checksum/metadata-secret: 7c54201013e432b164782aa58433e49a9cd14d0581827b7964e495ccdbd010db
        checksum/pgbouncer-config-secret: da52bd1edfe820f0ddfacdebb20a4cc6407d296ee45bcb500a6407e2261a5ba2
        checksum/webserver-config: 4a2281a4e3ed0cc5e89f07aba3c1bb314ea51c17cb5d2b41e9b045054a6b5c72
        checksum/webserver-secret-key: 3e6b58386d663795feaa11c9bb018c4ac768509e223358f54a76ff8522dee84f
      labels:
        component: webserver
        release: RELEASE-NAME
        tier: airflow
    spec:
      affinity:
        podAntiAffinity:
          preferredDuringSchedulingIgnoredDuringExecution:
          - podAffinityTerm:
              labelSelector:
                matchLabels:
                  component: webserver
              topologyKey: kubernetes.io/hostname
            weight: 100
      containers:
      - args:
        - bash
        - -c
        - exec airflow webserver
        env:
        - name: AIRFLOW__CORE__FERNET_KEY
          valueFrom:
            secretKeyRef:
              key: fernet-key
              name: RELEASE-NAME-fernet-key
        - name: AIRFLOW__CORE__SQL_ALCHEMY_CONN
          valueFrom:
            secretKeyRef:
              key: connection
              name: RELEASE-NAME-airflow-metadata
        - name: AIRFLOW_CONN_AIRFLOW_DB
          valueFrom:
            secretKeyRef:
              key: connection
              name: RELEASE-NAME-airflow-metadata
        - name: AIRFLOW__WEBSERVER__SECRET_KEY
          valueFrom:
            secretKeyRef:
              key: webserver-secret-key
              name: RELEASE-NAME-webserver-secret-key
        - name: AIRFLOW__CELERY__CELERY_RESULT_BACKEND
          valueFrom:
            secretKeyRef:
              key: connection
              name: RELEASE-NAME-airflow-result-backend
        - name: AIRFLOW__CELERY__RESULT_BACKEND
          valueFrom:
            secretKeyRef:
              key: connection
              name: RELEASE-NAME-airflow-result-backend
        - name: AIRFLOW__CELERY__BROKER_URL
          valueFrom:
            secretKeyRef:
              key: connection
              name: RELEASE-NAME-broker-url
        envFrom: []
        image: apache/airflow:2.2.3
        imagePullPolicy: IfNotPresent
        livenessProbe:
          failureThreshold: 20
          httpGet:
            path: /health
            port: 8080
          initialDelaySeconds: 15
          periodSeconds: 5
          timeoutSeconds: 30
        name: webserver
        ports:
        - containerPort: 8080
          name: airflow-ui
        readinessProbe:
          failureThreshold: 20
          httpGet:
            path: /health
            port: 8080
          initialDelaySeconds: 15
          periodSeconds: 5
          timeoutSeconds: 30
        resources: {}
        volumeMounts:
        - mountPath: /opt/airflow/pod_templates/pod_template_file.yaml
          name: config
          readOnly: true
          subPath: pod_template_file.yaml
        - mountPath: /opt/airflow/airflow.cfg
          name: config
          readOnly: true
          subPath: airflow.cfg
        - mountPath: /opt/airflow/config/airflow_local_settings.py
          name: config
          readOnly: true
          subPath: airflow_local_settings.py
      initContainers:
      - args:
        - airflow
        - db
        - check-migrations
        - --migration-wait-timeout=60
        env:
        - name: AIRFLOW__CORE__FERNET_KEY
          valueFrom:
            secretKeyRef:
              key: fernet-key
              name: RELEASE-NAME-fernet-key
        - name: AIRFLOW__CORE__SQL_ALCHEMY_CONN
          valueFrom:
            secretKeyRef:
              key: connection
              name: RELEASE-NAME-airflow-metadata
        - name: AIRFLOW_CONN_AIRFLOW_DB
          valueFrom:
            secretKeyRef:
              key: connection
              name: RELEASE-NAME-airflow-metadata
        - name: AIRFLOW__WEBSERVER__SECRET_KEY
          valueFrom:
            secretKeyRef:
              key: webserver-secret-key
              name: RELEASE-NAME-webserver-secret-key
        - name: AIRFLOW__CELERY__CELERY_RESULT_BACKEND
          valueFrom:
            secretKeyRef:
              key: connection
              name: RELEASE-NAME-airflow-result-backend
        - name: AIRFLOW__CELERY__RESULT_BACKEND
          valueFrom:
            secretKeyRef:
              key: connection
              name: RELEASE-NAME-airflow-result-backend
        - name: AIRFLOW__CELERY__BROKER_URL
          valueFrom:
            secretKeyRef:
              key: connection
              name: RELEASE-NAME-broker-url
        envFrom: []
        image: apache/airflow:2.2.3
        imagePullPolicy: IfNotPresent
        name: wait-for-airflow-migrations
        resources: {}
      nodeSelector: {}
      restartPolicy: Always
      securityContext:
        fsGroup: 0
        runAsUser: 50000
      serviceAccountName: RELEASE-NAME-airflow-webserver
      tolerations: []
      volumes:
      - configMap:
          name: RELEASE-NAME-airflow-config
        name: config
