Score:0

Kubernetes master fails to connect every few seconds - strange error (Debian 11 OS)

gy flag
inst@k8s-master:~$ kubectl get pods -n kube-system
NAME                                       READY   STATUS             RESTARTS         AGE
calico-kube-controllers-674fff74c8-g9dkn   1/1     Running            1 (31s ago)      64s
calico-node-9rpjc                          0/1     Running            0                64s
calico-node-gfwsb                          0/1     Running            0                64s
calico-node-rp584                          0/1     Running            0                64s
coredns-5d78c9869d-dhft7                   1/1     Running            2 (25s ago)      19m
coredns-5d78c9869d-ggjb4                   1/1     Running            2 (25s ago)      19m
etcd-k8s-master                            1/1     Running            10 (5m52s ago)   18m
kube-apiserver-k8s-master                  1/1     Running            11 (5m23s ago)   19m
kube-controller-manager-k8s-master         1/1     Running            16 (3m21s ago)   18m
kube-proxy-btm5h                           0/1     CrashLoopBackOff   5 (40s ago)      15m
kube-proxy-clm69                           1/1     Running            2 (32s ago)      2m1s
kube-proxy-mnv87                           1/1     Running            15 (102s ago)    19m
kube-scheduler-k8s-master                  1/1     Running            13 (91s ago)     18m
inst@k8s-master:~$ kubectl get pods -n kube-system
The connection to the server 192.168.0.211:6443 was refused - did you specify the right host or port?

There are about 5-10 seconds between these two commands

So far I have tried restarting the server, reloading the Linux firewall and deleting and re-entering the ports on the firewall. I have also set a DNS entry on my PiHole but unfortunately all this did not help.

I hope that the situation of the cluster will stabilize.

The cluster was initialized with Kubeadm.

The Pod-Network (should work) works with Calico.

Linux firewall is UFW installed on every Node.

inst@k8s-master:~$ sudo ufw status
Status: active

To                         Action      From
--                         ------      ----
22/tcp                     ALLOW       Anywhere                  
22                         ALLOW       Anywhere                  
10250/tcp                  ALLOW       Anywhere                  
30000:32767/tcp            ALLOW       Anywhere                  
6443/tcp                   ALLOW       Anywhere                  
2379/tcp                   ALLOW       Anywhere                  
2380/tcp                   ALLOW       Anywhere                  
10251/tcp                  ALLOW       Anywhere                  
10252/tcp                  ALLOW       Anywhere                  
10255/tcp                  ALLOW       Anywhere                  
179/tcp                    ALLOW       Anywhere                  
4789/udp                   ALLOW       Anywhere                  
51820/udp                  ALLOW       Anywhere                  
51821/udp                  ALLOW       Anywhere                  
22/tcp (v6)                ALLOW       Anywhere (v6)             
22 (v6)                    ALLOW       Anywhere (v6)             
10250/tcp (v6)             ALLOW       Anywhere (v6)             
30000:32767/tcp (v6)       ALLOW       Anywhere (v6)             
6443/tcp (v6)              ALLOW       Anywhere (v6)             
2379/tcp (v6)              ALLOW       Anywhere (v6)             
2380/tcp (v6)              ALLOW       Anywhere (v6)             
10251/tcp (v6)             ALLOW       Anywhere (v6)             
10252/tcp (v6)             ALLOW       Anywhere (v6)             
10255/tcp (v6)             ALLOW       Anywhere (v6)             
179/tcp (v6)               ALLOW       Anywhere (v6)             
4789/udp (v6)              ALLOW       Anywhere (v6)             
51820/udp (v6)             ALLOW       Anywhere (v6)             
51821/udp (v6)             ALLOW       Anywhere (v6)     

when i restart kubelet it works temporarily

inst@k8s-master:~$ sudo systemctl restart kubelet
inst@k8s-master:~$ kubectl get nodes
NAME          STATUS   ROLES           AGE   VERSION
k8s-master    Ready    control-plane   50m   v1.27.1
k8s-worker1   Ready    <none>          45m   v1.27.1
k8s-worker2   Ready    <none>          32m   v1.27.1
Siegfred V. avatar
md
You can go through this [public documentation](https://medium.com/@texasdave2/troubleshoot-kubectl-connection-refused-6f5445a396ed) which can help you solve the issue.
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.