apiVersion: apps/v1
kind: Deployment
metadata:
  name: argocd-dex-server
spec:
  selector:
    matchLabels:
      app.kubernetes.io/name: argocd-dex-server
  template:
    metadata:
      labels:
        app.kubernetes.io/name: argocd-dex-server
    spec:
      affinity:
        podAntiAffinity:
          preferredDuringSchedulingIgnoredDuringExecution:
            - podAffinityTerm:
                labelSelector:
                  matchLabels:
                    app.kubernetes.io/part-of: argocd
                topologyKey: kubernetes.io/hostname
              weight: 5
      containers:
        - command:
            - /shared/argocd-dex
            - rundex
          image: ghcr.io/dexidp/dex:v2.27.0@sha256:ff94efdd1ec68f43e01b39a2d11a73961b1cf73860515893118af731551f1939
          imagePullPolicy: IfNotPresent
          name: dex
          ports:
            - containerPort: 5556
            - containerPort: 5557
            - containerPort: 5558
          volumeMounts:
            - mountPath: /shared
              name: static-files
      initContainers:
        - command:
            - cp
            - -n
            - /usr/local/bin/argocd
            - /shared/argocd-dex
          image: quay.io/argoproj/argocd:v2.0.3
          imagePullPolicy: IfNotPresent
          name: copyutil
          volumeMounts:
            - mountPath: /shared
              name: static-files
      serviceAccountName: argocd-dex-server
      volumes:
        - emptyDir: {}
          name: static-files
