Registering to cluster does not work

Hello everyone,

I’m seeking assistance in investigating the reason behind the failure of new nodes to register to cluster,
some background:
rancher is stable version on fresh ubuntu 22.04 vm (installation is based on the guide here:“How To Install Rancher on Ubuntu 22.04 LTS - idroot” )

after connecting to the rancher web I created a fresh k3s cluster (all default params) and proceeded to the Registration step.
On a clean Ubuntu 22 virtual machine or container, I tried to ran the following command:
curl -fL XXXXX/system-agent-install.sh | sudo sh -s - --server xxxxx --label ’ cattle.io/os=linux ’ --token AAAAA --ca-checksum BBBB --etcd --controlplane --worker )

but node is hanged on reconnecting:
Waiting for probes: kube-apiserver, kube-controller-manager, kube-scheduler, kubelet

running journalctl -u rancher-system-agent.service on the agent i tried to join gave the errors:


="[Applyinator] Command sh [-c run.sh] finished with err: <nil> and exit code: 0"
="[Applyinator] No image provided, creating empty working directory /var/lib/rancher/agent/work/20230608-143319/0dc97d06e55a30c9877372bc9104b2a8df2dc4b0308f0d5a10b9f926246b651f_0"
="[Applyinator] Running command: sh [-c k3s etcd-snapshot list --etcd-s3=false 2>/dev/null]"
="[0dc97d06e55a30c9877372bc9104b2a8df2dc4b0308f0d5a10b9f926246b651f_0:stdout]: Name Location Size Created"
="[Applyinator] Command sh [-c k3s etcd-snapshot list --etcd-s3=false 2>/dev/null] finished with err: <nil> and exit code: 0"
g="error loading CA cert for probe (kube-scheduler) /var/lib/rancher/k3s/server/tls/kube-scheduler/kube-scheduler.crt: open /var/lib/rancher/k3s/server/tls/kube-scheduler/kube-scheduler.crt: no such file o>
g="error while appending ca cert to pool for probe kube-scheduler"

and i see that the the folder /var/lib/rancher/k3s/server/tls/kube-scheduler
does not exist

on the rancer ui it shoes:
Configuring bootstrap node(s) custom-398775f609f6: waiting for probes: kube-apiserver, kube-controller-manager, kube-scheduler, kubelet

As my experience, after you connect to the Rancher UI, you need to create new Cluster using Custom.
Then at the page will be tab for Registration.
Before you copy the registration link to the Ubuntu server as your cluster member, please check all prerequisite.
I suggest you install docker.io containerd runc, also if you need to use Longhorn, you need to install nfs-common and open-iscsi. Last but not least, install chrony to make reliable NTP client.
I have script to install all the things that needed as cluster member of the Kubernetes that will registered into Rancher, including sysctl.conf, /etc/multipath.conf.
After running the script, just copy the registration URL into particular node, then check in the Rancher cluster registration, since the agent already running then it will shown in the Machines tab.

Regards,
Fadjar