apiVersion: apps/v1
kind: Deployment
metadata:
  name: mlflow-serving
  labels:
    app: serve-ML-model-mlflow

spec:
  replicas: 1
  selector:
    matchLabels:
      app: mlflow-serving
  template:
    metadata:
      labels:
        app: mlflow-serving

    spec:
      containers:
        - name: mlflow-serving
          image: GCR_REPO/mlflow_serving:v1 #change here
          env:
            - name: MODEL_URI
              value: "gs://../artifacts/../../artifacts/.." #change here
            - name: SERVING_PORT
              value: "8082"
            - name: GOOGLE_APPLICATION_CREDENTIALS
              value: "/etc/secrets/keyfile.json"
          volumeMounts:
            - name: gcsfs-creds
              mountPath: "/etc/secrets"
              readOnly: true
          resources:
            requests:
              cpu: "1000m"


      volumes:
        - name: gcsfs-creds
          secret:
            secretName: gcsfs-creds
            items:
              - key: keyfile.json
                path: keyfile.json
