cluster-api-provider-rke2
cluster-api-provider-rke2 copied to clipboard
Support for RKE2 Windows Workers
Describe the solution you'd like:
RKE2 Windows worker nodes have been GA for multiple minor releases of rke2. Rancher added official RKE2 Windows Support as part of the GA of v2 provisioning in the v2.6.5 release. I would like to see this capi provider for rke2 support provisioning Windows 2019 and Windows 2022 worker nodes to enable hybrid rke2 clusters.
https://ranchermanager.docs.rancher.com/pages-for-subheaders/launch-kubernetes-with-rancher#rke2
RKE2 provisioning also includes installing RKE2 on clusters with Windows nodes.
Why do you want this feature:
I am a daily user of RKE2 hybrid clusters and would use this CAPI provider if it added Windows support. I also believe that Windows support would be a major win for the community and the Rancher product.
Anything else you would like to add:
RKE1 Windows reached end of life in 2022
https://ranchermanager.docs.rancher.com/how-to-guides/new-user-guides/kubernetes-clusters-in-rancher-setup/use-windows-clusters/workload-migration-guidance
https://docs.rke2.io/install/requirements#windows https://ranchermanager.docs.rancher.com/how-to-guides/new-user-guides/kubernetes-clusters-in-rancher-setup/node-requirements-for-rancher-managed-clusters#operating-systems-and-container-runtime-requirements https://ranchermanager.docs.rancher.com/how-to-guides/new-user-guides/kubernetes-clusters-in-rancher-setup/use-windows-clusters/workload-migration-guidance
This issue is stale because it has been open 90 days with no activity.
Windows supports cloud-init with some slight modification to the default configuration. I was able to get a cluster to join with the RKE2 Cluster provisioner by injecting preRKE2Commands provided from the Quick Start:
preRKE2Commands:
- >-
curl https://raw.githubusercontent.com/rancher/rke2/master/install.ps1
-o install.ps1
- powershell -ExecutionPolicy Bypass -File install.ps1
- C:\usr\local\bin\rke2.exe agent service --add
- powershell -command "Start-Service -name rke2"
Cluster Joined with PreRKE2Commands
Notes on development path
For this feature to natively be supported, I would suspect that it would need some modification to the ignition: https://github.com/rancher/cluster-api-provider-rke2/blob/972b7d2a44c63ab039b1f2dd252a57f005dbdbd2/bootstrap/internal/ignition/ignition.go#L149-L151
I started to run work this, but ran into a few issues in spec definitions, maybe someone more familiar with the development could help with. None of these issue would prevent someone else from modifying ignition/using these above commands in place of the linux commands:
- Since RKE2 runs in agent mode, adding a named field such as
OperatingSystemto the agent config also adds it to the server spec. I couldn't devise a place to add the field, that would only make it run in agent nodes. - For some reason, when I was developing, and deployed the controller, new properties weren't taking, but rather just being removed from the spec. Probably a development error, but the spec -> controller -> spec I couldn't quite figure out