Share via

AKS pods communication with service

Satish Thamarana 20 Reputation points
2025-05-20T23:16:42.1766667+00:00

In an Azure Kubernetes Service (AKS) cluster, some pods are unable to communicate with services in other namespaces or with external endpoints. The cluster uses Azure CNI for networking. What could be the possible causes of this issue, and how would you troubleshoot and resolve it?

Azure Kubernetes Service
Azure Kubernetes Service

An Azure service that provides serverless Kubernetes, an integrated continuous integration and continuous delivery experience, and enterprise-grade security and governance.


Answer accepted by question author
  1. Pramidha Yathipathi 1,140 Reputation points Microsoft External Staff Moderator
    2025-05-21T00:58:14.3633333+00:00

    Hi Satish Thamarana,

    If you have implemented network policies, they might be blocking communication. Run the command:

    kubectl get networkpolicies -A
    

    Look for any custom policies that may restrict traffic between namespaces.

    Confirm that the service definitions are correct and that the pods are properly registered as endpoints for those services:

    kubectl get services -n <namespace-name>
    

    Then check if the pod IPs are included in the service's endpoints:

    kubectl describe services <service-name> -n <namespace-name>
    

    Check the logs of the pods that cannot communicate. This can provide insights into any errors they might be encountering:

    kubectl logs <pod-name> -n <namespace-name>
    

    Use a test pod to verify connectivity between the pods. You can create a test pod and install necessary utilities:

    kubectl run -it --rm aks-ssh --namespace <namespace> --image=debian:stable -- /bin/bash apt-get update -y && apt-get install dnsutils curl netcat-openbsd -y
    

    Then, try reaching the target pod:

    curl -Iv http://<pod-ip-address>:<port>

    If you're communicating with external endpoints, check any associated Network Security Groups (NSGs) to ensure the necessary ports are open.

    Finally, if you’re using Azure services that the pods need to access, ensure that the proper service endpoints or private links are configured correctly.

    https://learn.microsoft.com/en-us/troubleshoot/azure/azure-kubernetes/connectivity/troubleshoot-connection-pods-services-same-cluster

    If you found information helpful, please click "Upvote" on the post to let us know.

    If the issue still persist feel free to ask us we are happy to assist you.

    Thank You.

    1 person found this answer helpful.
    0 comments No comments

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.