Reputation: 490
I was trying to run
"kubectl get nodes
" command for k8s cluster.it gives "Unable to connect to the server: dial tcp..."
this is a k8s cluster created by a different user in the company AWS account.
this is the steps I have followed
export AWS_PROFILE=RR
export KOPS_STATE_STORE=s3://s3bucketname
kops export kubecfg dev.k8s.local
kubectl config get-contexts
kubectl get nodes 12:53:18
Unable to connect to the server: dial tcp 3.136.226.173:443: i/o timeout
I need to view running nodes and services in this k8 cluster how can I do this.
Upvotes: 3
Views: 1013
Reputation: 4474
It happens when you create/use private cluster.
To solve - add an external IP
to authorized networks.
to get your external IP
address, you can use some of these commands:
curl ifconfig.co
dig +short myip.opendns.com @resolver1.opendns.com
curl ifconfig.me
curl ifconfig.co
curl smart-ip.net/myip
wget -O - -q icanhazip.com
wget -O - -q ifconfig.me/ip
Other such resources:
k8s
contextTo get context use:
kubectl config view
To set context use:
kubectl config set-context <your_context>
As per this answer, you'd check an AMI
template that used when cluster was created.
The cluster was set up using an older version of the CloudFormation template
Upvotes: 2