kubernetes-yaml/description/Workload/StatefulSet/example-nginx-slim.yml

50 lines
1.0 KiB
YAML
Raw Normal View History

2023-12-15 16:39:01 +08:00
apiVersion: apps/v1
kind: StatefulSet
metadata:
name: example-nginx-slim
namespace: demo
labels:
name: nginx
app: nginx
type: statefulset
spec:
serviceName: example-nginx-slim
replicas: 3
updateStrategy:
type: RollingUpdate
minReadySeconds: 0
selector:
matchLabels:
name: nginx
app: nginx
type: pod
template:
metadata:
labels:
name: nginx
app: nginx
type: pod
spec:
terminationGracePeriodSeconds: 10
containers:
- name: nginx
image: nginx:1.23.3-alpine-slim
ports:
- name: http
containerPort: 80
- name: https
containerPort: 443
volumeMounts:
- name: html
mountPath: /usr/share/nginx/html
volumeClaimTemplates:
- metadata:
name: html
spec:
accessModes:
- ReadWriteOnce
storageClassName: example-storage-class-nginx-html
resources:
requests:
storage: 1Gi