Skip to content

Commit 6c9bcef

Browse files
committed
2 new admin shell aliases to check the cluster
1 parent e622639 commit 6c9bcef

File tree

1 file changed

+33
-0
lines changed

1 file changed

+33
-0
lines changed

aliases

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -336,3 +336,36 @@ function web-logs-tail() {
336336
tail -f /var/log/caddy/access.log | jq -r '"\(.request.host)\(.request.uri)\t\t\(.request.headers."User-Agent")"'
337337
)
338338
}
339+
340+
341+
function nom-deploys-check() {
342+
# admin script that more thoroughly finds and prints out any deploys with any kind of issues
343+
nomad system gc
344+
sleep 1.5
345+
clear -x
346+
echo 'Task Group Version Desired Status Created Modified'
347+
( for i in $(nomad node status |grep -Fv Eligibility |cut -f1 -d' '); do
348+
nomad node status -short $i \
349+
|grep -E '^Name|run' \
350+
|grep -Fv running \
351+
|perl -pe 's/^[^ ]+ +[^ ]+ +//'
352+
done ) \
353+
|grep -Ev '^[^ ]+$' -B1
354+
# NOTE:👆🏽 final grep is to show any nomad server names (that have deploys with issues)
355+
356+
line
357+
358+
nomad status | grep -Fv running
359+
}
360+
361+
362+
function nom-supervisor-status () {
363+
# admin script that shows the supervisord status of all jobs in each HinD cluster's VMs
364+
# requires `ssh` access to each VM that is running HinD
365+
for NODE in $(nomad node status -t '{{range .}}{{.Name}}{{"\n"}}{{end}}' |sort |grep -E .); do
366+
echo "=== $NODE ==="
367+
ssh $NODE 'sudo podman exec -it hind sh -c "supervisorctl status"'
368+
echo
369+
done
370+
}
371+

0 commit comments

Comments
 (0)