apiVersion: apps/v1
kind: Deployment
metadata:
  labels:
    katib.kubeflow.org/component: controller
  name: katib-controller
  namespace: kubeflow
spec:
  replicas: 1
  selector:
    matchLabels:
      katib.kubeflow.org/component: controller
  template:
    metadata:
      annotations:
        prometheus.io/scrape: "true"
        sidecar.istio.io/inject: "false"
      labels:
        katib.kubeflow.org/component: controller
    spec:
      containers:
      - args:
        - --webhook-port=8443
        - --trial-resources=Job.v1.batch
        - --trial-resources=TFJob.v1.kubeflow.org
        - --trial-resources=PyTorchJob.v1.kubeflow.org
        - --trial-resources=MPIJob.v1.kubeflow.org
        - --trial-resources=XGBoostJob.v1.kubeflow.org
        command:
        - ./katib-controller
        env:
        - name: KATIB_CORE_NAMESPACE
          valueFrom:
            fieldRef:
              fieldPath: metadata.namespace
        image: docker.io/kubeflowkatib/katib-controller:v0.12.0
        name: katib-controller
        ports:
        - containerPort: 8443
          name: webhook
          protocol: TCP
        - containerPort: 8080
          name: metrics
          protocol: TCP
        volumeMounts:
        - mountPath: /tmp/cert
          name: cert
          readOnly: true
      serviceAccountName: katib-controller
      volumes:
      - name: cert
        secret:
          defaultMode: 420
          secretName: katib-webhook-cert
