This directory contains Kubernetes controllers that run inside the K3s clusters managed by Goman.
controllers/
├── base/ # Base controller framework and shared utilities
├── examples/ # Example controllers for reference
└── deployments/ # Kubernetes manifests for deploying controllers
The base framework provides common functionality for all controllers:
- Client initialization
- Leader election
- Health checks
- Metrics exposure
- Graceful shutdown
- Node Autoscaler - Automatically scales worker nodes based on resource utilization
- Backup Controller - Manages periodic cluster backups to S3
- Certificate Manager - Handles SSL certificate lifecycle
- Resource Monitor - Tracks and reports resource usage
- Create a new directory under
controllers/ - Implement the controller using the base framework
- Add deployment manifests to
deployments/ - Test locally using
go run - Build and deploy to cluster
# Build all controllers
make build-controllers
# Build specific controller
make build-controller NAME=autoscaler# Deploy all controllers to current cluster
goman controllers deploy --all
# Deploy specific controller
goman controllers deploy autoscaler# Run unit tests
go test ./controllers/...
# Run integration tests
make test-controllers