Skip to content

Commit b77e8d9

Browse files
add kubernetes file
1 parent 70263eb commit b77e8d9

File tree

2 files changed

+36
-0
lines changed

2 files changed

+36
-0
lines changed

deployment-app.yml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
apiVersion: apps/v1
2+
kind: Deployment
3+
metadata:
4+
# Unique key of the Deployment instance
5+
name: my-node-app
6+
spec:
7+
# 2 Pods should exist at all times.
8+
replicas: 2
9+
selector:
10+
matchLabels:
11+
app: node-app
12+
template:
13+
metadata:
14+
labels:
15+
# Apply this label to pods and default
16+
# the Deployment label selector to this value
17+
app: node-app
18+
spec:
19+
containers:
20+
- name: node-app
21+
# Run this image
22+
image: #put your image name which you push in dockerhub

service-app.yml

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: service-my-node-app
5+
spec:
6+
ports:
7+
- name: http
8+
port: 8080
9+
targetPort: 3000
10+
selector:
11+
# Loadbalance traffic across Pods matching
12+
# this label selector
13+
app: node-app
14+
type: LoadBalancer

0 commit comments

Comments
 (0)