---
apiVersion: v1
kind: ConfigMap
metadata:
namespace: arts-system
name: redis-conf
data:
redis.conf: |
bind 0.0.0.0
protected-mode no
requirepass 123456
---
apiVersion: apps/v1
kind: StatefulSet
metadata:
namespace: arts-system
name: redis
spec:
serviceName: "redis"
replicas: 1
selector:
matchLabels:
app: redis
template:
metadata:
labels:
app: redis
spec:
containers:
- name: redis
image: redis:latest
volumeMounts:
- name: conf
mountPath: /usr/local/etc/redis/redis.conf
subPath: redis.conf
- name: redis-data
mountPath: /data
subPath: artsdata/redis
args: [ "redis-server", "/usr/local/etc/redis/redis.conf" ]
volumes:
- name: conf
configMap:
name: redis-conf
- name: redis-data
persistentVolumeClaim:
claimName: artspvc
---
apiVersion: v1
kind: Service
metadata:
namespace: arts-system
name: redis
spec:
selector:
app: redis
ports:
- protocol: TCP
port: 6379
targetPort: 6379
type: ClusterIP