Created
March 23, 2021 22:01
-
-
Save mwmitchell/143546096d8654c9bc4c28bb63029550 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
set -e | |
NS=$(kubectl config view --minify --output 'jsonpath={..namespace}') | |
>&2 echo "namespace: ${NS}" | |
BROKER=$(kubectl get pods | grep broker | head -n1 | cut -d" " -f1) | |
>&2 echo "broker: ${BROKER}" | |
TOPICS=$(kubectl exec -ti $BROKER -- ./bin/pulsar-admin topics list $NS/_connectors | xargs -I {} | tr -d '"') | |
>&2 echo "topics: | |
$TOPICS" | |
for topic in $TOPICS | |
do | |
>&2 echo "stats for topic: $topic" | |
kubectl exec -ti $BROKER -- ./bin/pulsar-admin topics stats $topic | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment