is a pod DNS can be reached (with dig or nslookup)?

12/13/2018

I understand that pods are isolated into another subnet (POD-CIDR, CNI...) Is that possible to reach a pod (using a tool)? I saw that you can use ClusterIP, LB, Externalname, but I cannot reach my pod's ipaddress.

-- manzion_111
azure
azure-aks
azure-kubernetes
kubernetes

2 Answers

12/13/2018

Assuming you have a service defined for your pod (deployment) you can use kubectl to forward local ports to that service. For example:

$ kubectl port-forward redis-service 6379:6379 --namespace=default

This would allow you to access your pod/service through local port 6379

Kubernetes Documentation


If you are interested in making your pod publicly available, your best resource would be to define an ingress. This will allow you to map a public DNS hostname and path to your internal kubernetes service

Ingress Documentation

-- N. Alston
Source: StackOverflow

12/13/2018

that means something is wrong with your networking. Kubernetes imposes the following fundamental requirements on any networking implementation (barring any intentional network segmentation policies):

  1. all containers can communicate with all other containers without NAT
  2. all nodes can communicate with all containers (and vice-versa) without NAT
  3. the IP that a container sees itself as is the same IP that others see it as

https://kubernetes.io/docs/concepts/cluster-administration/networking/

-- 4c74356b41
Source: StackOverflow