Skip to content

Commit 11ca5f0

Browse files
authored
Merge pull request #28530 from Shubham82/Add-MongoDB-yamls
Add MongoDB deployment and service.
2 parents f466d7f + 21ca9a2 commit 11ca5f0

File tree

3 files changed

+47
-2
lines changed

3 files changed

+47
-2
lines changed

content/en/docs/tasks/access-application-cluster/port-forward-access-application-cluster.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ for database debugging.
3131
1. Create a Deployment that runs MongoDB:
3232

3333
```shell
34-
kubectl apply -f https://k8s.io/examples/application/guestbook/mongo-deployment.yaml
34+
kubectl apply -f https://k8s.io/examples/application/mongodb/mongo-deployment.yaml
3535
```
3636

3737
The output of a successful command verifies that the deployment was created:
@@ -84,7 +84,7 @@ for database debugging.
8484
2. Create a Service to expose MongoDB on the network:
8585
8686
```shell
87-
kubectl apply -f https://k8s.io/examples/application/guestbook/mongo-service.yaml
87+
kubectl apply -f https://k8s.io/examples/application/mongodb/mongo-service.yaml
8888
```
8989
9090
The output of a successful command verifies that the Service was created:
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
apiVersion: apps/v1
2+
kind: Deployment
3+
metadata:
4+
name: mongo
5+
labels:
6+
app.kubernetes.io/name: mongo
7+
app.kubernetes.io/component: backend
8+
spec:
9+
selector:
10+
matchLabels:
11+
app.kubernetes.io/name: mongo
12+
app.kubernetes.io/component: backend
13+
replicas: 1
14+
template:
15+
metadata:
16+
labels:
17+
app.kubernetes.io/name: mongo
18+
app.kubernetes.io/component: backend
19+
spec:
20+
containers:
21+
- name: mongo
22+
image: mongo:4.2
23+
args:
24+
- --bind_ip
25+
- 0.0.0.0
26+
resources:
27+
requests:
28+
cpu: 100m
29+
memory: 100Mi
30+
ports:
31+
- containerPort: 27017
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
apiVersion: v1
2+
kind: Service
3+
metadata:
4+
name: mongo
5+
labels:
6+
app.kubernetes.io/name: mongo
7+
app.kubernetes.io/component: backend
8+
spec:
9+
ports:
10+
- port: 27017
11+
targetPort: 27017
12+
selector:
13+
app.kubernetes.io/name: mongo
14+
app.kubernetes.io/component: backend

0 commit comments

Comments
 (0)