Skip to content

Commit

Permalink
Set ALLOW_EMPTY_PASSWORD=no for Redis and set auth.password for upgrade
Browse files Browse the repository at this point in the history
  • Loading branch information
warrenchristian1telus committed Jan 10, 2025
1 parent e7b230b commit a145e90
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 5 deletions.
13 changes: 13 additions & 0 deletions config/redis/redis-cluster-values.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
global:
redis:
password: ""
replica:
replicaCount: 3
persistence:
enabled: true
size: 50Mi
sentinel:
enabled: true
persistence:
enabled: true
size: 20Mi
6 changes: 3 additions & 3 deletions config/redis/sentinel_tunnel.remote.config.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"Sentinels_addresses_list":[
"redis-node-0:26379",
"redis-node-1:26379",
"redis-node-2:26379"
"redis-node-0.redis-headless.e66ac2-dev.svc.cluster.local:26379",
"redis-node-1.redis-headless.e66ac2-dev.svc.cluster.local:26379",
"redis-node-2.redis-headless.e66ac2-dev.svc.cluster.local:26379"
],
"Databases":[
{
Expand Down
2 changes: 1 addition & 1 deletion config/redis/values.yml
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ securityContext:
# value: "10000"

## Use password authentication
usePassword: true
usePassword: false
## Redis password (both master and slave)
## Defaults to a random 10-character alphanumeric string if not set and usePassword is true
## ref: https://github.com/bitnami/bitnami-docker-redis#setting-the-server-password-on-first-run
Expand Down
3 changes: 2 additions & 1 deletion openshift/scripts/deploy-redis-sentinel.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ cat <<EOF > values.yaml
global:
redis:
password: "$SECRET_REDIS_PASSWORD"
requirepass "$SECRET_REDIS_PASSWORD"
replica:
replicaCount: $REDIS_REPLICAS
persistence:
Expand All @@ -39,7 +40,7 @@ EOF
if helm list -q | grep -q "^$REDIS_NAME$"; then
echo "Helm deployment found. Updating..."

helm_upgrade_response=$(helm upgrade $REDIS_NAME $REDIS_HELM_CHART --reuse-values -f values.yaml)
helm_upgrade_response=$(helm upgrade $REDIS_NAME $REDIS_HELM_CHART --set auth.password="$SECRET_REDIS_PASSWORD" --reuse-values -f values.yaml)

# Output the response for debugging purposes
echo "1. $helm_upgrade_response"
Expand Down

0 comments on commit a145e90

Please sign in to comment.