apiVersion: apps/v1
kind: Deployment
metadata:
  labels:
    app: katib
    app.kubernetes.io/component: katib
    app.kubernetes.io/instance: katib-controller-0.8.0
    app.kubernetes.io/managed-by: kfctl
    app.kubernetes.io/name: katib-controller
    app.kubernetes.io/part-of: kubeflow
    app.kubernetes.io/version: 0.8.0
    component: mysql
  name: katib-mysql
  namespace: kubeflow
spec:
  replicas: 1
  selector:
    matchLabels:
      app: katib
      app.kubernetes.io/component: katib
      app.kubernetes.io/instance: katib-controller-0.8.0
      app.kubernetes.io/managed-by: kfctl
      app.kubernetes.io/name: katib-controller
      app.kubernetes.io/part-of: kubeflow
      app.kubernetes.io/version: 0.8.0
      component: mysql
  strategy:
    type: Recreate
  template:
    metadata:
      annotations:
        sidecar.istio.io/inject: "false"
      labels:
        app: katib
        app.kubernetes.io/component: katib
        app.kubernetes.io/instance: katib-controller-0.8.0
        app.kubernetes.io/managed-by: kfctl
        app.kubernetes.io/name: katib-controller
        app.kubernetes.io/part-of: kubeflow
        app.kubernetes.io/version: 0.8.0
        component: mysql
      name: katib-mysql
    spec:
      containers:
      - args:
        - --datadir
        - /var/lib/mysql/datadir
        env:
        - name: MYSQL_ROOT_PASSWORD
          valueFrom:
            secretKeyRef:
              key: MYSQL_ROOT_PASSWORD
              name: katib-mysql-secrets
        - name: MYSQL_ALLOW_EMPTY_PASSWORD
          value: "true"
        - name: MYSQL_DATABASE
          value: katib
        image: mysql:8
        livenessProbe:
          exec:
            command:
            - /bin/bash
            - -c
            - mysqladmin ping -u root -p${MYSQL_ROOT_PASSWORD}
          initialDelaySeconds: 30
          periodSeconds: 10
          timeoutSeconds: 5
        name: katib-mysql
        ports:
        - containerPort: 3306
          name: dbapi
        readinessProbe:
          exec:
            command:
            - /bin/bash
            - -c
            - mysql -D ${MYSQL_DATABASE} -u root -p${MYSQL_ROOT_PASSWORD} -e 'SELECT
              1'
          initialDelaySeconds: 5
          periodSeconds: 10
          timeoutSeconds: 1
        volumeMounts:
        - mountPath: /var/lib/mysql
          name: katib-mysql
      volumes:
      - name: katib-mysql
        persistentVolumeClaim:
          claimName: katib-mysql
