How k0rdent/kcm works
Project type and purpose
• k0rdent Cluster Manager (KCM) is a Kubernetes “operator” / controller suite delivered as a Helm chart.
• Its purpose is to install CRDs and controllers on a management Kubernetes cluster, then reconcile Management and ClusterDeployment objects to drive multi-cluster provisioning across multiple cloud providers via Cluster-API and Helm charts.
File structure
• api/v1alpha1 and api/v1beta1: definitions of all CRDs (Management, ClusterDeployment, Credential, Template, TemplateChain, etc.).
• cmd/main.go: entry point, sets up controller-runtime manager.
• internal/controller: one sub-package per CRD, each implements a Reconciler for the controller pattern.
• internal/webhook: validating/mutating admission webhooks for CRD objects.
• internal/helm: wrapper around the Helm Go client for chart operations.
• internal/metrics, internal/telemetry: emit Prometheus metrics and usage events.
• templates/… and templates/provider/…: Helm charts for cluster templates and provider installations.
• config/dev, mkdocs.yml, hack/…: sample manifests & automation scripts.
• test and test/e2e: unit and end-to-end test suites.
README for additional insights
• Describes the key Custom Resources (Management, ClusterDeployment) and their life cycle.
• Recommends installation via Helm, with CRDs, Deployment, Webhooks, and ServiceAccount installed into kcm-system.
• Shows the reconciliation loop: user creates a ClusterDeployment → Helm release in kcm-system installs provider chart → cloud infra is provisioned → status conditions on the CRD are updated.
Detail
• Both webhooks (validating/mutating) and controllers.
• Metric endpoint and telemetry client as side-cars or modules.