![mongodb compass docker mongodb compass docker](https://upload-images.jianshu.io/upload_images/25993550-701ad41ae7b7fa98.png)
Name: mongodb-service namespace: labs spec: name: mongodb-vol persistentVolumeClaim: mountPath: /data/db name: mongodb-vol volumes:
![mongodb compass docker mongodb compass docker](https://miro.medium.com/max/552/1*KtI9a2mIomMvIe4bIOEWBA.png)
Name: mongodb-secret-amended key: mongo-root-password volumeMounts: name: MONGO_INITDB_ROOT_PASSWORD valueFrom: Name: mongodb-secret-amended key: mongo-root-username name: MONGO_INITDB_ROOT_USERNAME valueFrom:
![mongodb compass docker mongodb compass docker](http://www.kwangsiklee.com/wp-content/uploads/direct/blog-markdown/border/2018-12-18-14.39.22.png)
RunAsNonRoot: true runAsUser: 1001 ports: name: mongodb image: docker.io/bitnami/mongodb:4.4.6-debian-10-r0 imagePullPolicy: "IfNotPresent " securit圜ontext: Name: mongodb-deployment namespace: labs labels:
![mongodb compass docker mongodb compass docker](https://miro.medium.com/max/1280/1*I_bPWSfqfhs04UU1dsLHWA.png)
It also fails with Authentication Failed (Shouldn't the built in root connect by default ? ) Additional informationįor context I intend to use the Mongo-URI value in my CronJob as below :ĪpiVersion: apps/v1 kind: Deployment metadata: I tried to verify if the default built-in user can indeed authenticate against the admin db : use admin db.auth('root','PASSWORD') I get error T12:37:41.690+0000 Failed: can't create session: could not connect to server: server selection error: server selection timeout, current topology: I want to backup a database named platforms using the default built-in root user (specified here) and I am getting the following errors :Ī) kubectl exec -it - sh mongodump -authenticationDatabase admin -gzip -out /var/backups/dump-25-05-22/mybackup.gz I am following the example given here What do you see instead? To do this I exec into the pod and attempt to do mongodump. I expect to be able to test a MongoURI value first before I plug it into the job. If the CronJob connects successfully it will execute the backup and dump the files at a path specified in the job Dockerfile. I want to setup backups for my MongoDB instance and the k8s cron job that executes these backups will need a Mongo-URI in order to connect to the deployment.