apiVersion: apps/v1
kind: Deployment
metadata:
  name: pomerium-proxy
  labels:
    app: pomerium-proxy
  namespace: pomerium
spec:
  replicas: 1
  selector:
    matchLabels:
      app: pomerium-proxy
  template:
    metadata:
      labels:
        app: pomerium-proxy
    spec:
      containers:
        - image: pomerium/pomerium:v0.2.0
          name: pomerium-proxy
          ports:
            - containerPort: 443
              name: https
              protocol: TCP
          env:
            - name: SERVICES
              value: proxy
            - name: AUTHORIZE_SERVICE_URL
              value: https://pomerium-authorize-service.pomerium.svc.cluster.local
            - name: AUTHENTICATE_SERVICE_URL
              value: https://authenticate.corp.beyondperimeter.com
            - name: AUTHENTICATE_INTERNAL_URL
              value: "https://pomerium-authenticate-service.pomerium.svc.cluster.local"
            - name: OVERRIDE_CERTIFICATE_NAME
              value: "*.corp.beyondperimeter.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
            # e.g. service account for group retrieval, e.g. gsuite
            - 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
            - name: POLICY
              valueFrom:
                configMapKeyRef:
                  name: policy
                  key: policy
          readinessProbe:
            httpGet:
              path: /ping
              port: 443
              scheme: HTTPS
          livenessProbe:
            httpGet:
              path: /ping
              port: 443
              scheme: HTTPS
            initialDelaySeconds: 10
            timeoutSeconds: 1
