Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[prototype] Make apiserver admission plugins retrieve k8s objects dir… #121979

Closed
wants to merge 1 commit into from

Commits on Nov 21, 2023

  1. [prototype] Make apiserver admission plugins retrieve k8s objects dir…

    …ectly from its storage
    
    Before this commit, admission plugins use informers to sync k8s objects and as
    a result, there is a copy of k8s object in kube-apiserver. This commit allows
    referencing k8s objects from storage without actually copying them, which
    reduces significant memory usage in both serving and storage.
    
    Also observed a visible amount of CPU usage reduced in kube-apiserver
    startup as the admission plugins didn't need to fetch objects from the
    HTTP endpoints, nor did kube-apiserver need to serve.
    
    Memory measurements and comparisons
    
    ```
    kubectl get --raw /metrics | grep go_memstats_alloc_bytes
    ```
    
    Origin:
    
    Peak memory alloc: go_memstats_alloc_bytes 7.16614552e+08
    Stablized memory alloc: go_memstats_alloc_bytes 4.2804752e+08
    
    Optimized:
    
    Peak memory alloc: go_memstats_alloc_bytes 3.46012872e+08
    Stablized memory alloc: go_memstats_alloc_bytes 2.82520896e+08
    linxiulei committed Nov 21, 2023
    Configuration menu
    Copy the full SHA
    0d8c14b View commit details
    Browse the repository at this point in the history