|
34 | 34 | - [`spec.placement.clusters` is not provided, `spec.placement.clusterSelector` is provided but empty](#specplacementclusters-is-not-provided-specplacementclusterselector-is-provided-but-empty)
|
35 | 35 | - [`spec.placement.clusters` is not provided, `spec.placement.clusterSelector` is provided and not empty](#specplacementclusters-is-not-provided-specplacementclusterselector-is-provided-and-not-empty)
|
36 | 36 | - [Troubleshooting](#troubleshooting)
|
| 37 | + - [Profiling](#profiling) |
37 | 38 | - [Cleanup](#cleanup)
|
38 | 39 | - [Deployment Cleanup](#deployment-cleanup)
|
39 | 40 | - [Namespace-scoped control plane](#namespace-scoped-control-plane)
|
@@ -815,6 +816,40 @@ It may also be useful to inspect the KubeFed controller log as follows:
|
815 | 816 | kubectl logs deployment/kubefed-controller-manager -n kube-federation-system
|
816 | 817 | ```
|
817 | 818 |
|
| 819 | +## Profiling |
| 820 | + |
| 821 | +[pprof](https://golang.org/pkg/net/http/pprof/) is a tool for visualization and |
| 822 | +analysis of profiling data. |
| 823 | + |
| 824 | +To gather kubefed profiling data you need to access the kubefed |
| 825 | +controller-manager at port 8080. You can setup port forward to access the pprof |
| 826 | +debug endpoints of that pod. |
| 827 | + |
| 828 | +```bash |
| 829 | +kubectl -n kube-federation-system port-forward pod/kubefed-controller-manager-XXXXX 8080:8080 |
| 830 | +``` |
| 831 | + |
| 832 | +In another terminal you can collect the pprof profiles using curl. |
| 833 | + |
| 834 | +Collect goroutine pprof as well as stack trace report and full stack traces. |
| 835 | +```bash |
| 836 | +
|
| 837 | +curl localhost:8080/debug/pprof/goroutine -o goroutine.pprof |
| 838 | +curl localhost:8080/debug/pprof/goroutine?debug=1 -o goroutine-debug-1.pprof |
| 839 | +curl localhost:8080/debug/pprof/goroutine?debug=2 -o goroutine-debug-2.pprof |
| 840 | +``` |
| 841 | + |
| 842 | + |
| 843 | +Collect 30s cpu profile |
| 844 | +```bash |
| 845 | +curl localhost:8080/debug/pprof/profile -o cpu-profile.pprof |
| 846 | +``` |
| 847 | + |
| 848 | +Collect memory heap profile |
| 849 | +```bash |
| 850 | +curl localhost:8080/debug/pprof/heap -o heap.pprof |
| 851 | +``` |
| 852 | + |
818 | 853 | ## Cleanup
|
819 | 854 |
|
820 | 855 | ### Deployment Cleanup
|
|
0 commit comments