In this blog, we will show the steps to resolve the connection to the server localhost:8080 was refused – did you specify the right host or port error message.
- Currently we have 2 node cluster in our testing environment as shown below.
- Also, we have installed the kubernetes in our test environment. You can follow below link to install kubernetes in your end.
- Then we restarted the master node server and try to verify the node status. It shows the below error message.
REASONS FOR THIS ERROR
- First reason, is that swap memory has been disabled permanently.
- Need to KUBECONFIG in bashrc file to load kubernetes configuration automatically even after server reboots.
- To verify that goto, vi /etc/fstab.
- Add an hash ( # ) tag at being of swap.img line.
- Save the file and exit. Then reboot the VM.
- Once the server is back to online, If you are running as root user, you have to run export KUBECONFIG=/etc/kubernetes/admin.conf command every time the master node reboots.
- To automatic this process, type vi ~/.bashrc command.
- Go to last line of that file and add the below line and save it.
- Now you will able to access kubernetes without any issues.
Thank you for taking the time to read our blog on “steps to resolve the connection to the server localhost:8080 was refused – did you specify the right host or port error .” We hope you found the information valuable and insightful.
To know about Apache CloudStack Reach us.