manzion_111
manzion_111

Reputation: 137

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

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.

Upvotes: 1

Views: 376

Answers (2)

N. Alston
N. Alston

Reputation: 61

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

Upvotes: 1

4c74356b41
4c74356b41

Reputation: 72191

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/

Upvotes: 1

Related Questions