Skip to content

Commit

Permalink
bump k9s cli and enhanced check-k8s tool
Browse files Browse the repository at this point in the history
  • Loading branch information
ogrand committed Dec 18, 2023
1 parent 7bb358f commit 05ed48c
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ ENV ARGO_VERSION="3.5.2" \
KUBECTX_VERSION="0.9.5" \
KUSTOMIZE_VERSION="4.5.7" \
KYVERNO_VERSION="1.9.5" \
K9S_VERSION="0.28.2" \
K9S_VERSION="0.29.1" \
MONGO_SHELL_VERSION="4.0.25" \
MYSQL_SHELL_VERSION="8.0.33-1" \
OC_VERSION="4.10.25" \
Expand Down
10 changes: 8 additions & 2 deletions tools/check-k8s.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@ checkClusterResources() {
fi

#--- Check pods
result="$(kubectl get pods -A --context ${context} --no-headers=true | grep -vE "Running|Completed|ContainerCreating|Terminating" | awk '{printf "%-18s %-6s %s\n", $4, $3, $1"/"$2}' | sort)"
result="$(kubectl get pods -A --context ${context} --no-headers=true | grep -vE "Running|Completed|ContainerCreating|Terminating" | awk '{printf "%-32s %-6s %s\n", $4, $3, $1"/"$2}' | sort)"
if [ "${result}" != "" ] ; then
printf "\n%bSTATUS READY POD %b\n${result}\n" "${GREEN}" "${STD}"
printf "\n%bSTATUS READY POD %b\n${result}\n" "${GREEN}" "${STD}"
fi

#--- Check suspended/not ready flux resources (kustomization, helmchart, helmrelease, helmrepository, gitrepository)
Expand All @@ -40,6 +40,12 @@ checkClusterResources() {
if [ "${result}" != "" ] ; then
printf "\n%bREADY SUSP. KIND NAMESPACE/NAME %b\n${result}\n" "${GREEN}" "${STD}"
fi

#--- Check pending services
pending_services="$(kubectl get svc -A --context ${context} --request-timeout=1s --no-headers=true 2>&1 | grep "LoadBalancer" | grep "<none>" | awk '{print $1"/"$2}')"
if [ "${pending_services}" != "" ] ; then
printf "\n%bK8S pending services%b\n${pending_services}\n" "${GREEN}" "${STD}"
fi
fi
}

Expand Down

0 comments on commit 05ed48c

Please sign in to comment.