Skip to content

Commit ca2d5af

Browse files
committed
wrote the manifest file to run the application in kind(kubernetes in docker) cluster
1 parent bd50330 commit ca2d5af

11 files changed

+171
-1
lines changed

Diff for: cluster-config.yml

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
apiVersion: kind.x-k8s.io/v1alpha4
2+
kind: Cluster
3+
4+
nodes:
5+
- role: control-plane
6+
image: kindest/node:v1.31.2
7+
- role: worker
8+
image: kindest/node:v1.31.2
9+
- role: worker
10+
image: kindest/node:v1.31.2

Diff for: frontend/.env.docker

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
VITE_API_PATH="http://wanderlust.trainwithshubham.com:5000"
1+
VITE_API_PATH="http://localhost:5000"

Diff for: k8s/backend-deployment.yml

+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
apiVersion: apps/v1
2+
kind: Deployment
3+
4+
metadata:
5+
name: backend-deployment
6+
7+
spec:
8+
replicas: 1
9+
selector:
10+
matchLabels:
11+
app: backend
12+
template:
13+
metadata:
14+
labels:
15+
app: backend
16+
spec:
17+
containers:
18+
- name: backend
19+
image: {yourusername}/wanderlust-backend:latest
20+
ports:
21+
- containerPort: 5000
22+
env:
23+
- name: MONGODB_URI
24+
value: "mongodb://mongo-svc:27017/wanderlust"
25+
- name: REDIS_URL
26+
value: "redis://redis-svc:6379"

Diff for: k8s/backend-svc.yml

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
apiVersion: v1
2+
kind: Service
3+
4+
metadata:
5+
name: backend-svc
6+
7+
spec:
8+
selector:
9+
app: backend
10+
ports:
11+
- protocol: TCP
12+
port: 5000
13+
targetPort: 5000

Diff for: k8s/frontend-deployment.yml

+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
apiVersion: apps/v1
2+
kind: Deployment
3+
4+
metadata:
5+
name: frontend-deployment
6+
7+
spec:
8+
replicas: 1
9+
selector:
10+
matchLabels:
11+
app: frontend
12+
template:
13+
metadata:
14+
labels:
15+
app: frontend
16+
spec:
17+
containers:
18+
- name: frontend
19+
image: {yourusername}/wanderlust-frontend:latest
20+
ports:
21+
- containerPort: 5173
22+
env:
23+
- name: VITE_API_PATH
24+
value: "http://localhost:5000"

Diff for: k8s/frontend-svc.yml

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
apiVersion: v1
2+
kind: Service
3+
4+
metadata:
5+
name: frontend-svc
6+
7+
spec:
8+
selector:
9+
app: frontend
10+
ports:
11+
- protocol: TCP
12+
port: 5173
13+
targetPort: 5173

Diff for: k8s/mongo-deployment.yml

+28
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
apiVersion: apps/v1
2+
kind: Deployment
3+
4+
metadata:
5+
name: mongo-deployment
6+
7+
spec:
8+
replicas: 1
9+
selector:
10+
matchLabels:
11+
app: mongo
12+
template:
13+
metadata:
14+
labels:
15+
app: mongo
16+
spec:
17+
containers:
18+
- name: mongo
19+
image: mongo:latest
20+
ports:
21+
- containerPort: 27017
22+
volumeMounts:
23+
- name: data-pvc
24+
mountPath: /data/db
25+
volumes:
26+
- name: data-pvc
27+
persistentVolumeClaim:
28+
claimName: data-pvc

Diff for: k8s/mongo-pvc.yml

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
apiVersion: v1
2+
kind: PersistentVolumeClaim
3+
4+
metadata:
5+
name: data-pvc
6+
spec:
7+
accessModes:
8+
- ReadWriteOnce
9+
resources:
10+
requests:
11+
storage: 1Gi

Diff for: k8s/mongo-svc.yml

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
apiVersion: v1
2+
kind: Service
3+
4+
metadata:
5+
name: mongo-svc
6+
7+
spec:
8+
selector:
9+
app: mongo
10+
ports:
11+
- protocol: TCP
12+
port: 27017
13+
targetPort: 27017

Diff for: k8s/redis-deployment.yml

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
apiVersion: apps/v1
2+
kind: Deployment
3+
4+
metadata:
5+
name: redis-deployment
6+
7+
spec:
8+
replicas: 1
9+
selector:
10+
matchLabels:
11+
app: redis
12+
template:
13+
metadata:
14+
labels:
15+
app: redis
16+
spec:
17+
containers:
18+
- name: redis
19+
image: redis:7.0.5-alpine
20+
ports:
21+
- containerPort: 6379

Diff for: k8s/redis-svc.yml

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
apiVersion: v1
2+
kind: Service
3+
metadata:
4+
name: redis-svc
5+
spec:
6+
selector:
7+
app: redis
8+
ports:
9+
- protocol: TCP
10+
port: 6379
11+
targetPort: 6379

0 commit comments

Comments
 (0)