mirror of
https://github.com/k3s-io/kubernetes.git
synced 2026-01-13 11:25:19 +00:00
add a flag to control the cap on images reported in node status
While I normally try to avoid adding flags, this is a short term scalability fix for v1.11, and there are other long-term solutions in the works, so we shouldn't commit to this in the v1beta1 Kubelet config. Flags are our escape hatch.
This commit is contained in:
@@ -49,9 +49,6 @@ import (
|
||||
)
|
||||
|
||||
const (
|
||||
// maxImagesInNodeStatus is the number of max images we store in image status.
|
||||
maxImagesInNodeStatus = 50
|
||||
|
||||
// maxNamesPerImageInNodeStatus is max number of names per image stored in
|
||||
// the node status.
|
||||
maxNamesPerImageInNodeStatus = 5
|
||||
@@ -721,8 +718,9 @@ func (kl *Kubelet) setNodeStatusImages(node *v1.Node) {
|
||||
return
|
||||
}
|
||||
// sort the images from max to min, and only set top N images into the node status.
|
||||
if maxImagesInNodeStatus < len(containerImages) {
|
||||
containerImages = containerImages[0:maxImagesInNodeStatus]
|
||||
if int(kl.nodeStatusMaxImages) > -1 &&
|
||||
int(kl.nodeStatusMaxImages) < len(containerImages) {
|
||||
containerImages = containerImages[0:kl.nodeStatusMaxImages]
|
||||
}
|
||||
|
||||
for _, image := range containerImages {
|
||||
|
||||
Reference in New Issue
Block a user