• Kubernetes Submit Queue's avatar
    Merge pull request #40796 from wojtek-t/use_node_ttl_in_secret_manager · 8188c3cc
    Kubernetes Submit Queue authored
    Automatic merge from submit-queue (batch tested with PRs 40796, 40878, 36033, 40838, 41210)
    
    Implement TTL controller and use the ttl annotation attached to node in secret manager
    
    For every secret attached to a pod as volume, Kubelet is trying to refresh it every sync period. Currently Kubelet has a ttl-cache of secrets of its pods and the ttl is set to 1 minute. That means that in large clusters we are targetting (5k nodes, 30pods/node), given that each pod has a secret associated with ServiceAccount from its namespaces, and with large enough number of namespaces (where on each node (almost) every pod is from a different namespace), that resource in ~30 GETs to refresh all secrets every minute from one node, which gives ~2500QPS for GET secrets to apiserver.
    
    Apiserver cannot keep up with it very easily.
    
    Desired solution would be to watch for secret changes, but because of security we don't want a node watching for all secrets, and it is not possible for now to watch only for secrets attached to pods from my node.
    
    So as a temporary solution, we are introducing an annotation that would be a suggestion for kubelet for the TTL of secrets in the cache and a very simple controller that would be setting this annotation based on the cluster size (the large cluster is, the bigger ttl is). 
    That workaround mean that only very local changes are needed in Kubelet, we are creating a well separated very simple controller, and once watching "my secrets" will be possible it will be easy to remove it and switch to that. And it will allow us to reach scalability goals.
    
    @dchen1107 @thockin @liggitt
    8188c3cc
Name
Last commit
Last update
..
api Loading commit data...
cadvisor Loading commit data...
client Loading commit data...
cm Loading commit data...
config Loading commit data...
container Loading commit data...
custommetrics Loading commit data...
dockershim Loading commit data...
dockertools Loading commit data...
envvars Loading commit data...
events Loading commit data...
eviction Loading commit data...
images Loading commit data...
kuberuntime Loading commit data...
leaky Loading commit data...
lifecycle Loading commit data...
metrics Loading commit data...
network Loading commit data...
pleg Loading commit data...
pod Loading commit data...
prober Loading commit data...
qos Loading commit data...
remote Loading commit data...
rkt Loading commit data...
rktshim Loading commit data...
secret Loading commit data...
server Loading commit data...
status Loading commit data...
sysctl Loading commit data...
types Loading commit data...
util Loading commit data...
volumemanager Loading commit data...
BUILD Loading commit data...
OWNERS Loading commit data...
active_deadline.go Loading commit data...
active_deadline_test.go Loading commit data...
disk_manager.go Loading commit data...
disk_manager_test.go Loading commit data...
doc.go Loading commit data...
kubelet.go Loading commit data...
kubelet_cadvisor.go Loading commit data...
kubelet_cadvisor_test.go Loading commit data...
kubelet_getters.go Loading commit data...
kubelet_getters_test.go Loading commit data...
kubelet_network.go Loading commit data...
kubelet_network_test.go Loading commit data...
kubelet_node_status.go Loading commit data...
kubelet_node_status_test.go Loading commit data...
kubelet_pods.go Loading commit data...
kubelet_pods_test.go Loading commit data...
kubelet_resources.go Loading commit data...
kubelet_resources_test.go Loading commit data...
kubelet_test.go Loading commit data...
kubelet_volumes.go Loading commit data...
kubelet_volumes_test.go Loading commit data...
networks.go Loading commit data...
oom_watcher.go Loading commit data...
oom_watcher_test.go Loading commit data...
pod_container_deletor.go Loading commit data...
pod_container_deletor_test.go Loading commit data...
pod_workers.go Loading commit data...
pod_workers_test.go Loading commit data...
reason_cache.go Loading commit data...
reason_cache_test.go Loading commit data...
runonce.go Loading commit data...
runonce_test.go Loading commit data...
runtime.go Loading commit data...
util.go Loading commit data...
volume_host.go Loading commit data...