Untitled

mail@pastecode.io avatar
unknown
plain_text
10 days ago
795 B
1
Indexable
Never
apiVersion: apps/v1
kind: StatefulSet
metadata:
  name: nginx-statefullset
  labels:
    name: nginx-statefull
spec:
  serviceName: nginx-statefullset-service
  replicas: 3
  selector:
    matchLabels:
      name: nginx-statefull
  volumeClaimTemplates:
    - metadata:
        name: nginx-stateful-volume-claim
      spec:
        accessModes:
          - ReadWriteOnce
        volumeMode: Filesystem
        resources:
          requests:
            storage: 1Gi
  template:
    metadata:
      name: nginx-statefull
      labels:
        name: nginx-statefull
    spec:
      containers:
        - name: nginx-statefull
          image: nginx:latest
          volumeMounts:
            - mountPath: /app/data
              name: nginx-stateful-volume-claim
Leave a Comment