---
kind: Deployment
apiVersion: apps/v1
metadata:
  labels:
    app: kubernetes-dashboard-oidc
  name: kubernetes-dashboard-oidc
  namespace: kube-system
spec:
  replicas: 2
  revisionHistoryLimit: 2
  selector:
    matchLabels:
      app: kubernetes-dashboard-oidc
  template:
    metadata:
      labels:
        app: kubernetes-dashboard-oidc
    spec:
      containers:
      - name: openresty-oidc
        image: myobplatform/openresty-oidc:1.1.1
        ports:
        - containerPort: 9000
          protocol: TCP
        env:
          - name: OIDC_CLIENT_ID
            valueFrom:
              secretKeyRef:
                name: kubernetes-dashboard-oidc
                key: client_id
          - name: OIDC_CLIENT_SECRET
            valueFrom:
              secretKeyRef:
                name: kubernetes-dashboard-oidc
                key: client_secret
        volumeMounts:
          - name: openresty-conf
            mountPath: /conf
            readOnly: true
        args:
          - "-c"
          - "/conf/nginx.conf"
      volumes:
        - name: openresty-conf
          configMap:
            name: kubernetes-dashboard-oidc-config
