How kyma-project/infrastructure-manager works
Project type and purpose
• This is a Kubernetes “operator” (a controller) built with the Kubebuilder framework in Go.
• Its purpose is to manage CRDs (GardenerCluster and Runtime) and automatically generate and rotate Secrets containing dynamic kubeconfigs by talking to both the Kubernetes API Server and the external Gardener service.
File structure
• Top‐level:
• cmd/main.go — entrypoint for the controller manager binary
• api/v1 — Go types defining the CRDs
• config/ — Kubernetes manifests (CRDs, RBAC roles, manager Deployment, webhooks, metrics) organized via Kustomize
• internal/controller — the reconciliation logic (controllers for kubeconfig and runtime workflows, including an FSM for runtime management)
• pkg/ — reusable packages for interacting with Gardener, building kubeconfigs, extensibility points, provisioning, and reconciliation utilities
• hack/ — auxiliary CLI tools (benchmark, patch-converter, performance tests, runtime-migrator)
• Dockerfile, Makefile — build, test, containerize, deploy automation
• Patterns:
• Operator pattern: watch–reconcile loops
• FSM pattern for complex runtime lifecycle handling
• Kubernetes custom resources + CRD YAML + RBAC + webhook config
README for additional insights
• Confirms it’s a Kubebuilder operator that watches GardenerCluster CRs to create/rotate Secrets.
• Mentions metrics endpoint for Prometheus.
• Describes time-based and forced rotation triggers.