apiVersion: apps/v1
kind: Deployment
metadata:
  labels:
    kustomize.component: iap-ingress
  name: iap-enabler
  namespace: kubeflow
spec:
  replicas: 1
  selector:
    matchLabels:
      kustomize.component: iap-ingress
  template:
    metadata:
      labels:
        kustomize.component: iap-ingress
        service: iap-enabler
    spec:
      containers:
      - command:
        - bash
        - /var/envoy-config/setup_backend.sh
        env:
        - name: GOOGLE_APPLICATION_CREDENTIALS
          value: /var/run/secrets/sa/admin-gcp-sa.json
        - name: NAMESPACE
          value: istio-system
        - name: SERVICE
          value: istio-ingressgateway
        - name: INGRESS_NAME
          value: envoy-ingress
        - name: ENVOY_ADMIN
          value: http://localhost:8001
        - name: USE_ISTIO
          value: "true"
        image: gcr.io/kubeflow-images-public/ingress-setup:latest
        name: iap
        volumeMounts:
        - mountPath: /var/run/secrets/sa
          name: sa-key
          readOnly: true
        - mountPath: /var/envoy-config/
          name: config-volume
      restartPolicy: Always
      serviceAccountName: kf-admin
      volumes:
      - name: sa-key
        secret:
          secretName: admin-gcp-sa
      - configMap:
          name: envoy-config
        name: config-volume
