gcloud container clusters get-credentials dunlap-gke-private --region australia-southeast1 --project stuff-98118045375 && \
kubectl exec stuff-content-service-67b9779bcf-fqb6c --namespace devint -c stuff-content-service -it -- sh
apt-get update
apt-get install wget
wget -L -O /usr/local/bin/jattach \
https://github.com/apangin/jattach/releases/download/v1.5/jattach && \
chmod +x /usr/local/bin/jattach
java_pid=$(pidof -s java) && \
jattach $java_pid dumpheap /root/dump.hprof
- Copy from Pod to cloud shell
gcloud container clusters get-credentials dunlap-gke-private --region australia-southeast1 --project stuff-98118045375 && \
kubectl cp stuff-content-service-67b9779bcf-fqb6c:/root/dump.hprof /home/chao_yang/dump.hprof --namespace devint -c stuff-content-service