apiVersion: apps/v1
kind: StatefulSet
metadata:
  name: mlflow
  labels:
    app: mlflow
spec:
  serviceName: mlflow
  replicas: 1
  selector:
    matchLabels:
      app: mlflow
  template:
    metadata:
      labels:
        app: mlflow
    spec:
      terminationGracePeriodSeconds: 10
      containers:
      - name: mlflow-tracking
        image: localhost:32000/mlflow-server:latest
        command: ["/bin/bash", "-c", "--"]
        args: ["mlflow server --backend-store-uri /tmp/mlflow-data/db --host 0.0.0.0 \
              --default-artifact-root /tmp/mlflow-data/artifacts"]
        imagePullPolicy: IfNotPresent
        ports:
        - containerPort: 5000
          name: mlflow
        volumeMounts:
        - name: mlflow-data
          mountPath: /tmp/mlflow-data
      volumes:
        - name: mlflow-data
          hostPath:
            path: /tmp/mlflow-data
  
  # volumeClaimTemplates:
  # - metadata:
  #     name: mlflow-data
  #   spec:
  #     accessModes: [ "ReadWriteOnce" ]
  #     storageClassName: microk8s-hostpath
  #     resources:
  #       requests:
  #         storage: 1Gi
