-
Notifications
You must be signed in to change notification settings - Fork 50
Expand file tree
/
Copy pathstatefulset.yaml
More file actions
38 lines (37 loc) · 771 Bytes
/
statefulset.yaml
File metadata and controls
38 lines (37 loc) · 771 Bytes
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
apiVersion: v1
kind: Service
metadata:
name: go-app-headless-svc
spec:
clusterIP: None # <-- Don't forget!!
selector:
app: stat-go-app
ports:
- protocol: TCP
port: 80
targetPort: 3000
---
apiVersion: apps/v1
kind: StatefulSet # <-- claim stateful set
metadata:
name: stat-go-go-app
spec:
serviceName: go-app-headless-svc # <-- Set headless service name
replicas: 2
selector:
matchLabels:
app: stat-go-app
template:
metadata:
labels:
app: stat-go-app
spec:
containers:
- name: go-go-app-container
image: kevinyan001/kube-go-go-app
resources:
limits:
memory: "64Mi"
cpu: "50m"
ports:
- containerPort: 3000