-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdeployment-pod-service.yaml
52 lines (52 loc) · 1.06 KB
/
deployment-pod-service.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
# Create Namespace
apiVersion: v1
kind: Namespace
metadata:
name: deployment-pod-service-namespace
---
# Create Deployment with 2 Replicas Pod
apiVersion: apps/v1
kind: Deployment
metadata:
name: deployment-pod-app
namespace: deployment-pod-service-namespace
spec:
selector:
matchLabels:
pod-type: deployment-pod
app-name: deploy
replicas: 2
template:
metadata:
labels:
pod-type: deployment-pod
app-name: deploy
spec:
containers:
- name: app
image: alpine
command: ["sleep", "3600"]
resources:
limits:
memory: "100Mi"
cpu: "100m"
requests:
memory: "50Mi"
cpu: "50m"
ports:
- containerPort: 8080
imagePullPolicy: IfNotPresent
restartPolicy: Always
---
# Create Service
apiVersion: v1
kind: Service
metadata:
name: deploy-service
namespace: deployment-pod-service-namespace
spec:
selector:
app-name: deploy
ports:
- port: 8080
targetPort: 8080