Add ArgoCD sync status to services check
Shows app name, sync status, health, and revision (truncated to 7 chars)
This commit is contained in:
parent
b457e45d9a
commit
f6a15745bd
1 changed files with 16 additions and 0 deletions
|
|
@ -89,6 +89,22 @@ check_service "grafana" "kubectl --context=minikube-indri -n monitoring get pods
|
|||
check_service "miniflux" "kubectl --context=minikube-indri -n miniflux get pods -l app=miniflux -o jsonpath='{.items[0].status.phase}' | grep -q Running"
|
||||
check_service "blumeops-pg" "kubectl --context=minikube-indri -n databases get pods -l cnpg.io/cluster=blumeops-pg -o jsonpath='{.items[0].status.phase}' | grep -q Running"
|
||||
|
||||
echo ""
|
||||
echo "ArgoCD app sync status:"
|
||||
printf "%-20s %-12s %-12s %s\n" "NAME" "SYNC" "HEALTH" "REVISION"
|
||||
while read -r name sync health rev; do
|
||||
# Truncate revision to first 7 chars
|
||||
short_rev="${rev:0:7}"
|
||||
if [[ "$sync" == "Synced" ]]; then
|
||||
printf "%-20s ${GREEN}%-12s${NC} %-12s %s\n" "$name" "$sync" "$health" "$short_rev"
|
||||
elif [[ "$sync" == "OutOfSync" ]]; then
|
||||
printf "%-20s ${RED}%-12s${NC} %-12s %s\n" "$name" "$sync" "$health" "$short_rev"
|
||||
FAILED=1
|
||||
else
|
||||
printf "%-20s %-12s %-12s %s\n" "$name" "$sync" "$health" "$short_rev"
|
||||
fi
|
||||
done < <(kubectl --context=minikube-indri get applications -n argocd --no-headers -o custom-columns='NAME:.metadata.name,SYNC:.status.sync.status,HEALTH:.status.health.status,REVISION:.status.sync.revision' 2>/dev/null)
|
||||
|
||||
echo ""
|
||||
if [ $FAILED -eq 0 ]; then
|
||||
echo -e "${GREEN}All services healthy!${NC}"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue