This message was deleted.
# rke2
a
This message was deleted.
c
You can do that, but it requires basic auth with the join token.
b
Ok, so I was in the right direction. Just have to figure out how to use basic auth and curl.
Assuming it is something more than
--header "Authorization: Bearer $TOKEN"
(for example)
c
Not bearer token. Just basic. As in username an password. Username is literal
node
and password is the token.
b
Huh! Thanks!
So it should be something like:
curl -k --fail -u "node:$TOKEN" --output /dev/null '<https://10.10.0.10:6443/livez?verbose>'
My response is still 401 (unauthorised). 🤔
c
Wait, do you want to check rke2, or the apiserver?
If you just want to check the apiserver health, the best way is to use kubectl to make a raw request to the healthz endpoint
b
Basically I want to check if the RKE2 controller is ready (finished the install and started up) for the workers to join.
because this is being automated, I am checking from the worker nodes. kubectl has not yet been installed, etc. The idea is that the install scripts started on the workers would kick off via cloud-init, and loop waiting fpr the controller, then continue and install rke2 on the worker nodes, and join the controller.
c
you should be able to just install and start the agents whenever, if the server isn’t ready yet they will get restarted and retry