diff --git a/Makefile b/Makefile index 93ce0bc693148e8632c6920d16aef9cf26c91618..e79eb7b9b650aac935932a51525206b5cbe39985 100644 --- a/Makefile +++ b/Makefile @@ -1,5 +1,5 @@ build-redis-image: - docker build -t quay.io/opstree/redis:6.2 -f Dockerfile . + docker build -t quay.io/opstree/redis:6.2.5 -f Dockerfile . build-redis-exporter-image: docker build -t opstree/redis-exporter:1.0 -f Dockerfile.exporter . diff --git a/create-cluster.sh b/create-cluster.sh new file mode 100755 index 0000000000000000000000000000000000000000..65bdde98c7873e733a9663f3ca004eb3d9bf6211 --- /dev/null +++ b/create-cluster.sh @@ -0,0 +1,5 @@ +#!/bin/bash + +PODS="$1" + +yes yes | redis-cli --cluster create ${PODS} diff --git a/entrypoint.sh b/entrypoint.sh index 19db7f81465ddfe711fe95a5740f7394605f8e73..7890ac0fa07edf07ba930230a3592bcad6b1a878 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -5,6 +5,7 @@ set -a CLUSTER_DIRECTORY=${CLUSTER_DIRECTORY:-"/opt/redis"} PERSISTENCE_ENABLED=${PERSISTENCE_ENABLED:-"false"} DATA_DIR=${DATA_DIR:-"/data"} +EXTERNAL_CONFIG_FILE=${EXTERNAL_CONFIG_FILE:-"/etc/redis/external.conf.d/redis-external.conf"} apply_permissions() { chgrp -R 0 /etc/redis @@ -64,6 +65,10 @@ persistence_setup() { fi } +external_config() { + echo "include ${EXTERNAL_CONFIG_FILE}" >> /etc/redis/redis.conf +} + start_redis() { if [[ "${SETUP_MODE}" == "cluster" ]]; then echo "Starting redis service in cluster mode....." @@ -75,6 +80,9 @@ start_redis() { } main_function() { + if [[ -f "${EXTERNAL_CONFIG_FILE}" ]]; then + external_config + fi common_operation set_redis_password redis_mode_setup