File tree Expand file tree Collapse file tree 4 files changed +109
-2
lines changed Expand file tree Collapse file tree 4 files changed +109
-2
lines changed Original file line number Diff line number Diff line change 1+ apiVersion : apps/v1
2+ kind : Deployment
3+ metadata :
4+ name : app-deployment
5+ labels :
6+ name : app-deployment
7+ app : rest-app-java
8+ spec :
9+ replicas : 1
10+ selector :
11+ matchLabels :
12+ name : app-pod
13+ app : rest-app-java
14+ template :
15+ metadata :
16+ name : app-pod
17+ labels :
18+ name : app-pod
19+ app : rest-app-java
20+ spec :
21+ containers :
22+ - name : rest-app-java
23+ image : girijeedigunta/rest-app-java:latest
24+ ports :
25+ - containerPort : 4000
26+ ---
27+ apiVersion : v1
28+ kind : Service
29+ metadata :
30+ name : app-service
31+ labels :
32+ name : app-service
33+ app : rest-app-java
34+ spec :
35+ selector :
36+ name : app-pod
37+ app : rest-app-java
38+ type : NodePort
39+ ports :
40+ - targetPort : 4000
41+ port : 4000
42+ nodePort : 30004
Original file line number Diff line number Diff line change 1+ apiVersion : v1
2+ data :
3+ createuser.sh : |-
4+ mongo <<EOF
5+ use api
6+ db.createUser({
7+ user: "giri",
8+ pwd: "spring2020",
9+ roles:[
10+ {role: "dbAdmin", db:"api"}
11+ ]
12+ })
13+ EOF
14+ kind : ConfigMap
15+ metadata :
16+ name : mongo-initdb
17+ ---
18+ apiVersion : apps/v1
19+ kind : Deployment
20+ metadata :
21+ name : db-deployment
22+ labels :
23+ name : db-deployment
24+ app : rest-app-java
25+ spec :
26+ replicas : 1
27+ selector :
28+ matchLabels :
29+ name : db-pod
30+ app : rest-app-java
31+ template :
32+ metadata :
33+ name : db-pod
34+ labels :
35+ name : db-pod
36+ app : rest-app-java
37+ spec :
38+ containers :
39+ - image : mongo:3.2
40+ name : db
41+ ports :
42+ - containerPort : 27017
43+ volumeMounts :
44+ - name : mongo-initdb
45+ mountPath : /docker-entrypoint-initdb.d
46+ volumes :
47+ - name : mongo-initdb
48+ configMap :
49+ name : mongo-initdb
50+ ---
51+ apiVersion : v1
52+ kind : Service
53+ metadata :
54+ name : db
55+ labels :
56+ name : db-service
57+ app : rest-app-java
58+ spec :
59+ selector :
60+ name : db-pod
61+ app : rest-app-java
62+ ports :
63+ - targetPort : 27017
64+ port : 27017
Original file line number Diff line number Diff line change @@ -2,6 +2,6 @@ db.createUser({
22 user : "giri" ,
33 pwd : "spring2020" ,
44 roles :[
5- { role : "dbAdmin" , db :"springContacts " }
5+ { role : "dbAdmin" , db :"api " }
66 ]
77} )
Original file line number Diff line number Diff line change 11server.port =4000
2- spring.data.mongodb.uri =mongodb://giri:spring2020@db:27017/springContacts?authSource =admin
2+ spring.data.mongodb.uri =mongodb://giri:spring2020@db:27017/api?authSource =admin
3+ spring.data.mongodb.authentication-database =admin
You can’t perform that action at this time.
0 commit comments