After Ubuntu 20.04 LTS is successfully added to the cluster on the node, the following prompt will appear:
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.
Verify the success of adding by kubectl get nodes
command. The following error occurs:
The connection to the server localhost:8080 was refused - did you specify the right host or port?
This error has also occurred on the master node. The solution gives the answer after successful installation
To start using your cluster, you need to run the following as a regular user:
mkdir -p $HOME/.kube
sudo cp -i /etc/kubernetes/admin.conf $HOME/.kube/config
sudo chown $(id -u):$(id -g) $HOME/.kube/config
Alternatively, if you are the root user, you can run:
export KUBECONFIG=/etc/kubernetes/admin.conf
I use the root account, so I need to execute the following command:
export KUBECONFIG=/etc/kubernetes/admin.conf
After the command is executed, verify it:
root@k8s-master-03:/etc/kubernetes# kubectl get nodes
W0706 10:27:55.181115 22817 loader.go:221] Config not found: /etc/kubernetes/admin.conf
The connection to the server localhost:8080 was refused - did you specify the right host or port?
The key information of the error report is that the configuration is not found
Config not found: /etc/kubernetes/admin.conf
Let’s go to the /etc/kubernetes/
Directory:
root@k8s-master-03:/etc/kubernetes# ls -l
total 12
-rw------- 1 root root 1910 Jul 6 09:52 kubelet.conf
drwxr-xr-x 2 root root 4096 Jul 6 09:41 manifests
drwxr-xr-x 2 root root 4096 Jul 6 09:52 pki
The results show that only kubelet. Conf
(master node has admin. CONF), so we need to execute the following command:
export KUBECONFIG=/etc/kubernetes/kubelet.conf
Read More:
- [Solved] k8s kubeadmin init Error: http://localhost:10248/healthz‘ failed
- [Solved] K8s Initialize Error: failed with error: Get “http://localhost:10248/healthz“
- How to Solve kubelet starts error (k8s Cluster Restarted)
- K8s Install Error: Error: unknown flag: –experimental-upload-certs
- [Solved] K8s cluster build error: error: kubectl get csr No resources found.
- Connection refused: connect; nested exception is java.net.ConnectException: Connection refused: [How to Solve]
- [Solved] git error: RPC failed; curl 56 Recv failure:Connection was resetB/s
- K8s initializing the master & worker node error [How to Solve]
- [Solved] K8s Error: ERROR: Unable to access datastore to query node configuration
- K8s ❉ Error: cannot be handled as a** [How to Solve]
- [Solved] Mybatis Error: Establishing SSL connection without server‘s identity verification is not recommended.
- [SpringBoot] Maven Error: Connection refused to host: 127.0.0.1
- [Solved] AndroidStudio Error: Connect to 127.0.0.1:10887 [/127.0.0.1] failed: Connection refused…
- [Solved] k8s Error: Back-off restarting failed container
- How to Solve k8s Nodal issues: /sys/fs/cgroup/memory/docker: no space left on device\““: unknown.
- K8S Master Initialize Error: [ERROR CRI]: container runtime is not running: output: E0812
- K8s cluster initialization error: Port 6443 is in use [Solved]
- k8s kubernetes ingress error: endpoints “default-http-backend“ not found
- [Solved] “error_code“:500,“message“:“IO Error trying to forward REST request: java.net.ConnectException: Connection Refused
- [Solved] k8s error retrieving resource lock default/fuseim.pri-ifs: Unauthorized