File size: 2,020 Bytes
7c19d46
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
# =============================================================================
# MLflow Tracking Server Deployment
# =============================================================================

apiVersion: apps/v1
kind: Deployment
metadata:
  name: mlflow
  namespace: ml-pipeline
  labels:
    app: mlflow
spec:
  replicas: 1
  selector:
    matchLabels:
      app: mlflow
  template:
    metadata:
      labels:
        app: mlflow
    spec:
      serviceAccountName: mlflow
      securityContext:
        runAsNonRoot: true
        runAsUser: 1000
      containers:
        - name: mlflow
          image: "ghcr.io/mlflow/mlflow:v2.12.1"
          ports:
            - containerPort: 5000
          env:
            - name: MLFLOW_S3_ENDPOINT_URL
              value: "https://s3.us-east-1.amazonaws.com"
            - name: AWS_DEFAULT_REGION
              value: "us-east-1"
            - name: MLFLOW_TRACKING_URI
              value: "postgresql://$(DB_USER):$(DB_PASSWORD)@$(DB_HOST):5432/mlflow"
          envFrom:
            - secretRef:
                name: mlflow-db-credentials
          resources:
            requests:
              cpu: 500m
              memory: 1Gi
            limits:
              cpu: "2"
              memory: 4Gi
          livenessProbe:
            httpGet:
              path: /health
              port: 5000
            initialDelaySeconds: 30
            periodSeconds: 30
          readinessProbe:
            httpGet:
              path: /health
              port: 5000
            initialDelaySeconds: 10
            periodSeconds: 10
          volumeMounts:
            - name: mlflow-artifacts
              mountPath: /mlflow/artifacts
      volumes:
        - name: mlflow-artifacts
          emptyDir: {}
---
apiVersion: v1
kind: Service
metadata:
  name: mlflow
  namespace: ml-pipeline
spec:
  selector:
    app: mlflow
  ports:
    - port: 5000
      targetPort: 5000
---
apiVersion: v1
kind: ServiceAccount
metadata:
  name: mlflow
  namespace: ml-pipeline