Grab a kubeconfig file pointing to the Rancher upstream cluster, then copypaste:
export KUBECONFIG=/path/to/the/upstream_cluster.yaml
for pod in $(kubectl get pods -n cattle-system --no-headers -l app=rancher | cut -d ' ' -f1); do
echo Collecting 30s worth of profile data for $pod...
kubectl exec -n cattle-system $pod -- curl -s http://localhost:6060/debug/pprof/profile -o profile
kubectl cp cattle-system/${pod}:profile ./${pod}-profile
echo saved ${pod}-profile
done
echo Opening browser on ${pod}-profile...
go tool pprof -http=: ./${pod}-profile