powershellazureazure-cliazure-container-serviceazure-aks

Unable to connect to the server: dial tcp [::1]:8080: connectex: No connection could be made because the target machine actively refused it


Am working on Azure Kubernates where we can store Docker Images in Azure. Here am trying to check my kubectl version, then am getting

Unable to connect to the server: dial tcp [::1]:8080: connectex: No connection could be made because the target machine actively refused it.

For this I followed MSDN:uilding Microservices with AKS and VSTS – Part 2 and MSDOCS:Kubernetes on windows

So, can you please suggest me “How to resolve for this issue?”


Solution

  • I think you might missed out to configure the cluster, for that you need to run the below command in your command prompt.

    az aks get-credentials --resource-group myResourceGroup --name myAKSCluster
    

    The above CLI command creates .config file with complete cluster and nodes details in your local machine.

    After that you run kubectl get nodes command in your command prompt, then you can get the list of nodes inside the cluster like in the below image.

    enter image description here For reference follow this Deploy an Azure Kubernetes Service (AKS) cluster.