apiVersion: apps/v1
kind: Deployment
metadata:
  name: pomerium-authenticate
  labels:
    app: pomerium-authenticate
  namespace: pomerium
spec:
  replicas: 1
  selector:
    matchLabels:
      app: pomerium-authenticate
  template:
    metadata:
      labels:
        app: pomerium-authenticate
    spec:
      containers:
        - image: pomerium/pomerium:latest
          name: pomerium-authenticate
          ports:
            - containerPort: 443
              name: https
              protocol: TCP
          env:
            - name: SERVICES
              value: authenticate
            - name: IDP_PROVIDER
              value: google
            - name: IDP_PROVIDER_URL
              value: https://accounts.google.com
            - name: IDP_CLIENT_ID
              value: 851877082059-bfgkpj09noog7as3gpc3t7r6n9sjbgs6.apps.googleusercontent.com 
            - name: SHARED_SECRET
              valueFrom:
                secretKeyRef:
                  name: shared-secret
                  key: shared-secret
            - name: COOKIE_SECRET
              valueFrom:
                secretKeyRef:
                  name: cookie-secret
                  key: cookie-secret
            - name: IDP_CLIENT_SECRET
              valueFrom:
                secretKeyRef:
                  name: idp-client-secret
                  key: idp-client-secret
            - name: IDP_SERVICE_ACCOUNT
              valueFrom:
                secretKeyRef:
                  name: idp-service-account
                  key: idp-service-account
            - name: CERTIFICATE
              valueFrom:
                secretKeyRef:
                  name: certificate
                  key: certificate
            - name: CERTIFICATE_KEY
              valueFrom:
                secretKeyRef:
                  name: certificate-key
                  key: certificate-key
          readinessProbe:
            httpGet:
              path: /ping
              port: 443
              scheme: HTTPS
          livenessProbe:
            httpGet:
              path: /ping
              port: 443
              scheme: HTTPS
            initialDelaySeconds: 10
            timeoutSeconds: 1
