apiVersion: v1
kind: ServiceAccount
metadata:
  name: mlflow-sa
  namespace: mlflow
---
apiVersion: apps/v1
kind: Deployment
metadata:
  name: deployment
  labels:
    app: mlflow
spec:
  replicas: 1
  selector:
    matchLabels:
      app: mlflow
  template:
    metadata:
      labels:
        app: mlflow
    spec:
      serviceAccountName: mlflow-sa
      containers:
        - name: mlflow
          image: mlflow
          imagePullPolicy: Always
          envFrom:
          - configMapRef:
              name: env
          - secretRef:
              name: env
          command:
            - bash
            - -c
            - |
              pip install PyMySQL
              pip install psycopg2-binary
              pip install azure-storage-blob 
              mlflow server --host 0.0.0.0 --default-artifact-root $(ARTIFACT_ENDPOINT_URI) --backend-store-uri $(MLFLOW_TRACKING_URI)
          ports:
            - containerPort: 5000
