apiVersion: apps/v1
kind: Deployment
metadata:
  name: dex
  namespace: dex
  labels:
    app.kubernetes.io/name: dex
    app.kubernetes.io/part-of: dex
spec:
  replicas: 1
  selector:
    matchLabels:
      app.kubernetes.io/name: dex
      app.kubernetes.io/part-of: dex
  strategy:
    type: Recreate
  template:
    metadata:
      labels:
        app.kubernetes.io/name: dex
        app.kubernetes.io/part-of: dex
    spec:
      serviceAccountName: dex
      containers:
      - image: quay.io/dexidp/dex:v2.16.0
        name: dex
        command: ["/usr/local/bin/dex", "serve", "/etc/dex/cfg/config.yaml"]
        ports:
        - name: dex
          containerPort: 443
        - name: mock
          containerPort: 5555
        volumeMounts:
        - name: config
          mountPath: /etc/dex/cfg
        - name: tls
          mountPath: /etc/dex/tls
        securityContext:
          runAsUser: 0
          capabilities:
            add:
              - NET_BIND_SERVICE
        env:
        - name: GOOGLE_CLIENT_ID
          valueFrom:
            secretKeyRef:
              name: gcp-oauth-client
              key: client-id
        - name: GOOGLE_CLIENT_SECRET
          valueFrom:
            secretKeyRef:
              name: gcp-oauth-client
              key: client-secret
      volumes:
      - name: config
        configMap:
          name: dex
          items:
          - key: config.yaml
            path: config.yaml
      - name: tls
        secret:
          secretName: dex.pulsifer.dev
