Skip to content

Instantly share code, notes, and snippets.

@fdeantoni
Last active November 24, 2021 08:20
Show Gist options
  • Select an option

  • Save fdeantoni/1c5eb0ee16688173cb45b1e0d7d15bdb to your computer and use it in GitHub Desktop.

Select an option

Save fdeantoni/1c5eb0ee16688173cb45b1e0d7d15bdb to your computer and use it in GitHub Desktop.
Kubernetes ConfigMap for Redis cluster deployment.
apiVersion: v1
kind: ConfigMap
metadata:
name: redis-cluster
namespace: redis
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\}/${POD_IP}/" ${REDIS_NODES}
exec "$@"
redis.conf: |+
cluster-enabled yes
cluster-require-full-coverage no
cluster-node-timeout 15000
cluster-config-file /data/nodes.conf
cluster-migration-barrier 1
appendonly yes
protected-mode no
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment