apiVersion: v1
kind: ConfigMap
metadata:
 name: redis-config
 namespace: redis-system
data:
 update-node.sh: |
  #!/bin/sh
  REDIS_NODES="/data/nodes.conf"
  sed -i -e "/myself/ s/[0-9]\{1,3\}\.[0-9]\{1,3\}\.[0-9]\{1,3\}\.[0-9]\{1,3\}/${MY_POD_IP}/" ${REDIS_NODES}
  exec "$@"
 redis.conf: |+
  port 6379
  protected-mode no
  cluster-enabled yes
  cluster-config-file /data/nodes.conf
  cluster-migration-barrier 1
  cluster-require-full-coverage no
  cluster-node-timeout 15000
  appendonly yes
  protected-mode no
