Skip to content

Commit 8cce228

Browse files
Sergey Polyarusicreated
authored andcommitted
Redis password creation
1 parent e197021 commit 8cce228

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

api/kubernetes/deploy_via_helm-dev.sh

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -144,12 +144,16 @@ helm upgrade --install ingress-nginx ingress-nginx/ingress-nginx \
144144
--values /tmp/values-ingress-nginx.yaml
145145

146146
# Redis Cluster
147-
REDIS_ADMIN_PASSWORD_VAR=${REDIS_ADMIN_PASSWORD:-$(date +%s | sha256sum | base64 | head -c 32)}
148147
helm repo add bitnami https://charts.bitnami.com/bitnami
149148

149+
REDIS_PASSWORD=${REDIS_ADMIN_PASSWORD:-$(kubectl get secret --namespace ${NAMESPACE} cosmotechredis -o jsonpath="{.data.redis-password}" | base64 -d || "")}
150+
if [[ -z $REDIS_PASSWORD ]] ; then
151+
REDIS_PASSWORD=$(date +%s | sha256sum | base64 | head -c 32)
152+
fi
153+
150154
cat <<EOF > values-redis.yaml
151155
auth:
152-
password: ${REDIS_ADMIN_PASSWORD_VAR}
156+
password: ${REDIS_PASSWORD}
153157
image:
154158
registry: ghcr.io
155159
repository: cosmo-tech/cosmotech-redis
@@ -469,7 +473,7 @@ config:
469473
host: "cosmotechredis-master.${NAMESPACE}.svc.cluster.local"
470474
port: "6379"
471475
username: "default"
472-
password: "${REDIS_ADMIN_PASSWORD_VAR}"
476+
password: "${REDIS_PASSWORD}"
473477
474478
ingress:
475479
enabled: ${COSMOTECH_API_INGRESS_ENABLED}

0 commit comments

Comments
 (0)