How to fix host-port issue on kubernetes dashboard setup on linux?

10/21/2019

In the Amazon Linux machine while trying to install a Kubernetes dashboard there was an error which is been unpredictable.

This is a new Amazon Linux server in AWS,there was an error while installing the Kubernetes dashboard regarding host and port issue, but so nothing has configured in it as a new server. And I've installed kubectl and awscli for checking but it doesn't work. I've tried on all community support but there is no issue placed like mine.

while running the command

$ kubectl create -f https://raw.githubusercontent.com/kubernetes/dashboard/master/src/deploy/recommended/kubernetes-dashboard.yaml 

It throws the error

The connection to the server localhost:8080 was refused - did you specify the right host or port?
-- Sivakumar
amazon-linux
docker
kubernetes
kubernetes-dashboard
linux

1 Answer

10/21/2019

setup kubectl correctly

add admin.conf (your cluster config) in your KUBECONFIG

Example:

export KUBECONFIG=$HOME/.kube/admin.conf
-- coaxium
Source: StackOverflow