---
apiVersion: v1
kind: ConfigMap
metadata:
  name: redis-cluster-config
data:
  update-ip.sh: |
    #!/bin/sh
    sed -i -e "/myself/ s/[0-9]\{1,3\}\.[0-9]\{1,3\}\.[0-9]\{1,3\}\.[0-9]\{1,3\}/${IP}/" /data/nodes.conf
    exec "$@"
  redis.conf: |+
    cluster-enabled yes
    cluster-config-file /data/nodes.conf
    appendonly yes
