apiVersion: apps/v1
kind: Deployment
metadata:
  name: iap-enabler
  namespace: istio-system
  labels:
    kustomize.component: iap-ingress
spec:
  replicas: 1
  selector:
    matchLabels:
      kustomize.component: iap-ingress
  template:
    metadata:
      labels:
        service: iap-enabler
        kustomize.component: iap-ingress
    spec:
      restartPolicy: Always
      serviceAccountName: kf-admin
      containers:
      - name: iap
        image: gcr.io/gcp-private-dev/mirror/gcr.io/kubeflow-images-public/ingress-setup:latest
        command:
        - bash
        - /var/envoy-config/setup_backend.sh
        env:
        - 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"
        volumeMounts:
        - name: config-volume
          mountPath: /var/envoy-config/
      volumes:
      - name: config-volume
        configMap:
          name: envoy-config
