Kubernetes Deployment
Deploy Fungi to a Kubernetes cluster — single-node or distributed.
Prerequisites
- Kubernetes 1.24+
kubectlconfigured- A storage class for PVC
Single-Node Deployment
Runs fungi-server with embedded JobManager.
kubectl apply -f k8s/namespace.yaml
kubectl apply -f k8s/secret.yaml
kubectl apply -f k8s/pvc.yaml
kubectl apply -f k8s/deployment.yaml
kubectl apply -f k8s/service.yaml
kubectl get pods -n fungi
Distributed Deployment
Runs separate JobManager and TaskManager pods with HPA autoscaling.
kubectl apply -f k8s/namespace.yaml
kubectl apply -f k8s/secret.yaml
kubectl apply -f k8s/pvc.yaml
kubectl apply -f k8s/distributed-deployment.yaml
This creates:
fungi-jobmanager(1 replica) — scheduling + checkpoint coordinationfungi-taskmanager(3 replicas, HPA 1–10) — task execution
See Concepts / Distributed for the architecture.
Verify
kubectl get pods -n fungi
kubectl logs -f deployment/fungi-server -n fungi
kubectl run curl-test --rm -i --restart=Never --image=curlimages/curl -n fungi \
-- curl -s http://fungi-service:50051/health
Expose Externally
NodePort
kubectl patch svc fungi-service -n fungi -p '{"spec":{"type":"NodePort"}}'
kubectl get svc fungi-service -n fungi
LoadBalancer
kubectl apply -f k8s/service-lb.yaml
kubectl get svc fungi-service-lb -n fungi -w
Dashboard
Port-forward then run dashboard locally:
kubectl port-forward svc/fungi-service 50051:50051 -n fungi
cd crates/fungi-dashboard && trunk serve --port 8082
Manifests
| File | Purpose |
|---|---|
k8s/namespace.yaml | Namespace |
k8s/secret.yaml | JWT + admin credentials |
k8s/pvc.yaml | Persistent storage |
k8s/deployment.yaml | Single-node server |
k8s/distributed-deployment.yaml | JM + TM + HPA |
k8s/service.yaml | ClusterIP |
k8s/service-lb.yaml | LoadBalancer |
Undeploy
kubectl delete namespace fungi
Troubleshooting
| Issue | Check |
|---|---|
| Pod Pending | kubectl describe pvc -n fungi — storage class, size, zone |
| Health probe fails | kubectl logs deployment/fungi-server -n fungi — port binding |
| Cannot access externally | Cloud firewall / security group for NodePort range 30000–32767 |
| Dashboard can't reach API | Check Trunk.toml proxy backend URL |