I installed Kubernetes in RHEL 7.x. I expect kubectl commands to work without errors. Port 8080 is not being blocked from my client workstation to the RedHat server with Kubernetes. I tried several things to diagnose the problem.

I ran this command (to reproduce the problem): kubectl version

I saw this:

Client Version: version.Info{Major:"1", Minor:"7", GitVersion:"v1.7.5", GitCommit:"17d7182a7ccbb167074be7a87f0a68bd00d58d97", GitTreeState:"clean", BuildDate:"2017-08-31T09:14:02Z", GoVersion:"go1.8.3", Compiler:"gc", Platform:"linux/amd64"} The connection to the server localhost:8080 was refused - did you specify the right host or port?

The error about the port being refused is confusing me.

I ran this command: nmap -p 8080 localhost

It shows that port 8080 is merely closed -- but not blocked.

I have no admin.conf file in /etc/kubernetes/. Did I do something wrong? How can I use kubectl commands without getting the error "The connection to the server localhost:8080 was refused - did you specify the right host or port?"

Every kubectl command I run returns this error.

How do I get the admin.conf file? I was thinking of trying to install gcloud. But "sudo yum install gcloud" did not work. The package could not be found. Maybe I don't need to bother with admin.conf or the gcloud utility.

How do I get kubectl commands to work without that error about the connection being refused on port 8080?

1 Answer 1


8080 is the insecure port. meaning you don't need auth or ssl. If you want to enable port 8080 you need to run the apiserver with the following flag.

--insecure-port 8080

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.