sighupio/gatekeeper-policy-manager

High CPU consumption

chelomontilla opened this issue · 3 comments

Hello,
I'm trying gatekeeper and found this great project to easily check config and violations.
I've deployed it in kubernetes using the helm chart and the CPU consumption is quite high with the latest relase version.
This is one pod with version 0.5.0
https://ibb.co/PYSHYHn

This is one pod with version 0.4.2
https://ibb.co/xfFfK6x

Let me know if I can collaborates somehow on solving the issue.
Thanks in advance

Hola @chelomontilla !

Nice finding, let me do some tests and I'll come back to you.

Just for my curiosity, is GPM v0.5.0 working as expected besides the high CPU usage? Do you see something in the logs? Can you try rising the log level to DEBUG and see if you find anything strange?

Thanks!

I can't replicate this locally. The CPU usage for v0.5.0 is under 1 milli core while GPM is idling:

$ kubectl top pod -n gatekeeper-system
NAME                                             CPU(cores)   MEMORY(bytes)
gatekeeper-audit-fbc6596f7-79pbj                 12m          71Mi
gatekeeper-controller-manager-5f64c4d565-pnrjg   4m           51Mi
gatekeeper-controller-manager-5f64c4d565-sl4mz   5m           61Mi
gatekeeper-controller-manager-5f64c4d565-v4gkr   9m           62Mi
gatekeeper-policy-manager-7dfbd5cf55-2n2fk       1m           107Mi

$ kubectl describe pod -n gatekeeper-system gatekeeper-policy-manager-7dfbd5cf55-2n2fk| grep image
  Normal  Pulling    45m   kubelet            Pulling image "quay.io/sighup/gatekeeper-policy-manager:v0.5.0"
  Normal  Pulled     45m   kubelet            Successfully pulled image "quay.io/sighup/gatekeeper-policy-manager:v0.5.0" in 8.142802076s

image

Is there something special about your environment @chelomontilla that we should take into account?

Hello,
I've just checked and works perfectly. The high CPU consumption was due the memory requests and limits. Requests and limits for memory were configured with 128Mi and didn't see it was reaching limits. I've reconfigured the pod resources with 156Mi requests and 192Mi and the cpu is pretty low right now.

Thanks a lot