# Source: oauth2-proxy/templates/deployment.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
  labels:
    app: oauth2-proxy
    chart: oauth2-proxy-5.0.3
    heritage: Helm
    release: oauth2-proxy
    gitops.jenkins-x.io/pipeline: 'namespaces'
  name: oauth2-proxy
  annotations:
    meta.helm.sh/release-name: 'oauth2-proxy'
    wave.pusher.com/update-on-config-change: 'true'
  namespace: jx
spec:
  replicas: 1
  selector:
    matchLabels:
      app: oauth2-proxy
      release: oauth2-proxy
  template:
    metadata:
      annotations:
        checksum/config: 9735d3d342d561cbeca43621754481f666bb9b57ce7efe27262a00045300294f
        checksum/config-emails: 01ba4719c80b6fe911b091a7c05124b64eeece964e09c058ef8f9805daca546b
        checksum/secret: 9a8a17727baf0f9b35ae978c7dbb89d9178bae4270e42b6a72b5776f3070cb30
        checksum/google-secret: e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855
      labels:
        app: oauth2-proxy
        release: "oauth2-proxy"
    spec:
      serviceAccountName: oauth2-proxy
      containers:
        - name: oauth2-proxy
          image: "quay.io/oauth2-proxy/oauth2-proxy:v7.0.1"
          imagePullPolicy: IfNotPresent
          args:
            - --http-address=0.0.0.0:4180
            - --keycloak-group=/jx-admin
            - --login-url=https://identity.ihsws.it/auth/realms/ihsws/protocol/openid-connect/auth
            - --profile-url=https://identity.ihsws.it/auth/realms/ihsws/protocol/openid-connect/userinfo
            - --provider=keycloak
            - --redeem-url=https://identity.ihsws.it/auth/realms/ihsws/protocol/openid-connect/token
            - --scope=profile
            - --validate-url=https://identity.ihsws.it/auth/realms/ihsws/protocol/openid-connect/userinfo
            - --config=/etc/oauth2_proxy/oauth2_proxy.cfg
          env:
            - name: OAUTH2_PROXY_CLIENT_ID
              valueFrom:
                secretKeyRef:
                  name: oauth2-proxy
                  key: client-id
            - name: OAUTH2_PROXY_CLIENT_SECRET
              valueFrom:
                secretKeyRef:
                  name: oauth2-proxy
                  key: client-secret
            - name: OAUTH2_PROXY_COOKIE_SECRET
              valueFrom:
                secretKeyRef:
                  name: oauth2-proxy
                  key: cookie-secret
          ports:
            - containerPort: 4180
              name: http
              protocol: TCP
          livenessProbe:
            httpGet:
              path: /ping
              port: http
              scheme: HTTP
            initialDelaySeconds: 0
            timeoutSeconds: 1
          readinessProbe:
            httpGet:
              path: /ping
              port: http
              scheme: HTTP
            initialDelaySeconds: 0
            timeoutSeconds: 1
            successThreshold: 1
            periodSeconds: 10
          resources: {}
          volumeMounts:
            - mountPath: /etc/oauth2_proxy
              name: configmain
      volumes:
        - configMap:
            defaultMode: 420
            name: oauth2-proxy
          name: configmain
      tolerations: []
