---
apiVersion: apps/v1
kind: Deployment
metadata:
  name: katib-db-manager
  namespace: kubeflow
  labels:
    katib.kubeflow.org/component: db-manager
spec:
  replicas: 1
  selector:
    matchLabels:
      katib.kubeflow.org/component: db-manager
  template:
    metadata:
      labels:
        katib.kubeflow.org/component: db-manager
        sidecar.istio.io/inject: "false"
    spec:
      containers:
        - name: katib-db-manager
          image: ghcr.io/kubeflow/katib/katib-db-manager
          env:
            - name: DB_NAME
              value: "mysql"
            - name: DB_PASSWORD
              valueFrom:
                secretKeyRef:
                  name: katib-mysql-secrets
                  key: MYSQL_ROOT_PASSWORD
          command:
            - "./katib-db-manager"
          ports:
            - name: api
              containerPort: 6789
          livenessProbe:
            grpc:
              port: 6789
            initialDelaySeconds: 10
            periodSeconds: 60
            failureThreshold: 5
