@@ -39,7 +39,7 @@ The following YAML manifest shows an example `MongoDB` object configured with `g
3939apiVersion : kubedb.com/v1
4040kind : MongoDB
4141metadata :
42- name : rs
42+ name : mg-git
4343 namespace : demo
4444spec :
4545 init :
6868```
6969``` bash
7070kubectl create -f https://github.com/kubedb/docs/raw/{{< param " info.version" > }}/docs/examples/mongodb/initialization/git-sync-public.yaml
71- MongoDB.kubedb.com/rs created
71+ MongoDB.kubedb.com/mg-git created
7272```
7373
7474The ` git-sync ` container has two required flags:
@@ -79,21 +79,21 @@ The `git-sync` container has two required flags:
7979
8080> To know more about ` git-sync ` configuration visit this [ link] ( https://github.com/kubernetes/git-sync ) .
8181
82- Now, wait until ` rs ` has status ` Ready ` . i.e,
82+ Now, wait until ` mg-git ` has status ` Ready ` . i.e,
8383
8484``` bash
8585$ kubectl get mg -n demo
8686NAME VERSION STATUS AGE
87- rs 8.0.4 Ready 49m
87+ mg-git 8.0.4 Ready 49m
8888
8989```
9090
9191Next, we will connect to the MongoDB database and verify the data inserted from the ` *.js ` script stored in the Git repository.
9292
9393``` bash
94- $ kubectl exec -it -n demo rs -0 -- bash
94+ $ kubectl exec -it -n demo mg-git -0 -- bash
9595Defaulted container " mongodb" out of: mongodb, copy-config (init), git-sync (init)
96- mongodb@rs -0:/$ mongosh -u root -p $< your_mongodb_root_password>
96+ mongodb@mg-git -0:/$ mongosh -u root -p $< your_mongodb_root_password>
9797Current Mongosh Log ID: 6900695d231f7a9e99ce5f46
9898Connecting to: mongodb://< credentials> @127.0.0.1:27017/? directConnection=true& serverSelectionTimeoutMS=2000& appName=mongosh+2.5.8
9999Using MongoDB: 8.0.4
@@ -163,7 +163,7 @@ The following YAML manifest provides an example of a `MongoDB` resource configur
163163apiVersion : kubedb.com/v1
164164kind : MongoDB
165165metadata :
166- name : rs
166+ name : mg-git-ssh
167167 namespace : demo
168168spec :
169169 init :
@@ -204,7 +204,7 @@ spec:
204204
205205` ` ` bash
206206kubectl create -f https://github.com/kubedb/docs/raw/{{< param "info.version" >}}/docs/examples/mongodb/initialization/git-sync-ssh.yaml
207- MongoDB.kubedb.com/rs created
207+ MongoDB.kubedb.com/mg-git-ssh created
208208```
209209
210210Here,
@@ -217,9 +217,9 @@ Once the database reaches the `Ready` state, you can verify the data using the m
217217Next, we will connect to the MongoDB database and verify the data inserted from the ` *.js ` script stored in the Git repository.
218218
219219``` bash
220- $ kubectl exec -it -n demo rs -0 -- bash
220+ $ kubectl exec -it -n demo mg-git-ssh -0 -- bash
221221Defaulted container " mongodb" out of: mongodb, copy-config (init), git-sync (init)
222- mongodb@rs -0:/$ mongosh -u root -p ' tQ;c(ykM_T_EbLKS'
222+ mongodb@mg-git-ssh -0:/$ mongosh -u root -p ' tQ;c(ykM_T_EbLKS'
223223Current Mongosh Log ID: 6900695d231f7a9e99ce5f46
224224Connecting to: mongodb://< credentials> @127.0.0.1:27017/? directConnection=true& serverSelectionTimeoutMS=2000& appName=mongosh+2.5.8
225225Using MongoDB: 8.0.4
@@ -273,7 +273,7 @@ The following YAML manifest shows an example:
273273apiVersion : kubedb.com/v1
274274kind : MongoDB
275275metadata :
276- name : rs
276+ name : mg-git-pat
277277 namespace : demo
278278spec :
279279 init :
@@ -315,7 +315,7 @@ spec:
315315
316316` ` ` bash
317317kubectl create -f https://github.com/kubedb/docs/raw/{{< param "info.version" >}}/docs/examples/mongodb/initialization/git-sync-pat.yaml
318- MongoDB.kubedb.com/rs created
318+ MongoDB.kubedb.com/mg-git-pat created
319319```
320320The ` git-sync ` container has two required flags:
321321- ` --repo ` – specifies the remote Git repository to sync.
@@ -329,7 +329,7 @@ Once the database reaches the `Ready` state, you can verify the data using the m
329329``` yaml
330330$ kubectl get mg -n demo
331331NAME VERSION STATUS AGE
332- rs 8.0.4 Ready 38m
332+ mg-git-pat 8.0.4 Ready 38m
333333
334334```
335335
@@ -338,6 +338,6 @@ rs 8.0.4 Ready 38m
338338To clean up the Kubernetes resources created by this tutorial, run:
339339
340340``` bash
341- $ kubectl delete MongoDB -n demo rs
341+ $ kubectl delete MongoDB -n demo mg-git mg-git-ssh mg-git-pat
342342$ kubectl delete ns demo
343343```
0 commit comments