title: How to access mongodb replicaset hosted on a kubernetes cluster from outside?
body: <p>Cluster created in Rancher with Amazon EKS.</p>
  
  <p>MongoDB replicaset was created as a catalog app in Rancher.</p>
  
  <p>Services in the cluster can successfully connect the the database with this connection string.</p>
  
  <p><code>mongodb://mongodb-replicaset.mongodb-replicaset.svc.cluster.local:27017/tradeit_system?replicaSet=rs</code></p>
  
  <p>I want to view and edit data in the db. In a local db you can do it easily by the command <code>mongo --port 27017</code>. </p>
  
  <p>Similarly is there a way to connect to the one one on kubernetes. Either from the terminal or using an application like Robo 3t?</p>
  
  <p>EDIT</p>
  
  <p>The replicaset doesn't show when I do.</p>
  
  <p><code>kubectl get deployments --all-namespace</code></p>
  
  <p><code>kubectl get pods --all-namespaces</code></p>
  
  <p>Show that it runs in 3 pods mongodb-replicaset-0, mongodb-replicaset-1, mongodb-replicaset-2.</p>