Kubernetes¶
Deploy your dotflow pipeline to a Kubernetes cluster.
Create project¶
dotflow init
# Select cloud: kubernetes
Or generate files for an existing project:
dotflow cloud generate --platform kubernetes
Generated files¶
| File | Description |
|---|---|
Dockerfile |
Container image |
deployment.yaml |
Kubernetes Deployment manifest |
service.yaml |
Kubernetes Service manifest |
Prerequisites¶
- Docker
kubectl- A Kubernetes cluster (minikube for local testing)
Deploy (local with minikube)¶
brew install minikube
minikube start
eval $(minikube docker-env)
docker build -t my_pipeline:latest .
kubectl apply -f deployment.yaml
kubectl apply -f service.yaml
Deploy (production)¶
Replace image in deployment.yaml with your container registry URL and change imagePullPolicy to Always:
kubectl apply -f deployment.yaml
kubectl apply -f service.yaml
View logs¶
kubectl logs -l app=my_pipeline
Important¶
- Do not rename
workflow.pyor themain()function — the Dockerfile CMD depends on it imagePullPolicy: Neveris for local images only — change toAlwaysfor production- Project names with
_are automatically converted to-in Kubernetes resource names