apiVersion: apps/v1
kind: StatefulSet
metadata:
  name: authservice
  namespace: istio-system
spec:
  replicas: 1
  selector:
    matchLabels:
      app: authservice
  serviceName: authservice
  template:
    metadata:
      annotations:
        sidecar.istio.io/inject: "false"
      labels:
        app: authservice
    spec:
      containers:
      - env:
        - name: USERID_HEADER
          value: kubeflow-userid
        - name: USERID_PREFIX
          value: ""
        - name: USERID_CLAIM
          value: email
        - name: OIDC_PROVIDER
          value: http://dex.auth.svc.cluster.local:5556/dex
        - name: OIDC_AUTH_URL
          value: /dex/auth
        - name: OIDC_SCOPES
          value: profile email groups
        - name: REDIRECT_URL
          value: /login/oidc
        - name: SKIP_AUTH_URI
          value: /dex
        - name: PORT
          value: "8080"
        - name: CLIENT_ID
          value: kubeflow-oidc-authservice
        - name: CLIENT_SECRET
          value: pUBnBOY80SnXgjibTYM9ZWNzY2xreNGQok
        - name: STORE_PATH
          value: /var/lib/authservice/data.db
        image: uhub.service.ucloud.cn/a4x-kubeflow/arrikto/kubeflow/oidc-authservice:28c59ef
        imagePullPolicy: Always
        name: authservice
        ports:
        - containerPort: 8080
          name: http-api
        readinessProbe:
          httpGet:
            path: /
            port: 8081
        volumeMounts:
        - mountPath: /var/lib/authservice
          name: data
      initContainers:
      - args:
        - chmod -R 777 /var/lib/authservice;
        command:
        - sh
        - -c
        image: busybox:latest
        name: fix-permission
        volumeMounts:
        - mountPath: /var/lib/authservice
          name: data
      securityContext:
        fsGroup: 111
      volumes:
      - name: data
        persistentVolumeClaim:
          claimName: authservice-pvc
