fujitatomoya / ros_k8s

Kuberenetes / ROS&ROS2 Cluster Samples
Creative Commons Attribution 4.0 International
185 stars 26 forks source link

`kubeadm reset` fails with `Unable to fetch the kubeadm-config` #47

Closed fujitatomoya closed 4 months ago

fujitatomoya commented 4 months ago
root@edgemaster:~# kubeadm reset -f
[reset] Reading configuration from the cluster...
[reset] FYI: You can look at this config file with 'kubectl -n kube-system get cm kubeadm-config -o yaml'
W0510 10:41:03.508548    8626 reset.go:106] [reset] Unable to fetch the kubeadm-config ConfigMap from cluster: failed to get config map: Get "https://43.135.146.155:6443/api/v1/namespaces/kube-system/configmaps/kubeadm-config?timeout=10s": dial tcp 43.135.146.155:6443: connect: connection refused
Found multiple CRI endpoints on the host. Please define which one do you wish to use by setting the 'criSocket' field in the kubeadm configuration file: unix:///var/run/containerd/containerd.sock, unix:///var/run/cri-dockerd.sock
To see the stack trace of this error execute with --v=5 or higher

this will cause the following problem.

root@edgemaster:~# kubeadm init --pod-network-cidr=10.244.0.0/16 --cri-socket unix:///var/run/containerd/containerd.sock
I0510 10:42:29.063124    8923 version.go:256] remote version is much newer: v1.30.0; falling back to: stable-1.26
[init] Using Kubernetes version: v1.26.15
[preflight] Running pre-flight checks
error execution phase preflight: [preflight] Some fatal errors occurred:
    [ERROR FileAvailable--etc-kubernetes-manifests-kube-apiserver.yaml]: /etc/kubernetes/manifests/kube-apiserver.yaml already exists
    [ERROR FileAvailable--etc-kubernetes-manifests-kube-controller-manager.yaml]: /etc/kubernetes/manifests/kube-controller-manager.yaml already exists
    [ERROR FileAvailable--etc-kubernetes-manifests-kube-scheduler.yaml]: /etc/kubernetes/manifests/kube-scheduler.yaml already exists
    [ERROR FileAvailable--etc-kubernetes-manifests-etcd.yaml]: /etc/kubernetes/manifests/etcd.yaml already exists
[preflight] If you know what you are doing, you can make a check non-fatal with `--ignore-preflight-errors=...`
To see the stack trace of this error execute with --v=5 or higher
fujitatomoya commented 4 months ago

The solution is, that we need to specify the same CRI socket if multiple sockets are available.

root@edgemaster:~# kubeadm reset -f --cri-socket unix:///var/run/containerd/containerd.sock

this needs to be updated in doc procedure.

fujitatomoya commented 4 months ago

addressed by https://github.com/fujitatomoya/ros_k8s/commit/7e56346e66b739f1615f9df817e98f57559667f6