Various exploration/debug commmands for RKE2
Necessary binaries unpacked from image and symlinked in /usr/local/bin (only when using install.sh script)
-rwxr-xr-x 1 root root 151543800 Jul 22 06:22 rke2
-rwxr-xr-x 1 root root      1014 Jul 22 06:22 rke2-uninstall.sh
-rwxr-xr-x 1 root root      1716 Jul 22 06:22 rke2-killall.sh
lrwxrwxrwx 1 root root       106 Jul 22 06:23 containerd -> /var/lib/rancher/rke2/data/e54e0eb8ba58f4f8e5e252bb58a07022700890934ec360ab816c01fe5d90ddef/bin/containerd
lrwxrwxrwx 1 root root       119 Jul 22 06:23 containerd-shim-runc-v1 -> /var/lib/rancher/rke2/data/e54e0eb8ba58f4f8e5e252bb58a07022700890934ec360ab816c01fe5d90ddef/bin/containerd-shim-runc-v1
lrwxrwxrwx 1 root root       111 Jul 22 06:23 containerd-shim -> /var/lib/rancher/rke2/data/e54e0eb8ba58f4f8e5e252bb58a07022700890934ec360ab816c01fe5d90ddef/bin/containerd-shim
lrwxrwxrwx 1 root root       119 Jul 22 06:23 containerd-shim-runc-v2 -> /var/lib/rancher/rke2/data/e54e0eb8ba58f4f8e5e252bb58a07022700890934ec360ab816c01fe5d90ddef/bin/containerd-shim-runc-v2
lrwxrwxrwx 1 root root        99 Jul 22 06:23 ctr -> /var/lib/rancher/rke2/data/e54e0eb8ba58f4f8e5e252bb58a07022700890934ec360ab816c01fe5d90ddef/bin/ctr
lrwxrwxrwx 1 root root       103 Jul 22 06:23 kubelet -> /var/lib/rancher/rke2/data/e54e0eb8ba58f4f8e5e252bb58a07022700890934ec360ab816c01fe5d90ddef/bin/kubelet
lrwxrwxrwx 1 root root       103 Jul 22 06:23 kubectl -> /var/lib/rancher/rke2/data/e54e0eb8ba58f4f8e5e252bb58a07022700890934ec360ab816c01fe5d90ddef/bin/kubectl
lrwxrwxrwx 1 root root       100 Jul 22 06:23 runc -> /var/lib/rancher/rke2/data/e54e0eb8ba58f4f8e5e252bb58a07022700890934ec360ab816c01fe5d90ddef/bin/runc
- /etc/systemd/system/rke2.service.env
- /etc/systemd/system/rke2.service
export KUBECONFIG=/etc/rancher/rke2/rke2.yaml
kubectl get nodes
kubectl --kubeconfig /etc/rancher/rke2/rke2.yaml get nodes
- socket located at /run/k3s/containerd/containerd.sock
List containers using ctr
ctr --address /run/k3s/containerd/containerd.sock --namespace k8s.io container ls
export CRI_CONFIG_FILE=/var/lib/rancher/rke2/agent/etc/crictl.yaml
crictl ps
crictl --config /var/lib/rancher/rke2/agent/etc/crictl.yaml ps
crictl --runtime-endpoint unix:///run/k3s/containerd/containerd.sock ps -a
- journalctl -u rke2
- /var/lib/rancher/rke2/agent/containerd/containerd.log
- /var/lib/rancher/rke2/agent/logs/kubelet.log
etcdcontainer=$(crictl ps --label io.kubernetes.container.name=etcd --quiet)
- etcdctl check perf
crictl exec $etcdcontainer sh -c "ETCDCTL_ENDPOINTS='https://127.0.0.1:2379' ETCDCTL_CACERT='/var/lib/rancher/rke2/server/tls/etcd/server-ca.crt' ETCDCTL_CERT='/var/lib/rancher/rke2/server/tls/etcd/server-client.crt' ETCDCTL_KEY='/var/lib/rancher/rke2/server/tls/etcd/server-client.key' ETCDCTL_API=3 etcdctl check perf"
- etcdctl endpoint status
crictl exec $etcdcontainer sh -c "ETCDCTL_ENDPOINTS='https://127.0.0.1:2379' ETCDCTL_CACERT='/var/lib/rancher/rke2/server/tls/etcd/server-ca.crt' ETCDCTL_CERT='/var/lib/rancher/rke2/server/tls/etcd/server-client.crt' ETCDCTL_KEY='/var/lib/rancher/rke2/server/tls/etcd/server-client.key' ETCDCTL_API=3 etcdctl endpoint status --write-out=table"
- etcdctl endpoint health
crictl exec $etcdcontainer sh -c "ETCDCTL_ENDPOINTS='https://127.0.0.1:2379' ETCDCTL_CACERT='/var/lib/rancher/rke2/server/tls/etcd/server-ca.crt' ETCDCTL_CERT='/var/lib/rancher/rke2/server/tls/etcd/server-client.crt' ETCDCTL_KEY='/var/lib/rancher/rke2/server/tls/etcd/server-client.key' ETCDCTL_API=3 etcdctl endpoint health --write-out=table"
- etcdctl alarm list
crictl exec $etcdcontainer sh -c "ETCDCTL_ENDPOINTS='https://127.0.0.1:2379' ETCDCTL_CACERT='/var/lib/rancher/rke2/server/tls/etcd/server-ca.crt' ETCDCTL_CERT='/var/lib/rancher/rke2/server/tls/etcd/server-client.crt' ETCDCTL_KEY='/var/lib/rancher/rke2/server/tls/etcd/server-client.key' ETCDCTL_API=3 etcdctl alarm list"