--- apiVersion: v1 kind: Service metadata: name: redis labels: app: redis spec: selector: app: redis ports: - name: redis port: 6379 targetPort: redis --- apiVersion: apps/v1 kind: StatefulSet metadata: name: redis spec: selector: matchLabels: app: redis serviceName: redis replicas: $NB_REPLICAS template: metadata: labels: app: redis spec: containers: - name: redis image: docker.io/redis:latest ports: - name: redis containerPort: 6379 volumeMounts: - name: data mountPath: /data/ volumes: - name: data emptyDir: {}