mirror of
https://github.com/marcel-dempers/docker-development-youtube-series.git
synced 2025-06-06 17:01:30 +00:00
Merge pull request #171 from marcel-dempers/redis-update
non alpine shell script fix and update latest k8s
This commit is contained in:
commit
614adf003d
@ -3,7 +3,7 @@
|
|||||||
Create a cluster with [kind](https://kind.sigs.k8s.io/docs/user/quick-start/)
|
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
|
## Namespace
|
||||||
@ -38,7 +38,7 @@ kubectl -n redis logs redis-2
|
|||||||
## Test replication status
|
## Test replication status
|
||||||
|
|
||||||
```
|
```
|
||||||
kubectl -n redis exec -it redis-0 sh
|
kubectl -n redis exec -it redis-0 -- sh
|
||||||
redis-cli
|
redis-cli
|
||||||
auth a-very-complex-password-here
|
auth a-very-complex-password-here
|
||||||
info replication
|
info replication
|
||||||
|
@ -26,7 +26,7 @@ spec:
|
|||||||
if [ "$(redis-cli -h sentinel -p 5000 ping)" != "PONG" ]; then
|
if [ "$(redis-cli -h sentinel -p 5000 ping)" != "PONG" ]; then
|
||||||
echo "master not found, defaulting to redis-0"
|
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..."
|
echo "this is redis-0, not updating config..."
|
||||||
else
|
else
|
||||||
echo "updating redis.conf..."
|
echo "updating redis.conf..."
|
||||||
|
@ -26,7 +26,7 @@ spec:
|
|||||||
do
|
do
|
||||||
echo "finding master at $i"
|
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)
|
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"
|
echo "no master found"
|
||||||
MASTER=
|
MASTER=
|
||||||
else
|
else
|
||||||
|
Loading…
x
Reference in New Issue
Block a user