注意:本文档没有亲自试验过,仅供参考。
步骤
先看 kuber-apiserver 的启动参数:
1
2
3
4
5
6
7
|
docker inspect kube-apiserver
...
"Args": [
...
"--profiling=false",
...
]
|
可以看到 profiling 没有开,因此 /debug/pprof
接口是没有办法调用的。
编辑 RKE cluster.yaml,把 profiling 打开:
1
2
3
4
5
|
services:
kube-api:
...
extra_args:
profiling: "true"
|
然后使用 RKE 升级集群:
1
|
rke up --config ./rancher-cluster.yml
|
然后启动(注意 kube_config_cluster.yml
是 RKE 安装 K8S 之后生成的):
1
2
|
kubectl --kubeconfig kube_config_cluster.yml proxy
Starting to serve on 127.0.0.1:8001
|
访问浏览器 http://localhost:8001/debug/pprof
参考文档
评论