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