java-tutorials/kubernetes-modules/Deployment_Vs_StatefulSet/StatefulSets/StatefulSet.yaml

29 lines
518 B
YAML
Raw Normal View History

2021-06-11 00:08:03 -04:00
apiVersion: apps/v1
kind: StatefulSet
metadata:
name: web
spec:
selector:
matchLabels:
app: nginx
serviceName: "nginx"
replicas: 3
template:
metadata:
labels:
app: nginx
spec:
containers:
- name: nginx
image: nginx
ports:
- containerPort: 80
name: web
volumeMounts:
- name: www
mountPath: /usr/share/nginx/html
volumes:
- name: www
persistentVolumeClaim:
claimName: myclaim