kubernetes-up-and-running/14-10-redis.yaml
Lachlan Evenson 3fc8603078
manifest API updates to support current Kubernetes versions
Signed-off-by: Lachlan Evenson <lachlan.evenson@gmail.com>
2023-11-14 20:14:34 -08:00

41 lines
893 B
YAML

apiVersion: apps/v1
kind: StatefulSet
metadata:
name: redis
spec:
replicas: 3
serviceName: redis
selector:
matchLabels:
app: redis
template:
metadata:
labels:
app: redis
spec:
containers:
- command: [sh, -c, source /redis-config/init.sh ]
image: redis:3.2.7-alpine
name: redis
ports:
- containerPort: 6379
name: redis
volumeMounts:
- mountPath: /redis-config
name: config
- mountPath: /redis-data
name: data
- command: [sh, -c, source /redis-config/sentinel.sh]
image: redis:3.2.7-alpine
name: sentinel
volumeMounts:
- mountPath: /redis-config
name: config
volumes:
- configMap:
defaultMode: 420
name: redis-config
name: config
- emptyDir:
name: data