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
462 Views
Posts: 2
Topic starter
(@syzygy)
New Member
Joined: 11 months ago

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?
3 Replies
Brandon Lee
Posts: 397
Admin
(@brandon-lee)
Member
Joined: 14 years ago

@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.

Reply
2 Replies
(@syzygy)
Joined: 11 months ago

New Member
Posts: 2

@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.ย 

Reply
Brandon Lee
Admin
(@brandon-lee)
Joined: 14 years ago

Member
Posts: 397

@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 👍

Reply