Skip to content

Commit 8265536

Browse files
committed
remove mode components, that got deprecated in kubernetes api 1.19 and got removed in 1.25
1 parent bff7b58 commit 8265536

File tree

2 files changed

+0
-35
lines changed

2 files changed

+0
-35
lines changed

account.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ rules:
2323
resources:
2424
- pods
2525
- nodes
26-
- componentstatuses
2726
- secrets
2827
- persistentvolumes
2928
verbs:

check_kubernetes.sh

Lines changed: 0 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,6 @@ usage() {
4949
tls Check for tls secrets expiration dates
5050
pvc Check for pvc utilization
5151
unboundpvs Check for unbound persistent volumes
52-
components Check for health of k8s components (deprecated in K8s 1.19+)
5352
EOF
5453

5554
exit 2
@@ -197,38 +196,6 @@ mode_nodes() {
197196
fi
198197
}
199198

200-
mode_components() {
201-
healthy_comps=""
202-
unhealthy_comps=""
203-
data="$(getJSON "get cs" "api/v1/componentstatuses")"
204-
[ $? -gt 0 ] && die "$data"
205-
components=($(echo "$data" | jq -r ".items[].metadata.name"))
206-
207-
for comp in "${components[@]}"; do
208-
healthy=$(echo "$data" | jq -r ".items[] | select(.metadata.name==\"$comp\") | \
209-
.conditions[] | select(.type==\"Healthy\") | \
210-
.status")
211-
if [ "$healthy" != True ]; then
212-
EXITCODE=2
213-
unhealthy_comps="$unhealthy_comps $comp"
214-
else
215-
healthy_comps="$healthy_comps $comp"
216-
fi
217-
done
218-
219-
BRIEF_OUTPUT="$healthy_comps"
220-
if [ $EXITCODE = 0 ]; then
221-
if [ -z "${components[*]}" ]; then
222-
OUTPUT="No components found"
223-
EXITCODE="$MISSING_EXITCODE"
224-
else
225-
OUTPUT="OK. Healthy: $healthy_comps"
226-
fi
227-
else
228-
OUTPUT="CRITICAL. Unhealthy: $unhealthy_comps; Healthy: $healthy_comps"
229-
fi
230-
}
231-
232199
mode_unboundpvs() {
233200
CRIT=${CRIT:-5}
234201
data=$(getJSON "get pv" "api/v1/persistentvolumes")
@@ -799,7 +766,6 @@ mode_jobs() {
799766

800767
case "$MODE" in
801768
(apiserver) mode_apiserver ;;
802-
(components) mode_components ;;
803769
(daemonsets) mode_daemonsets ;;
804770
(deployments) mode_deployments ;;
805771
(nodes) mode_nodes ;;

0 commit comments

Comments
 (0)