Merge pull request #171 from marcel-dempers/redis-update

non alpine shell script fix and update latest k8s
This commit is contained in:
Marcel Dempers 2022-11-14 19:12:08 +11:00 committed by GitHub
commit 614adf003d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 4 additions and 4 deletions

View File

@ -3,7 +3,7 @@
Create a cluster with [kind](https://kind.sigs.k8s.io/docs/user/quick-start/)
```
kind create cluster --name redis --image kindest/node:v1.18.4
kind create cluster --name redis --image kindest/node:v1.23.5
```
## Namespace
@ -38,7 +38,7 @@ kubectl -n redis logs redis-2
## Test replication status
```
kubectl -n redis exec -it redis-0 sh
kubectl -n redis exec -it redis-0 -- sh
redis-cli
auth a-very-complex-password-here
info replication

View File

@ -26,7 +26,7 @@ spec:
if [ "$(redis-cli -h sentinel -p 5000 ping)" != "PONG" ]; then
echo "master not found, defaulting to redis-0"
if [ "$(hostname)" == "redis-0" ]; then
if [ "$(hostname)" = "redis-0" ]; then
echo "this is redis-0, not updating config..."
else
echo "updating redis.conf..."

View File

@ -26,7 +26,7 @@ spec:
do
echo "finding master at $i"
MASTER=$(redis-cli --no-auth-warning --raw -h $i -a $REDIS_PASSWORD info replication | awk '{print $1}' | grep master_host: | cut -d ":" -f2)
if [ "$MASTER" == "" ]; then
if [ "$MASTER" = "" ]; then
echo "no master found"
MASTER=
else