--- apiVersion: apps/v1 kind: StatefulSet metadata: name: redis labels: app: redis spec: replicas: 1 serviceName: redis selector: matchLabels: app: redis template: metadata: labels: app: redis spec: initContainers: - name: init image: busybox imagePullPolicy: IfNotPresent command: ["/bin/sh", "-c", "sysctl -w net.core.somaxconn=1024"] securityContext: privileged: true containers: - name: redis image: redis/redis-stack-server:7.2.0-v0 ports: - protocol: TCP containerPort: 6379 env: - name: "REDIS_ARGS" value: "--requirepass beaconfire@123" volumeMounts: - name: redis mountPath: /data resources: limits: cpu: 1 memory: 2Gi requests: cpu: 100m memory: 256Mi livenessProbe: tcpSocket: port: 6379 initialDelaySeconds: 300 timeoutSeconds: 1 periodSeconds: 10 successThreshold: 1 failureThreshold: 3 readinessProbe: tcpSocket: port: 6379 initialDelaySeconds: 5 timeoutSeconds: 1 periodSeconds: 10 successThreshold: 1 failureThreshold: 3 volumes: - name: redis hostPath: path: /data/prod/redis affinity: nodeAffinity: requiredDuringSchedulingIgnoredDuringExecution: nodeSelectorTerms: - matchExpressions: - key: "kubernetes.io/hostname" operator: In values: - bfs-k8snode-10-2-2-8.hetzner.base.beaconfireinc.com --- apiVersion: v1 kind: Service metadata: name: redis spec: ports: - port: 6379 protocol: TCP targetPort: 6379 selector: app: redis type: ClusterIP