@@ -49,7 +49,6 @@ usage() {
49
49
tls Check for tls secrets expiration dates
50
50
pvc Check for pvc utilization
51
51
unboundpvs Check for unbound persistent volumes
52
- components Check for health of k8s components (deprecated in K8s 1.19+)
53
52
EOF
54
53
55
54
exit 2
@@ -197,38 +196,6 @@ mode_nodes() {
197
196
fi
198
197
}
199
198
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
-
232
199
mode_unboundpvs () {
233
200
CRIT=${CRIT:- 5}
234
201
data=$( getJSON " get pv" " api/v1/persistentvolumes" )
@@ -799,7 +766,6 @@ mode_jobs() {
799
766
800
767
case " $MODE " in
801
768
(apiserver) mode_apiserver ;;
802
- (components) mode_components ;;
803
769
(daemonsets) mode_daemonsets ;;
804
770
(deployments) mode_deployments ;;
805
771
(nodes) mode_nodes ;;
0 commit comments