Cluster information:
Kubernetes version: 1.20.1
Cloud being used: Virtualbox
Installation method: Build your own Multi-node Kubernetes Cluster with Ubuntu(20) on VirtualBox - techbeatly
Host OS: Ubuntu 20.04.4 LTS
CNI and version: calico
CRI and version:
This is my virtualbox kubernetes lab which I didnt use for a few months.
I have started it today and any kubectl command ends up like this:
$ kubectl get nodes -o wide
The connection to the server master:6443 was refused - did you specify the right host or port?
$ kubectl get po --all-namespaces
The connection to the server master:6443 was refused - did you specify the right host or port?
Indeed, there is nothing listening on socket master:6443
$ ss -tl4np
State Recv-Q Send-Q Local Address:Port Peer Address:Port Process
LISTEN 0 4096 127.0.0.1:34627 0.0.0.0:*
LISTEN 0 4096 127.0.0.1:10248 0.0.0.0:*
LISTEN 0 4096 192.168.1.190:2379 0.0.0.0:*
LISTEN 0 4096 127.0.0.1:2379 0.0.0.0:*
LISTEN 0 4096 192.168.1.190:2380 0.0.0.0:*
LISTEN 0 4096 127.0.0.1:2381 0.0.0.0:*
LISTEN 0 4096 127.0.0.1:33133 0.0.0.0:*
LISTEN 0 4096 127.0.0.1:10257 0.0.0.0:*
LISTEN 0 4096 127.0.0.1:10259 0.0.0.0:*
LISTEN 0 4096 127.0.0.53%lo:53 0.0.0.0:*
LISTEN 0 128 0.0.0.0:22 0.0.0.0:*
ccd@master:~$ curl https://master:6443
curl: (7) Failed to connect to master port 6443: Connection refused
As what I can see on the other cluster, process responsible for service on port 6443 is kube-apiserver. There is no such binary.
Question:
- How do I start kube-apiserver
- Why all of the suddent kube-apiserver is gone. It was working quite good last time i was this lab.
Side note: kubelet service is running but in in error state.
systemctl status kubelet
? kubelet.service - kubelet: The Kubernetes Node Agent
Loaded: loaded (/lib/systemd/system/kubelet.service; enabled; vendor preset: enabled)
Drop-In: /etc/systemd/system/kubelet.service.d
+-10-kubeadm.conf
Active: active (running) since Wed 2024-01-17 19:55:47 UTC; 44min ago
Docs: https://kubernetes.io/docs/home/
Main PID: 613 (kubelet)
Tasks: 15 (limit: 2274)
Memory: 128.5M
CGroup: /system.slice/kubelet.service
+-613 /usr/bin/kubelet --bootstrap-kubeconfig=/etc/kubernetes/bootstrap-kubelet.conf --kubeconfig=/etc/kubernetes/kubelet.conf --config=/var/lib/kubelet/config.yaml --network-plugin=cni --pod-infra-container-image=k8s.gcr.io/pause:3.6
Jan 17 20:40:43 master kubelet[613]: E0117 20:40:43.451465 613 kubelet.go:2422] "Error getting node" err="node \"master\" not found"
Jan 17 20:40:43 master kubelet[613]: E0117 20:40:43.552175 613 kubelet.go:2422] "Error getting node" err="node \"master\" not found"
Jan 17 20:40:43 master kubelet[613]: E0117 20:40:43.653822 613 kubelet.go:2422] "Error getting node" err="node \"master\" not found"
Jan 17 20:40:43 master kubelet[613]: E0117 20:40:43.754428 613 kubelet.go:2422] "Error getting node" err="node \"master\" not found"
Jan 17 20:40:43 master kubelet[613]: E0117 20:40:43.855082 613 kubelet.go:2422] "Error getting node" err="node \"master\" not found"
Jan 17 20:40:43 master kubelet[613]: E0117 20:40:43.957374 613 kubelet.go:2422] "Error getting node" err="node \"master\" not found"
Jan 17 20:40:44 master kubelet[613]: E0117 20:40:44.058207 613 kubelet.go:2422] "Error getting node" err="node \"master\" not found"
Jan 17 20:40:44 master kubelet[613]: E0117 20:40:44.158993 613 kubelet.go:2422] "Error getting node" err="node \"master\" not found"
Jan 17 20:40:44 master kubelet[613]: E0117 20:40:44.259665 613 kubelet.go:2422] "Error getting node" err="node \"master\" not found"
Jan 17 20:40:44 master kubelet[613]: E0117 20:40:44.360617 613 kubelet.go:2422] "Error getting node" err="node \"master\" not found"