Skip to content

Instantly share code, notes, and snippets.

View joosangkim's full-sized avatar

Jeff(김주상) joosangkim

View GitHub Profile
@joosangkim
joosangkim / istio_mem.sh
Last active April 25, 2022 04:29
create istio memory profile
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