Added sumo-mac
This commit is contained in:
1 parent
d83255dc91
commit
c8aaf743b9
21 files changed
+286
-1
No files matched your search
Executable
+25
@@ -0,0 +1,25 @@
|
||||
|
||||
# pod=analytics-84d4bff6c-2fzj9
|
||||
namespace=us2-analytics
|
||||
|
||||
echo "getting pods..."
|
||||
pods=`kubectl get pods -n $namespace`
|
||||
totalpods=$(echo $pods | wc -l)
|
||||
totalpods="$((totalpods-1))"
|
||||
echo $pods | awk "NR==1" | awk '$0=" "$0'
|
||||
echo $pods | awk "NR>1" | awk '$0=NR") "$0'
|
||||
echo "> Please select one of the pods, enter a number between 1 and $totalpods"
|
||||
read pod_num
|
||||
|
||||
case ${pod_num#[-+]} in
|
||||
*[!0-9]* | '') echo "Must be an integer." ;;
|
||||
esac
|
||||
|
||||
pod=$(kubectl get pods -n $namespace | awk {'print $1}' | awk -v pod_num=$pod_num 'NR==pod_num+1')
|
||||
echo "Getting memory dump for $pod - Continue? [ANY KEY]..."
|
||||
read
|
||||
kubectl exec -n $namespace $pod -c analytics-assembly -- jcmd Bootstrap GC.heap_dump /tmp/$pod.hprof
|
||||
kubectl exec -n $namespace $pod -c analytics-assembly -- gzip /tmp/$pod.hprof
|
||||
kubectl -n $namespace cp -c analytics-assembly $pod:/tmp/$pod.hprof.gz $pod.hprof.gz
|
||||
|
||||
kubectl exec -n $namespace $pod -c analytics-assembly -it -- /bin/bash
|
||||
Reference in new issue
Block a user