I accidentally deployed a control plane node as “...
# general
w
I accidentally deployed a control plane node as “All”. I am trying to remove the “worker” role off that server. I have tried going into cluster >nodes>edit config of the node, removed the “node-role.kubernetes.io/worker=true” saved, and it’s still showing “Roles” All everywhere in the UI. I have also tried doing it via kubectl “kubectl label node nodename node-role.kubernetes.io/worker-“ And it still shows up with “control-plane,etch,master,worker” This can’t be normal.
s
Management of cluster lifecycle and nodes is done through the Cluster Management area of the UI
that does depend on how your cluster was provisioned and brought into rancher, but is a good place to start
w
So I am getting rancher to do the deployment. I must be missing something because I see no way of modifying it. I tried these instructions https://www.suse.com/support/kb/doc/?id=000021557 and they don’t seem to work.
s
What type of cluster is it? Depending on type, it should be visible in if you go to
Cluster Management
-->
Clusters
list --> find your cluster and click on the three dot button on the right -->
Edit Config
--> node/machine config should be near the top of that page
w
When i click on the cluster “Edit Config” i see no “node/machine” config
s
is your cluster rke1, rke2, eks, aks, harvester, imported??
w
IMG_3246.jpg
it’s an rke2 cluster that was provisioned by Rancher
s
there should be a section above that titled
Machine Pools
which contains configuration for machines and their roles
are there any errors in the browser's console?
w
no errors i can see
IMG_3247.jpg
that screen right?
this is v2.11
s
It looks like a custom cluster, rather than one provisioned by rancher (where rancher will create the resources required to run kube in). to confirm you provisioned the nodes yourself and then ran rancher registration commands in them?
w
Yes, I did “Use Existing nodes and create a cluster using RKE2/K3s”
at that point I set the config, and then ran the script that the “Registration” tab gives me on the nodes
in step 1 it lets you select “etcd” “Control Plane” “Worker”
I figured sense i could select the nodes role on the registration page, I would be able to change it after it’s registered
s
@creamy-pencil-82913 might be able to help advise if nodes in an rke2 cluster setup via a
custom
ui cluster registration command can have their roles changes
👍 1
c
idk, this is something on the rancher side, not rke2… I suspect that the roles are being enforced by rancher-system-agent. When you register a custom node the roles are just appended to the generated registration command, note the flags at the end:
Copy code
curl -fL <https://rancher-X/system-agent-install.sh> | sudo sh -s - --server <https://rancher-X> --label '<http://cattle.io/os=linux|cattle.io/os=linux>' --token 123 --etcd --controlplane --worker
If you wanted to change that you’d probably need to delete the node and re-register it with the correct flags. If for some reason you can’t do that you could try to figure out if that’s embedded in the Machine resource, or the rancher-system-agent config on the node somewhere… idk
w
yeah, i tried the instructions with just changing to label and the taints but something is automatically adding the node labels back. Only way I was able to get it working was the remove the node and add it back like you mentioned.