Skip to content

Commit

Permalink
Merge pull request #162 from qinlaodeqingwa/patch-3
Browse files Browse the repository at this point in the history
redis期望与就绪数检测
  • Loading branch information
sixther-dc authored Jul 17, 2023
2 parents 4e24696 + 444085d commit 28d5fbb
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions probers/addon/redis/main.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ cd "$(dirname "${BASH_SOURCE[0]}")"

function sential_detect() {
## redis sential ready pod detect
REPLICAS=$(kubectl get deploy rfs-addon-redis -n default -o yaml | grep ' replicas' | awk '{if (NR > 1){print $2}}')
READY=$(kubectl get deploy rfs-addon-redis -n default -o yaml | grep readyReplicas | awk '{print $2}')
REPLICAS=$(kubectl get deploy rfs-addon-redis -n default -o json |jq '.status.replicas')
READY=$(kubectl get deploy rfs-addon-redis -n default -o json | jq '.status.readyReplicas')
if [ "$REPLICAS" != "$READY" ]; then
report-status --name=check_redis_sential --status=error --message="redis sentail ready pod not statisfied expect"
return 1
Expand All @@ -25,8 +25,8 @@ function sential_detect() {

function redis_detect() {
## redis ready pod detect
REPLICAS=$(kubectl get sts rfr-addon-redis -n default -o yaml | grep ' replicas' | awk '{if (NR > 1){print $2}}')
READY=$(kubectl get sts rfr-addon-redis -n default -o yaml | grep readyReplicas | awk '{print $2}')
REPLICAS=$(kubectl get sts rfr-addon-redis -n default -o json |jq '.status.replicas')
READY=$(kubectl get sts rfr-addon-redis -n default -o json | jq '.status.readyReplicas')
if [ "$REPLICAS" != "$READY" ]; then
report-status --name=check_redis --status=error --message="redis ready pod not statisfied expect"
return 1
Expand Down Expand Up @@ -82,4 +82,4 @@ if kubectl get cm dice-cluster-info -n default -o yaml | grep DICE_IS_EDGE: | gr
sential_detect
redis_detect
fi
fi
fi

0 comments on commit 28d5fbb

Please sign in to comment.