apiVersion: apps/v1
kind: Deployment
metadata:
  name: mlflow-ui
  namespace: kubeflow
  labels:
    app: mlflow
    component: ui
spec:
  replicas: 1
  selector:
    matchLabels:
      app: mlflow
      component: ui
  template:
    metadata:
      name: mlflow-ui
      labels:
        app: mlflow
        component: ui
      annotations:
        sidecar.istio.io/inject: "false"
    spec:
      containers:
      - name: mlflow-server
        image: sachua/mlflow-server:latest
        imagePullPolicy: Always
        command: ["/bin/sh"]
        args: ["-c","mlflow server --backend-store-uri mysql+pymysql://root:@mysql.kubeflow.svc.cluster.local:3306/mlflow_database --default-artifact-root s3://mlflow/ --host 0.0.0.0:8000"]
        env:
        - name: MLFLOW_S3_ENDPOINT_URL
          value: 'http://minio-service.kubeflow.svc.cluster.local:9000'
        - name: AWS_ACCESS_KEY_ID
          value: 'minio'
        - name: AWS_SECRET_ACCESS_KEY
          value: 'minio123'
        ports:
        - containerPort: 5000
          name: ui
      serviceAccountName: mlflow-ui
