diff --git a/addons/redis/Chart.yaml b/addons/redis/Chart.yaml index 7b3fed541..2a6ea4b2d 100644 --- a/addons/redis/Chart.yaml +++ b/addons/redis/Chart.yaml @@ -4,7 +4,7 @@ description: "Redis is an in-memory database that persists on disk. The data mod type: application -version: 0.7.0 +version: 0.8.0 appVersion: "7.0.6" diff --git a/addons/redis/scripts/redis-sentinel-start.sh b/addons/redis/scripts/redis-sentinel-start.sh index 5ef80f9ee..eed18ef4f 100755 --- a/addons/redis/scripts/redis-sentinel-start.sh +++ b/addons/redis/scripts/redis-sentinel-start.sh @@ -13,11 +13,15 @@ set -ex {{- $primary_svc := printf "%s-%s.%s.svc" $clusterName $redis_component.name $namespace }} echo "Waiting for redis service {{ $primary_svc }} to be ready..." if [ ! -z "$REDIS_DEFAULT_PASSWORD" ]; then - until redis-cli -h {{ $primary_svc }} -p 6379 -a $REDIS_DEFAULT_PASSWORD ping; do sleep 1; done + timeout 300 sh -c 'until redis-cli -h {{ $primary_svc }} -p 6379 -a $REDIS_DEFAULT_PASSWORD ping; do sleep 2; done' else - until redis-cli -h {{ $primary_svc }} -p 6379 ping; do sleep 1; done + timeout 300 sh -c 'until redis-cli -h {{ $primary_svc }} -p 6379 ping; do sleep 1; done' fi -echo "redis service ready, Starting sentinel..." +if [ $? -ne 0 ]; then + echo "Redis service is not ready, exiting..." + exit 1 +fi +echo "Redis service ready, Starting sentinel..." echo "sentinel announce-ip $KB_POD_FQDN" >> /etc/sentinel/redis-sentinel.conf exec redis-server /etc/sentinel/redis-sentinel.conf --sentinel echo "Start sentinel succeeded!" \ No newline at end of file diff --git a/addons/redis/scripts/redis-start.sh b/addons/redis/scripts/redis-start.sh index 747e503a8..ec9844743 100755 --- a/addons/redis/scripts/redis-start.sh +++ b/addons/redis/scripts/redis-start.sh @@ -21,7 +21,7 @@ if [ ! -z "$REDIS_SENTINEL_PASSWORD" ]; then fi if [ ! -z "$REDIS_DEFAULT_PASSWORD" ]; then echo "protected-mode yes" >> /etc/redis/redis.conf - echo "user default on allcommands allkeys >$REDIS_DEFAULT_PASSWORD" >> /data/users.acl + echo "user default on >$REDIS_DEFAULT_PASSWORD ~* &* +@all " >> /data/users.acl else echo "protected-mode no" >> /etc/redis/redis.conf fi diff --git a/addons/redis/templates/clusterdefinition.yaml b/addons/redis/templates/clusterdefinition.yaml index 100a4cad0..7b3a37c46 100644 --- a/addons/redis/templates/clusterdefinition.yaml +++ b/addons/redis/templates/clusterdefinition.yaml @@ -260,6 +260,8 @@ spec: - name: redis-sentinel workloadType: Stateful characterType: redis + statefulSpec: + updateStrategy: BestEffortParallel service: ports: - name: redis-sentinel