i want to enable the pod to pod communication in different namespace same cluster

6/18/2019

I have kubernetes cluster with 1 master 1 worker , i have DB service postgres running one namespace "PG" and i have another service config-server running in default namespace and i am unable to access postgres from config-server service which is in default namespace

Kubernetes version 1.13 overlay network -calico as per the articles i read if pods doesnt have any network policy defined then pods can be reached to any other namespace pod without any restriction , need help in how to achieve it

-- Manoj Kasa
kubernetes
namespaces
pod

2 Answers

6/25/2019

I was using kubernetes cluster with overlay network as calico , if there is no network policy created , by default kubernetes core dns will resolve the service but we have to add the . in the application or env variable where you are calling the service in another namespace. That will allow cross namespace communication

-- Manoj Kasa
Source: StackOverflow

6/18/2019

should be able to reach any pod from another pod on the same cluster. one quick way to check is to ping the service dns of the pod from another pod

get into config service pod and try to run the below command

ping <postgres-service-name>.<namespace>.svc.cluster.local

you should be able to get ping response

-- P Ekambaram
Source: StackOverflow