---
apiVersion: apps/v1
kind: Deployment
metadata:
  labels:
    name: dex
  name: dex
  namespace: kube-auth
spec:
  minReadySeconds: 30
  progressDeadlineSeconds: 600
  replicas: 1
  revisionHistoryLimit: 10
  selector:
    matchLabels:
      name: dex
  strategy:
    rollingUpdate:
      maxSurge: 25%
      maxUnavailable: 0
    type: RollingUpdate
  template:
    metadata:
      labels:
        name: dex
    spec:
      containers:
        - command:
            - /usr/local/bin/dex
            - serve
            - /etc/dex/conf/config.yaml
          image: index.docker.io/dexidp/dex:v2.30.2
          imagePullPolicy: IfNotPresent
          livenessProbe:
            initialDelaySeconds: 5
            tcpSocket:
              port: 5556
            timeoutSeconds: 3
          name: dex
          ports:
            - containerPort: 5556
              name: http
              protocol: TCP
            - containerPort: 5558
              name: metrics
          readinessProbe:
            failureThreshold: 3
            httpGet:
              path: /healthz
              port: 5556
              scheme: HTTP
            initialDelaySeconds: 5
            periodSeconds: 10
          volumeMounts:
            - mountPath: /etc/dex/conf
              name: config
          env:
            - name: KUBERNETES_POD_NAMESPACE
              valueFrom:
                fieldRef:
                  fieldPath: metadata.namespace
        - command:
            - /app/bin/dex-k8s-ingress-watcher
            - serve
            - --incluster
            - --ingress-controller
            - --configmap-controller
            - --secret-controller
            - --dex-grpc-address
            - 127.0.0.1:5557
          image: mintel/dex-k8s-ingress-watcher:test
          imagePullPolicy: IfNotPresent
          livenessProbe:
            failureThreshold: 3
            httpGet:
              path: /healthz
              port: 8080
            initialDelaySeconds: 5
            periodSeconds: 10
          name: dex-k8s-ingress-watcher
          readinessProbe:
            failureThreshold: 3
            httpGet:
              path: /readiness
              port: 8080
            initialDelaySeconds: 5
            periodSeconds: 10
      serviceAccount: dex
      serviceAccountName: dex
      terminationGracePeriodSeconds: 30
      volumes:
        - configMap:
            defaultMode: 420
            items:
              - key: config.yaml
                path: config.yaml
            name: dex
          name: config
