Skip to content

Commit 2d9921f

Browse files
authored
Create web.yml
1 parent bc28e06 commit 2d9921f

1 file changed

Lines changed: 46 additions & 0 deletions

File tree

Kubernetese/StatefulSets/web.yml

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
apiVersion: v1
2+
kind: Service
3+
metadata:
4+
name: nginx
5+
labels:
6+
app: nginx
7+
spec:
8+
ports:
9+
- port: 80
10+
name: web
11+
clusterIP: None
12+
selector:
13+
app: nginx
14+
---
15+
apiVersion: apps/v1
16+
kind: StatefulSet
17+
metadata:
18+
name: web
19+
spec:
20+
serviceName: "nginx"
21+
replicas: 2
22+
selector:
23+
matchLabels:
24+
app: nginx
25+
template:
26+
metadata:
27+
labels:
28+
app: nginx
29+
spec:
30+
containers:
31+
- name: nginx
32+
image: k8s.gcr.io/nginx-slim:0.8
33+
ports:
34+
- containerPort: 80
35+
name: web
36+
volumeMounts:
37+
- name: www
38+
mountPath: /usr/share/nginx/html
39+
volumeClaimTemplates:
40+
- metadata:
41+
name: www
42+
spec:
43+
accessModes: [ "ReadWriteOnce" ]
44+
resources:
45+
requests:
46+
storage: 1Gi

0 commit comments

Comments
 (0)