This repository contains the Docker image and Helm chart for deploying MLflow server with PostgreSQL backend.
.
├── image/ # Docker image for MLflow server
│ └── Dockerfile
└── charts/ # Helm chart for Kubernetes deployment
└── mlflow/
- Docker
- Kubernetes cluster with OpenShift (required for Route resource)
- Helm 3.x
- PostgreSQL database
First, build the MLflow Docker image:
cd image
docker build -t willemm/mlflow:3.4.0 .Then publish the image to your container registry:
docker push willemm/mlflow:3.4.0This chart is designed to work with the Crunchy Data PostgreSQL Operator secret format. If you're using the Crunchy Data PostgreSQL Operator, the secret is automatically created for you (e.g., hippo-pguser-hippo).
The secret should contain the following keys:
host: Database hostport: Database portdbname: Database nameuser: Database userpassword: Database password
If you need to create a manual secret with this format:
kubectl create secret generic mlflow-secret \
--from-literal=host=<your-db-host> \
--from-literal=port=5432 \
--from-literal=dbname=mlflow \
--from-literal=user=<your-db-user> \
--from-literal=password=<your-db-password>MLflow supports two types of artifact storage: local persistent volumes and S3-compatible storage.
Create a custom values.yaml file:
image:
repository: willemm/mlflow
tag: "3.4.0"
database:
secret: mlflow-secret
artifacts:
type: local
root: /mlflow/artifacts
persistence:
enabled: true
size: 20Gi
storageClass: "your-storage-class"First, create a Kubernetes secret with S3 credentials:
kubectl create secret generic mlflow-s3-secret \
--from-literal=access-key-id=<your-access-key> \
--from-literal=secret-access-key=<your-secret-key>Then create a custom values.yaml file:
image:
repository: willemm/mlflow
tag: "3.4.0"
database:
secret: mlflow-secret
artifacts:
type: s3
s3:
bucket: my-mlflow-bucket
path: artifacts
endpoint: "" # Optional: for S3-compatible storage (e.g., MinIO)
secret: mlflow-s3-secret
persistence:
enabled: false # Not needed for S3 storageDeploy the chart to your Kubernetes environment:
helm install mlflow ./charts/mlflow -f values.yaml- OpenShift Required: This Helm chart uses OpenShift Route resources for ingress. If you're not using OpenShift, you'll need to modify the chart to use standard Kubernetes Ingress resources.
- Crunchy Data PostgreSQL Operator: The chart expects a pre-existing database secret in the Crunchy Data PostgreSQL Operator format (with keys:
host,port,dbname,user,password). If using the operator, reference the auto-generated secret (e.g.,hippo-pguser-hippo). - Artifact Storage: Choose between local persistent volumes or S3-compatible storage. For S3 storage, you'll need to create a separate secret with AWS credentials.
- The default TLS termination is set to
edgein the OpenShift Route.
Key configuration options in values.yaml:
image.repository: Docker image repositoryimage.tag: Docker image tagdatabase.secret: Name of the Kubernetes secret containing database credentialsartifacts.type: Artifact storage type (localors3)artifacts.root: Local artifact storage path (when using local storage)artifacts.s3.bucket: S3 bucket name (when using S3 storage)artifacts.s3.path: Path within S3 bucket for artifactsartifacts.s3.endpoint: Custom S3 endpoint URL (optional, for S3-compatible storage like MinIO)artifacts.s3.secret: Name of Kubernetes secret containing S3 credentialspersistence.enabled: Enable persistent storage for artifacts (only needed for local storage)persistence.size: Size of the persistent volumeresources: CPU and memory limits/requests
For all available configuration options, see charts/mlflow/values.yaml.