apiVersion: apps/v1
kind: Deployment
metadata:
  namespace: openshift-authentication-operator
  name: authentication-operator
  labels:
    app: authentication-operator
  annotations:
    include.release.openshift.io/self-managed-high-availability: "true"
    config.openshift.io/inject-proxy: authentication-operator
    exclude.release.openshift.io/internal-openshift-hosted: "true"
spec:
  replicas: 1
  selector:
    matchLabels:
      app: authentication-operator
  template:
    metadata:
      name: authentication-operator
      labels:
        app: authentication-operator
    spec:
      serviceAccountName: authentication-operator
      containers:
      - name: authentication-operator
        image: quay.io/openshift/origin-cluster-authentication-operator:v4.0
        imagePullPolicy: IfNotPresent
        command: ["/bin/bash", "-ec"]
        args:
        - |
          if [ -s /var/run/configmaps/trusted-ca-bundle/ca-bundle.crt ]; then
              echo "Copying system trust bundle"
              cp -f /var/run/configmaps/trusted-ca-bundle/ca-bundle.crt /etc/pki/ca-trust/extracted/pem/tls-ca-bundle.pem
          fi
          exec authentication-operator operator --config=/var/run/configmaps/config/operator-config.yaml --v=2 --terminate-on-files=/var/run/configmaps/trusted-ca-bundle/ca-bundle.crt
        resources:
          requests:
            memory: 50Mi
            cpu: 10m
        securityContext:
          readOnlyRootFilesystem: false # because of the `cp` in args
        volumeMounts:
        - mountPath: /var/run/configmaps/config
          name: config
        - mountPath: /var/run/secrets/serving-cert
          name: serving-cert
        - mountPath: /var/run/configmaps/trusted-ca-bundle
          name: trusted-ca-bundle
          readOnly: true
        - mountPath: /var/run/configmaps/service-ca-bundle
          name: service-ca-bundle
          readOnly: true
        env:
        - name: IMAGE_OAUTH_SERVER
          value: quay.io/openshift/origin-oauth-server:v4.2
        - name: IMAGE_OAUTH_APISERVER
          value: quay.io/openshift/origin-oauth-apiserver:v4.6
        - name: OPERATOR_IMAGE_VERSION
          value: "0.0.1-snapshot"
        - name: OPERAND_OAUTH_SERVER_IMAGE_VERSION
          value: "0.0.1-snapshot_openshift"
        - name: POD_NAME
          valueFrom:
            fieldRef:
              fieldPath: metadata.name
        terminationMessagePolicy: FallbackToLogsOnError
      volumes:
      - name: config
        configMap:
          defaultMode: 440
          name: authentication-operator-config
      - name: trusted-ca-bundle
        configMap:
          name: trusted-ca-bundle
          optional: true
      - name: serving-cert
        secret:
          secretName: serving-cert
          optional: true
      - name: service-ca-bundle
        configMap:
          name: service-ca-bundle
          optional: true
      nodeSelector:
        node-role.kubernetes.io/master: ""
      priorityClassName: "system-cluster-critical"
      tolerations:
      - key: "node-role.kubernetes.io/master"
        operator: "Exists"
        effect: "NoSchedule"
      - key: "node.kubernetes.io/unreachable"
        operator: "Exists"
        effect: "NoExecute"
        tolerationSeconds: 120 
      - key: "node.kubernetes.io/not-ready"
        operator: "Exists"
        effect: "NoExecute"
        tolerationSeconds: 120 
