When I start prepare kubernetes in aws the errors shown below

10/8/2019

Below are the commands and their outputs:

root@k8s-master:~# sudo cp -i /etc/kubernetes/admin.conf $HOME/.kube/config
cp: cannot stat '/etc/kubernetes/admin.conf': No such file or directory
root@k8s-master:~# kubectl get services -n kube-system
The connection to the server localhost:8080 was refused - did you specify the right host or port?
-- Bhaskara Rao
find
kubernetes
service

1 Answer

10/8/2019
  1. It looks like you are not running EKS. Otherwise you cannot access the masters. With EKS, the masters are managed by AWS and you can't ssh to them
  2. your kubectl commands makes a call to the kubernetes api server. So you have to check if it is running on localhost on port 8080.
-- blnr102
Source: StackOverflow