apiVersion: v1
kind: ConfigMap
metadata:
 name: redis-config
 namespace: default
data:
 update-node.sh: |
   #!/bin/sh
   CLUSTER_CONFIG="/data/nodes.conf"
   if [ -f ${CLUSTER_CONFIG} ]; then
     if [ -z "${MY_POD_IP}" ]; then
       echo "Unable to determine Pod IP address!"
       exit 1
     fi
     echo "Updating my IP to ${MY_POD_IP} in ${CLUSTER_CONFIG}"
     sed -i.bak -e “/myself/ s/[0-9]\{1,3\}\.[0-9]\{1,3\}\.[0-9]\{1,3\}\.[0-9]\{1,3\}/${MY_POD_IP}/g” ${CLUSTER_CONFIG}
   fi
   exec "$@"
 redis.conf: |+
   port 7001
   protected-mode no
   cluster-enabled yes
   cluster-config-file nodes.conf
   cluster-node-timeout 15000
   #cluster-announce-ip ${MY_POD_IP}
   #cluster-announce-port 7001
   #cluster-announce-bus-port 17001
   logfile "/data/redis.log"
   #requirepass 9gopXAkFV2SC669W
   #masterauth 9gopXAkFV2SC669W