How gorizond/fleet-workspace-controller works
Project type and purpose
• This is a Kubernetes “operator” (controller) written in Go, built using Kubebuilder patterns, whose job is to reconcile a set of custom resources (FleetWorkspace, GlobalRoleBinding, RoleBinding, User, etc.) in a Rancher/Kubernetes environment.
• It ships as a container image (see Dockerfile), deployed via a Helm chart under charts/fleet-workspace-controller, and uses generated client code in pkg/generated against CRD definitions in pkg/apis/management.cattle.io/v3.
File structure
• Top level
• Dockerfile, .dockerignore → build/operator container
• main.go → entrypoint that sets up the controller manager
• go.mod/go.sum → Go modules
• controllers/
• Reconciler implementations for each CR type (FleetWorkspace, GlobalRoleBinding, TTL handler, RoleBinding, User)
• pkg/apis/management.cattle.io/v3/
• CRD type definitions (types.go) and registration code (zz_generated_*.go)
• pkg/generated/controllers/…
• Generated client interfaces and factories for watchers/informers
• charts/fleet-workspace-controller/
• Helm chart to install CRDs, RBAC, deployment, HPA, global roles
• scripts/
• Code-gen helpers to produce deepcopy, clientsets, informers
Essential elements to capture
• CRD definitions (pkg/apis) vs. runtime CR instances
• Generated clients (pkg/generated) feeding into reconcilers
• Reconcile loops in each controller file
• Deployment via Helm (charts/)
• RBAC roles/bindings that grant the operator its permissions
• Labels every component explicitly
• Captures the end-to-end flow: from Helm chart installation, through event watching, to resource reconciliation and updates in the cluster
This gives you a comprehensive, accurate architectural view tailored specifically to the fleet-workspace-controller operator.