apiVersion: apps/v1
kind: StatefulSet
metadata:
  labels:
    app: kfserving
    app.kubernetes.io/component: kfserving
    app.kubernetes.io/name: kfserving
    control-plane: kfserving-controller-manager
    controller-tools.k8s.io: "1.0"
    kustomize.component: kfserving
  name: kfserving-controller-manager
  namespace: kubeflow
spec:
  selector:
    matchLabels:
      app: kfserving
      app.kubernetes.io/component: kfserving
      app.kubernetes.io/name: kfserving
      control-plane: kfserving-controller-manager
      controller-tools.k8s.io: "1.0"
      kustomize.component: kfserving
  serviceName: controller-manager-service
  template:
    metadata:
      annotations:
        sidecar.istio.io/inject: "false"
      labels:
        app: kfserving
        app.kubernetes.io/component: kfserving
        app.kubernetes.io/name: kfserving
        control-plane: kfserving-controller-manager
        controller-tools.k8s.io: "1.0"
        kustomize.component: kfserving
    spec:
      containers:
      - args:
        - --secure-listen-address=0.0.0.0:8443
        - --upstream=http://127.0.0.1:8080/
        - --logtostderr=true
        - --v=10
        image: gcr.io/kubebuilder/kube-rbac-proxy:v0.4.0
        name: kube-rbac-proxy
        ports:
        - containerPort: 8443
          name: https
      - args:
        - --metrics-addr=127.0.0.1:8080
        command:
        - /manager
        env:
        - name: POD_NAMESPACE
          valueFrom:
            fieldRef:
              fieldPath: metadata.namespace
        - name: SECRET_NAME
          value: kfserving-webhook-server-cert
        image: gcr.io/kfserving/kfserving-controller:v0.4.1
        imagePullPolicy: Always
        name: manager
        ports:
        - containerPort: 443
          name: webhook-server
          protocol: TCP
        resources:
          limits:
            cpu: 100m
            memory: 300Mi
          requests:
            cpu: 100m
            memory: 200Mi
        volumeMounts:
        - mountPath: /tmp/k8s-webhook-server/serving-certs
          name: cert
          readOnly: true
      terminationGracePeriodSeconds: 10
      volumes:
      - name: cert
        secret:
          defaultMode: 420
          secretName: kfserving-webhook-server-cert
