Skip to content

Latest commit

 

History

History

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 

README.md

In-Cluster Controllers

This directory contains Kubernetes controllers that run inside the K3s clusters managed by Goman.

Structure

controllers/
├── base/           # Base controller framework and shared utilities
├── examples/       # Example controllers for reference
└── deployments/    # Kubernetes manifests for deploying controllers

Controllers

Base Framework

The base framework provides common functionality for all controllers:

  • Client initialization
  • Leader election
  • Health checks
  • Metrics exposure
  • Graceful shutdown

Available Controllers

  1. Node Autoscaler - Automatically scales worker nodes based on resource utilization
  2. Backup Controller - Manages periodic cluster backups to S3
  3. Certificate Manager - Handles SSL certificate lifecycle
  4. Resource Monitor - Tracks and reports resource usage

Development

Creating a New Controller

  1. Create a new directory under controllers/
  2. Implement the controller using the base framework
  3. Add deployment manifests to deployments/
  4. Test locally using go run
  5. Build and deploy to cluster

Building

# Build all controllers
make build-controllers

# Build specific controller
make build-controller NAME=autoscaler

Deploying

# Deploy all controllers to current cluster
goman controllers deploy --all

# Deploy specific controller
goman controllers deploy autoscaler

Testing

# Run unit tests
go test ./controllers/...

# Run integration tests
make test-controllers