PS C:\WINDOWS\system32> kubectl get nodes -o wide
Unable to connect to the server: dial tcp [::1]:8080: connectex: No connection could be made because the target machine actively refused it.
PS C:\WINDOWS\system32>
PS C:\WINDOWS\system32> kubectl get nodes -o wide
Unable to connect to the server: dial tcp [::1]:8080: connectex: No connection could be made because the target machine actively refused it.
PS C:\WINDOWS\system32>
Hello @ShrikantBhagwat-6030 ,
Good to know that it is working now after following those steps
`` If you want to SSH into any of the Nodes, there are multiple ways:
One of the simple ways is :
kubectl debug node/aks-agentpool-20294322-vmss000000 -it --image=mcr.microsoft.com/aks/fundamental/base-ubuntu:v0.0.11
Additional documentation:
https://docs.microsoft.com/en-us/azure/aks/ssh
https://gist.github.com/tsaarni/624d5406e442f08fe11083169c059a68
Kindly make sure to Upvote and accept all those answers which helped out in the resolution of your problem, so that It will be helpful to the community out there who is looking for similar issues.
Hello @ShrikantBhagwat-6030 ,
Thanks for reaching out to Microsoft Q&A Community.
There can be multiple reasons why you were not able to run kubectl command.
Is this the new AKS cluster ? Was that command running previously ?
Did you try testing out with another AKS cluster ?
Couple of options:
Can you try connecting to the cluster using :
az aks get-credentials -g <resourcegroupname> -n <clustername> (this command will update/create the .config file with new cluster)
and then run kubectl commands ?
Also try to see the current cluster information using kubectl cluster-info
Try to validate if your config file is correctly configured by going to
$HOME/.kube/config - Linux or
%UserProfile%/.kube/config - Windows
Run the command below to tell the kubernetes where to find the configuration file:
[Environment]::SetEnvironmentVariable("KUBECONFIG", $HOME + ".kube\config", [EnvironmentVariableTarget]::Machine)
Find out the current configs
kubectl config get-contexts
If there is no context , set it using below command
kubectl config set-context <Your context>
Additional documentation:
https://kubernetes.io/docs/concepts/configuration/organize-cluster-access-kubeconfig/
Let us know if the above steps helps you out in the resolution!
PS C:\WINDOWS\system32> kubectl get nodes -o wide
NAME STATUS ROLES AGE VERSION INTERNAL-IP EXTERNAL-IP OS-IMAGE KERNEL-VERSION CONTAINER-RUNTIME
aks-agentpool-20294322-vmss000000 Ready agent 47h v1.20.7 10.240.0.4 <none> Ubuntu 18.04.5 LTS 5.4.0-1051-azure containerd://1.4.4+azure
aks-agentpool-20294322-vmss000001 Ready agent 47h v1.20.7 10.240.0.5 <none> Ubuntu 18.04.5 LTS 5.4.0-1051-azure containerd://1.4.4+azure
PS C:\WINDOWS\system32>
It is working. Now Thanks
Can I ssh into into IP Address 10.240.0.4 ?
Is this AKS Cluster IP Address. ?
9 people are following this question.