apiVersion: batch/v1
kind: Job
metadata:
  annotations:
    helm.sh/hook: post-install,post-upgrade
    helm.sh/hook-delete-policy: before-hook-creation,hook-succeeded
    helm.sh/hook-weight: "2"
  labels:
    chart: airflow-1.4.0
    component: create-user-job
    heritage: Helm
    release: RELEASE-NAME
    tier: airflow
  name: RELEASE-NAME-create-user
spec:
  template:
    metadata:
      labels:
        component: create-user-job
        release: RELEASE-NAME
        tier: airflow
    spec:
      affinity: {}
      containers:
      - args:
        - bash
        - -c
        - airflow users create "$@"
        - --
        - -r
        - Admin
        - -u
        - admin
        - -e
        - admin@example.com
        - -f
        - admin
        - -l
        - user
        - -p
        - admin
        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: create-user
        resources: {}
        volumeMounts:
        - mountPath: /opt/airflow/airflow.cfg
          name: config
          readOnly: true
          subPath: airflow.cfg
      nodeSelector: {}
      restartPolicy: OnFailure
      securityContext:
        fsGroup: 0
        runAsUser: 50000
      serviceAccountName: RELEASE-NAME-airflow-create-user-job
      tolerations: []
      volumes:
      - configMap:
          name: RELEASE-NAME-airflow-config
        name: config
