-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
🌱 Support admin config for Kubeadm v1.29 #9682
🌱 Support admin config for Kubeadm v1.29 #9682
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/area provider/controlplane-kubeadm
@killianmuldoon: The label(s) In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
/area provider/control-plane-kubeadm |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/test
@@ -35,6 +36,14 @@ const ( | |||
// GetNodesClusterRoleName defines the name of the ClusterRole and ClusterRoleBinding to get nodes. | |||
GetNodesClusterRoleName = "kubeadm:get-nodes" | |||
|
|||
// SuperAdminKubeConfigFileName defines name for the kubeconfig aimed to be used by the super-admin of the cluster. | |||
SuperAdminKubeConfigFileName = "super-admin.conf" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should be able to import these constants once 1.29 is released, but for now we copy them like these other constants. Not sure if it's worth the import.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure if we can import from this part of k/k without getting a dependency on k/k itself
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This specific constant seems to be unused, let's delete it if we don't use it
@killianmuldoon: The
The following commands are available to trigger optional jobs:
Use
In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
/test pull-cluster-api-e2e-workload-upgrade-1-28-latest-main |
caa2e90
to
4f0b400
Compare
/test pull-cluster-api-e2e-workload-upgrade-1-28-latest-main |
4f0b400
to
57ba9d3
Compare
/test pull-cluster-api-e2e-workload-upgrade-1-28-latest-main |
/test pull-cluster-api-e2e-full-main |
/hold Let's keep this back until after we create the release branch for v1.6.0 |
57ba9d3
to
57dd6a3
Compare
/test pull-cluster-api-e2e-full-main |
// AddClusterAdminRoleBinding creates ClusterRoleBinding rules to use the kubeadm:cluster-admins Cluster Role created in Kubeadm v1.29. | ||
func (w *Workload) AddClusterAdminRoleBinding(ctx context.Context, version semver.Version) error { | ||
// If the upgrade is not to a Cluster of version v1.29.0 or higher this is a no-op | ||
if !version.GTE(semver.MustParse("1.29.0")) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if you are running this code in CI against kubeadm CI artifacts, the exact version where this feature was somehow useable and the RBAC was needed is:
v1.29.0-alpha.2.188+05076de57fc49f
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated to use the CAPI util that ignores preRelease versions for checks like these. Thanks for catching this!
57dd6a3
to
623bc7a
Compare
/test pull-cluster-api-e2e-full-main |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just some minor findings
@@ -35,6 +36,14 @@ const ( | |||
// GetNodesClusterRoleName defines the name of the ClusterRole and ClusterRoleBinding to get nodes. | |||
GetNodesClusterRoleName = "kubeadm:get-nodes" | |||
|
|||
// SuperAdminKubeConfigFileName defines name for the kubeconfig aimed to be used by the super-admin of the cluster. | |||
SuperAdminKubeConfigFileName = "super-admin.conf" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure if we can import from this part of k/k without getting a dependency on k/k itself
@@ -35,6 +36,14 @@ const ( | |||
// GetNodesClusterRoleName defines the name of the ClusterRole and ClusterRoleBinding to get nodes. | |||
GetNodesClusterRoleName = "kubeadm:get-nodes" | |||
|
|||
// SuperAdminKubeConfigFileName defines name for the kubeconfig aimed to be used by the super-admin of the cluster. | |||
SuperAdminKubeConfigFileName = "super-admin.conf" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This specific constant seems to be unused, let's delete it if we don't use it
@@ -68,6 +68,11 @@ func (r *KubeadmControlPlaneReconciler) upgradeControlPlane( | |||
return ctrl.Result{}, errors.Wrap(err, "failed to set role and role binding for kubeadm") | |||
} | |||
|
|||
// Ensure kubeadm clusterRole & Bindings for v1.29+ as per https://github.com/kubernetes/kubernetes/pull/121305 | |||
if err := workloadCluster.AllowClusterAdminPermissions(ctx, parsedVersion); err != nil { | |||
return ctrl.Result{}, errors.Wrap(err, "failed to set role and role binding for kubeadm") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the error text seems to be misleading / a copy&paste error
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
error message is more specific now
Signed-off-by: killianmuldoon <kmuldoon@vmware.com>
f48b33e
to
67c222e
Compare
/test pull-cluster-api-e2e-full-main |
Thx /lgtm Feel free to hold cancel when you want to merge |
LGTM label has been added. Git tree hash: 9ab2c962607bef49b2d277425df1fa3bb2ade6dc
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: sbueringer The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
IMO let's leave this open until after the 1.6.0 RC is cut next Tuesday. Would prefer to get as clean a test signal as possible, and 1.29 support won't make the 1.6.0 release in any case. But up to you 😅 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/lgtm
I think merging on main shouldn't affect 1.6. I also think a cherry pick would be good to already unblock other providers running tests against Kubernetes 1.29. I think a cherry pick is okay as the change is very straightforward |
Fair enough - I'm just a little nervous with the state of the CI signal this close to release. /hold cancel /cherry-pick release-1.5 |
@killianmuldoon: once the present PR merges, I will cherry-pick it on top of release-1.5 in a new PR and assign it to you. In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
/cherry-pick release-1.5 |
@killianmuldoon: once the present PR merges, I will cherry-pick it on top of release-1.5 in a new PR and assign it to you. In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
/cherry-pick release-1.4 |
@killianmuldoon: once the present PR merges, I will cherry-pick it on top of release-1.4 in a new PR and assign it to you. In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
Just to be clear - main is 1.6 right now, but let's merge. I don't think this is going to have a negative impact really. I was just mentally starting the code freeze early 😬 |
@killianmuldoon: new pull request created: #9684 In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
@killianmuldoon: new pull request created: #9685 In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
Thank you |
Add support to the Kubeadm Control Plane provider for the new Kubeadm ClusterRoles to use the super-admin config introduced in the v1.29 cycle.
Part of #9578
Fixes #9633