prole/tmp/check_jemalloc_exists.sh

24 lines
916 B
Bash

#!/usr/bin/env bash
set -euo pipefail
export KUBECONFIG=/Users/chrisfu/dev/knoe/knoe-k3s.kubeconfig
for node in gandalf.knoe.org merlin.knoe.org myrddin.knoe.org pi.knoe.org; do
safe="${node//./-}"
echo -n "==> $node: "
kubectl -n gitlab run "jv2-${safe}" \
--image=ubuntu:22.04 --restart=Never --rm --attach --quiet \
--overrides="{
\"spec\":{
\"nodeName\":\"${node}\",
\"tolerations\":[{\"operator\":\"Exists\"}],
\"volumes\":[{\"name\":\"jlib\",\"hostPath\":{\"path\":\"/opt/gitlab-jemalloc\",\"type\":\"DirectoryOrCreate\"}}],
\"containers\":[{
\"name\":\"c\",
\"image\":\"ubuntu:22.04\",
\"command\":[\"bash\",\"-c\",
\"test -f /jlib/libjemalloc.so.2 && ls -lh /jlib/libjemalloc.so.2 || echo MISSING\"],
\"volumeMounts\":[{\"name\":\"jlib\",\"mountPath\":\"/jlib\"}]
}]
}}" 2>&1 || true
done