✨ Add kubeadm cluster role - #24
Merged
Merged
Conversation
shubham2g
approved these changes
Aug 14, 2026
shivendra-ntnx
requested changes
Aug 14, 2026
| } | ||
|
|
||
| parsedVersionForPermissions, err := semver.ParseTolerant(controlPlane.KCP.Spec.Version) | ||
| if err != nil { |
| Management: &internal.Management{Client: env}, | ||
| Workload: &fakeWorkloadCluster{ | ||
| Status: internal.ClusterStatus{Nodes: 1}, | ||
| Workload: &internal.Workload{ |
thunderboltsid
approved these changes
Aug 14, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR backports kubeadm RBAC permission reconciliation to control plane upgrade paths by introducing/ensuring the kubeadm cluster role bindings needed during version transitions.
How was this tested
Build Targets: Compiled the CAPI core, Kubeadm bootstrap, Kubeadm control plane (KCP), and Docker infrastructure (CAPD) controller manager binaries into local container images using make.
Tag Matching: Retagged local container images to match the exact versions expected by the local repository templates and manifests (e.g., local.test/capi/...:v1.10.99 and :v1.10.x-dev).
Docker Socket Mounting: Configured a Kind cluster definition (kind-cluster-with-docker.yaml) with /var/run/docker.sock mounted into the node so CAPD could manage Docker containers directly on the host.
Preloading Images: Loaded all built container images directly into the Kind cluster (kind load docker-image ... --name capi-mgmt).
Provider Initialization: Initialized Cluster API using ./bin/clusterctl init pointing to the local repository (infrastructure-docker, kubeadm-control-plane, kubeadm-bootstrap, and cluster-api).
Image Pull Policy Patching: Patched all four controller deployments to imagePullPolicy: IfNotPresent to prevent Kubernetes from attempting to pull non-existent local.test URLs over the network.
Template Setup: Copied required cluster definitions and ClusterClasses (cluster-template-development.yaml as cluster-template.yaml and clusterclass-quick-start.yaml) into the local provider repository path (~/.cluster-api/overrides/ / local-repository/).
Workload Cluster Manifest Generation: Generated and applied the test cluster YAML using:
Kubeconfig Retrieval: Extracted the workload cluster kubeconfig using ./bin/clusterctl get kubeconfig test-docker > test-docker.kubeconfig.
Port-Forwarding Adjustment: Replaced the unreachable internal Docker container IP (172.18.0.x:6443) in the kubeconfig with the host port exposed by test-docker-lb on Docker Desktop (e.g., 127.0.0.1:55000).
CNI Installation: Applied Calico to the workload cluster to allow nodes to transition to Ready and initialize system pods.
Unit Testing: Ran package-level tests via go test for workload_cluster_rbac_test.go to test RBAC logic in isolation.
Workload Cluster Inspection: Verified the creation of kubeadm-managed ClusterRoles and ClusterRoleBindings (such as kubeadm:cluster-admins introduced in PR kubernetes-sigs#13664) directly on the workload cluster.
Drift / Self-Healing Test: Deleted the managed RBAC object (kubeadm:cluster-admins) from the workload cluster, triggered a KCP reconciliation loop on the management cluster, and verified that KCP successfully restored the deleted resource.