MongoDB Replica establishment running on two different kubernetes cluster on different physical host

7/12/2018

Objective : MongoDB Replica establishment running on two different kubernetes cluster on different physical host.

Host 1 : kubernetes cluster -1 : A pod is running with let say (mongo1 instance with replication set name “my-mongo-set”). Service is created with pod running behind let say mongo1-service.

Host 2 : Kubernetes cluster-2 : Another pod is running with (mong2 instance with same replication set name “my-mongo-set”). Service is created with pod running behind let say mongo2-service.

now, i am unable to set the mongoDb in replication mode from inside the pod to another pod.

Host 1: Kubernetes-Cluster-1 Host 2 : Kubernetes-Cluster-2

Mongo1-service Mongo2-service Mongo1-pod Mongo2-pod

I need pod to pod communication between two different kubernetes cluster node running onto different machines.

I am unable to expose the Kubernetes mongo-service IP using either type as NodePort, LoadBalancer, ingress controller(kong) etc.

I am new to kubernetes and I have installed the kubernetes (kubectl, kubeadm, kubelet) through apt-get and then run the Kubeadm init command.

Any suggestions how to achieve this …. ?

-- Lalit Kumar
kubernetes
mongodb
networking
replication

0 Answers