Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Kubernetes Deployment

Deploy Fungi to a Kubernetes cluster — single-node or distributed.

Prerequisites

  • Kubernetes 1.24+
  • kubectl configured
  • 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 coordination
  • fungi-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

FilePurpose
k8s/namespace.yamlNamespace
k8s/secret.yamlJWT + admin credentials
k8s/pvc.yamlPersistent storage
k8s/deployment.yamlSingle-node server
k8s/distributed-deployment.yamlJM + TM + HPA
k8s/service.yamlClusterIP
k8s/service-lb.yamlLoadBalancer

Undeploy

kubectl delete namespace fungi

Troubleshooting

IssueCheck
Pod Pendingkubectl describe pvc -n fungi — storage class, size, zone
Health probe failskubectl logs deployment/fungi-server -n fungi — port binding
Cannot access externallyCloud firewall / security group for NodePort range 30000–32767
Dashboard can't reach APICheck Trunk.toml proxy backend URL