apiVersion: apps/v1 kind: StatefulSet metadata: name: redis namespace: database spec: serviceName: redis replicas: 1 selector: matchLabels: app: redis template: metadata: labels: app: redis spec: containers: - name: redis image: redis:7-alpine command: - redis-server - --appendonly - "yes" ports: - containerPort: 6379 volumeMounts: - name: redis-data mountPath: /data livenessProbe: exec: command: - redis-cli - ping initialDelaySeconds: 10 periodSeconds: 10 failureThreshold: 6 readinessProbe: exec: command: - redis-cli - ping initialDelaySeconds: 5 periodSeconds: 5 volumes: - name: redis-data persistentVolumeClaim: claimName: redis-pvc