- kubernetes apiserver profiling
- 특정 kube-apiserver의 memory usage가 급증함(rss-181gb)
- 재시작 했으나 다른 노드에서 memory usage가 급증함
- 여러가지 증상들을 공유함
- kyverno의 사용량 급증
- 위 근거과 연관관계를 확인해 보기 위한 memory 사용량 profiling 필요하여 kube-apiserver의 profiling enable함
- default가 true인데 kubespray에서 hardening을 위해 false로 설정 변경
- profiling disable 상태, 이것을 enable로 변경함
sudo vi /etc/kubernetes/manifest/kube-apiserver.yaml
...
# 해당 라인 제거
--profiling=false
...kubectl proxy# 필수 바이너리 설치
brew install graphviz
go tool pprof -http=:6061 http://127.0.0.1:8001/debug/pprof/heap
go tool pprof -http=:6061 http://127.0.0.1:8001/debug/pprof/allocs