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
export POD=$1 | |
export NS=$2 | |
export PROFILER="heap" # Can also be "heap", for a heap profile | |
export DIR=$(date +"%Y%m%d%H%M")_$POD | |
mkdir -p $DIR/envoy/lib | |
kubectl exec -n "$NS" "$POD" -c istio-proxy -- curl -X POST -s "http://localhost:15000/${PROFILER}profiler?enable=y" | |
sleep 15 | |
kubectl exec -n "$NS" "$POD" -c istio-proxy -- curl -X POST -s "http://localhost:15000/${PROFILER}profiler?enable=n" | |
kubectl cp -n "$NS" "$POD":/var/lib/istio/data $DIR/envoy -c istio-proxy |