A minimal Go-based Kubernetes controller simulator that mimics basic edge agent behavior.
This project demonstrates how a lightweight edge-like controller can:
- Watch Kubernetes resources
- React to cluster state changes
- Enable or disable workloads based on connectivity conditions
Inspired by Kubernetes controller patterns and edge computing concepts (e.g., KubeEdge).
- Written in Go
- Uses
client-goinformers - Watches Deployments
- Simulates edge online/offline behavior
- Scales workloads automatically
- The agent connects to the Kubernetes API.
- It watches Deployment resources using informers.
- Based on a flag (
--edge-online), it:- Scales deployments to zero when the edge is offline.
- Leaves them running when online.
minikube startkubectl create deployment demo --image=nginxgo run main.go --edge-online=falsekubectl get deploymentsThis simulates a situation where an edge node becomes unavailable. The agent reacts by disabling workloads to prevent inconsistent or unnecessary execution while the edge is offline.
Project Structure mini-edge-agent/ ├── main.go ├── go.mod ├── go.sum ├── config/ │ └── config.yaml
This project was created to understand Kubernetes controller mechanics and explore how edge agent behavior can be simulated using core Kubernetes primitives without building a full edge platform.
- Restore original replica counts when the edge comes back online
- Filter deployments using labels
- Read configuration from a YAML file
- Introduce a CRD-based control mechanism
- Simulate node-level edge conditions