This message was deleted.
# general
a
This message was deleted.
c
It’s discussed in that comment thread - you’re supposed to delete the CAPI Machine objects, not the nodes.
a
Ok, but how do you do that? Why doesn't the Rancher UI do this when removing nodes?
c
because that’s getting the cart before the horse
If you go delete things (like Nodes) from the downstream cluster, Rancher doesn’t get the chance to properly deal with handling that on the Cluster API side before the node goes away.
Which is why the comments in that issue say to delete the CAPI Machine resource from the Rancher cluster, instead of just nuking the node out of the downstream cluster
a
Ok, but still, the Rancher UI does not even handle that properly. This means that we can't use the cluster-autoscaler, the Rancher UI, or kubectl to manage our downstream RKE2 cluster? Sorry I'm trying to understand how to use this properly, our older version of Rancher did not do this. So the only way to remove a node from an RKE2 cluster provisioned by Rancher is to... Drain/Cordon the node in the Cluster view. Then hop over to Cluster management and delete the node from there?
c
if you deleted the machine, it should go through the normal drain/cordon process, and then get deleted once that’s done
a
Is this documented anywhere? It doesn't seem very intuitive that you can't delete nodes from the Cluster view in Rancher when you're given the option to do that. Is there an alternative to the cluster-autoscaler and kubectl that we should be using?
I've been trying to dig through the docs to see how I can do this properly. My RKE2 cluster is configured with custom nodes, according to the matrix here delete should work - https://ranchermanager.docs.rancher.com/how-to-guides/new-user-guides/manage-clusters/nodes-and-node-pools#node-options-availa[…]ter-creation-option I could be missing it but I don't see a way to configure the cluster-autoscaler to delete the machine resource as opposed to the node resource. https://ranchermanager.docs.rancher.com/how-to-guides/new-user-guides/manage-clusters/install-cluster-autoscaler/use-aws-ec2-auto-scaling-groups I can live with having to jump through hoops to use the UI or kubectl, but our biggest use case is the cluster-autoscaler. We scale a fair amount, I don't mind using something else but that's in the docs 🤷‍♂️
c
Those docs are for RKE, which doesn’t use any of the new CAPI provisioning stuff. I can ask around internally to see if there are different docs that should be used for autoscaling with RKE2/k3s
👍 1
a
Deleting a K3s node from the Cluster view works fine btw, I just tested it. The problem only seems to be with RKE2. Out of curiosity, what is the use case for deleting a node from the Cluster view or with kubectl where you would not also want the machine resource deleted?
c
I’m not sure. I work on K3s and RKE2, I don’t have very deep knowledge of the Rancher CAPI provisioning stuff.
👍 1
a
I would think it would make sense for Rancher to trigger that, and kubectl as well, but maybe there's a reason for it working the way it is.