Unable to communicate to a machine in the network(outside of the k8s cluster) with cidr 10.0.x.0/24 from within the pod Unable to communicate to a machine in the network(outside of the k8s cluster) with cidr 10.0.x.0/24 from within the pod kubernetes kubernetes

Unable to communicate to a machine in the network(outside of the k8s cluster) with cidr 10.0.x.0/24 from within the pod


Based on your question, it sounds like you've added another subnet to the k8 Virtual Network that gets deployed with the ACS Kubernetes cluster.

As it turns out, I ran into this exact same problem in our project. Azure Container Services uses very specific routing rules for the agent nodes. When the k8 cluster is deployed, they create a Route Table resource in the same resource group as all your cluster entities. So, if you...

  1. Open the k8 Route Table in the Azure Portal
  2. Go to the Subnets section
  3. +Associate with the subnet that your other VMs/PaaS services are in

...this will create the routes that the k8 agents are looking for when routing the outbound Pod container traffic.


I have the exact same problem, after googling so much I found a posible solution:

Use ip-masq-agent to masq the target CIDR in order to MASQUERADE that destination

https://kubernetes.io/docs/tasks/administer-cluster/ip-masq-agent/

Some similar example:

http://madorn.com/kubernetes-non-masquerade-cidr.html#.XMDGI-H0nb0


You cannot ping a kubernetes service. More information here: https://github.com/kubernetes/kubernetes/issues/7996#issuecomment-100413276. To test connectivity, you can expose a simple web server on a port, and confirm using curl from inside or outside the container.