mirror of
https://github.com/marcel-dempers/docker-development-youtube-series.git
synced 2025-06-06 17:01:30 +00:00
non alpine shell script fix and update latest k8s
This commit is contained in:
parent
c484d2f39f
commit
e6aa1e60de
@ -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
|
||||
|
@ -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..."
|
||||
|
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user