Skip to content

✨ Support RKE2ControlPlane mhc remediation #627

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

Open
wants to merge 7 commits into
base: main
Choose a base branch
from

Conversation

MaxFedotov
Copy link
Contributor

@MaxFedotov MaxFedotov commented Apr 18, 2025

kind/feature

What this PR does / why we need it:

This PR adds support for RKE2ControlPlane remediation. The code is taken from KCP (https://github.com/kubernetes-sigs/cluster-api/blob/main/controlplane/kubeadm/internal/controllers/remediation.go) and adopted for RKE2. It also adds a new rcp_remediation_test e2e test, based on CAPI e2e KCPRemediationSpec.

Which issue(s) this PR fixes (optional, in fixes #<issue number>(, fixes #<issue_number>, ...) format, will close the issue(s) when PR gets merged):
Fixes #626

Special notes for your reviewer:

Checklist:

  • squashed commits into logical changes
  • includes documentation
  • adds unit tests
  • adds or updates e2e tests

@MaxFedotov MaxFedotov requested a review from a team as a code owner April 18, 2025 11:34
@furkatgofurov7 furkatgofurov7 added kind/feature area/controller Indicates an issue or PR related to the controllers labels Apr 22, 2025
Copy link
Contributor

@furkatgofurov7 furkatgofurov7 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey, thanks for the PR 👍🏼
I have not looked into the logic yet, but can you please first rename the KCP mentions with RKE2ControlPlane everywhere (comments, file names, vars etc)?

@furkatgofurov7 furkatgofurov7 changed the title support rke2ControlPlane mhc remediation ✨ SupportRKE2ControlPlane mhc remediation Apr 22, 2025
@furkatgofurov7 furkatgofurov7 changed the title ✨ SupportRKE2ControlPlane mhc remediation ✨ Support RKE2ControlPlane mhc remediation Apr 22, 2025
@MaxFedotov
Copy link
Contributor Author

Hey @furkatgofurov7, done. The only place where i left kcp is in tests, because i've used the standard capi KCPRemediationSpec test

@furkatgofurov7
Copy link
Contributor

@MaxFedotov you can run make lint locally to make sure lint CI passes here

@MaxFedotov
Copy link
Contributor Author

@furkatgofurov7, done

@furkatgofurov7 furkatgofurov7 moved this to PR to be reviewed in CAPI / Turtles Apr 29, 2025
@MaxFedotov
Copy link
Contributor Author

hey @furkatgofurov7! Is there anything else i can do to proceed with this PR? Thanks!

anmazzotti
anmazzotti previously approved these changes May 1, 2025
Comment on lines +7 to +8
# Build architecture
ARG ARCH
Copy link
Contributor

@furkatgofurov7 furkatgofurov7 May 2, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This and related changes to ARCH usage in Makefile are partially reverting the change we merged moving from docker build to docker buildx. I am curious to know why this change is required since we have a list of target platforms already defined to build the images?

Copy link
Contributor Author

@MaxFedotov MaxFedotov May 2, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The problem here is that i'm using apple silicon to build the image, so

ARCH ?= $(shell go env GOARCH)

will return arm64.
With the --load flag, docker daemon is trying to upload darwin\arm64 image to local docker daemon, which uses linux, which leads to the following error:

ERROR: failed to solve: rpc error: code = Unknown desc = cannot load darwin image on linux

If we don't won't to hardcode the platform, I will add additional variable

TARGET_PLATFORM = linux/$(ARCH)

and use it in docker-build-rke2-bootstrap and docker-build-rke2-control-plane:

	DOCKER_BUILDKIT=1 BUILDX_BUILDER=$(MACHINE) docker buildx build \
			--platform $(TARGET_PLATFORM) \
			--load \
			...

@MaxFedotov MaxFedotov dismissed stale reviews from alexander-demicev and anmazzotti via 6c7b9d7 May 2, 2025 11:42
@MaxFedotov
Copy link
Contributor Author

MaxFedotov commented May 2, 2025

Sorry for the force push, had to rebase the branch to the latest main to fix the conflicts

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/controller Indicates an issue or PR related to the controllers kind/feature
Projects
Status: PR to be reviewed
Development

Successfully merging this pull request may close these issues.

Support RKE2ControlPlane remediation by MHC
4 participants