How To Ubuntu 22.04...
 
Notifications
Clear all

[Solved] How To Ubuntu 22.04 results in Worker Nodes Joining successfully but unable to connect

4 Posts
2 Users
0 Reactions
317 Views
(@syzygy)
Posts: 2
New Member
Topic starter
 

I followed -- https://www.virtualizationhowto.com/2023/12/how-to-install-kubernetes-in-ubuntu-22-04-with-kubeadm/

Everything worked on the Master node.  Kubeadm reported them joining OK, but a "kubectl get nodes" showed a problem and getting refused locally. " sudo systemctl status containerd" shows things running on all 3 servers.  What are the next steps to diagnose?

(Part of the issue may be that it is sometimes unclear what gets run where.  Steps 1-6, 10 I ran on all 3 nodes. Steps 7,9 I ran only on the master and step 8 I only ran on the workers. )

# kubeadm join 192.168.50.150:6443 --token 3gfszc.22zm36h111181qww \
--discovery-token-ca-cert-hash sha256:522db419b63f19712b7343f0911111ed7096611111d9c2ae1a81e13c47001f1b
[preflight] Running pre-flight checks
[preflight] Reading configuration from the cluster...
[preflight] FYI: You can look at this config file with 'kubectl -n kube-system get cm kubeadm-config -o yaml'
[kubelet-start] Writing kubelet configuration to file "/var/lib/kubelet/config.yaml"
[kubelet-start] Writing kubelet environment file with flags to file "/var/lib/kubelet/kubeadm-flags.env"
[kubelet-start] Starting the kubelet
[kubelet-start] Waiting for the kubelet to perform the TLS Bootstrap...

This node has joined the cluster:
* Certificate signing request was sent to apiserver and a response was received.
* The Kubelet was informed of the new secure connection details.

Run 'kubectl get nodes' on the control-plane to see this node join the cluster.

# kubectl get nodes
E1227 14:47:43.963214 8374 memcache.go:265] couldn't get current server API group list: Get "http://localhost:8080/api?timeout=32s": dial tcp 127.0.0.1:8080: connect: connection refused
E1227 14:47:43.963950 8374 memcache.go:265] couldn't get current server API group list: Get "http://localhost:8080/api?timeout=32s": dial tcp 127.0.0.1:8080: connect: connection refused
E1227 14:47:43.965704 8374 memcache.go:265] couldn't get current server API group list: Get "http://localhost:8080/api?timeout=32s": dial tcp 127.0.0.1:8080: connect: connection refused
E1227 14:47:43.967500 8374 memcache.go:265] couldn't get current server API group list: Get "http://localhost:8080/api?timeout=32s": dial tcp 127.0.0.1:8080: connect: connection refused
E1227 14:47:43.969408 8374 memcache.go:265] couldn't get current server API group list: Get "http://localhost:8080/api?timeout=32s": dial tcp 127.0.0.1:8080: connect: connection refused
The connection to the server localhost:8080 was refused - did you specify the right host or port?
This topic was modified 9 months ago 2 times by syzygy
 
Posted : 27/12/2023 6:06 pm
Brandon Lee
(@brandon-lee)
Posts: 340
Member Admin
 

@syzygy Thank you for joining the forums and the question! This seems like a kube config problem most likely. On your master API server, you will want to make sure and run the following:

mkdir -p $HOME/.kube
sudo cp -i /etc/kubernetes/admin.conf $HOME/.kube/config
sudo chown $(id -u):$(id -g) $HOME/.kube/config

This should correctly configure kubectl to communicate with the control plane. You could also copy this file from your master node to the workers and run kubectl commands from there as well. Let me know if this helps. Welcome again to the forums.

 
Posted : 27/12/2023 6:25 pm
(@syzygy)
Posts: 2
New Member
Topic starter
 

@brandon-lee  "You could also copy this file from your master node to the workers and run kubectl commands from there as well." 

D'oh!! I completely missed this step. 

 
Posted : 27/12/2023 11:15 pm
Brandon Lee
(@brandon-lee)
Posts: 340
Member Admin
 

@syzygy No worries! There are a lot of moving parts and steps. Great suggestion to make it more clear on which nodes you need to run this on as well 👍

 
Posted : 28/12/2023 12:11 am