问题描述:

I created a mongodb service according to the kubernetes tutorial, http://kubernetes.io/docs/getting-started-guides/meanstack/

Now my question is how do I gain access to the database itself, with a client like Robomongo or similar clients? Just for making backups or exploring what data have been entered.

The mongo-pod and service only have an internal endpoint, and a single mount.

Is there any way to safely access this instance with no public endpoint?

internally URI is mongo:27***

网友答案:

The kubernetes cmd-line tool provides this functionality as @ainlolcat stated

kubectl get pods

Retrieves the pod names currently running and with:

kubectl exec -i mongo-controller-* bash

you get a basic bash, which lets you execute

mongo

to get into the database to create dumps, and so on. The bash is very basic and has no features like completion and so on. I have not found a solution for better shell but it does the job

相关阅读:
Top