Raise verbosity of kubelet_node_status messages

In standalone kubelet scenarios, `initialNode` gets called in a loop via
`syncPod` -> `GetNode` -> `initialNode`. This causes excessive log spam
from the controller attach/detach messages.
This commit is contained in:
Valentyn Boginskey 2019-12-06 10:38:18 -05:00
parent 616fce7839
commit 6b8b8491bb
No known key found for this signature in database
GPG Key ID: C29AD4D732307BFF

View File

@ -291,17 +291,17 @@ func (kl *Kubelet) initialNode(ctx context.Context) (*v1.Node, error) {
node.Annotations = make(map[string]string) node.Annotations = make(map[string]string)
} }
klog.Infof("Setting node annotation to enable volume controller attach/detach") klog.V(2).Infof("Setting node annotation to enable volume controller attach/detach")
node.Annotations[volutil.ControllerManagedAttachAnnotation] = "true" node.Annotations[volutil.ControllerManagedAttachAnnotation] = "true"
} else { } else {
klog.Infof("Controller attach/detach is disabled for this node; Kubelet will attach and detach volumes") klog.V(2).Infof("Controller attach/detach is disabled for this node; Kubelet will attach and detach volumes")
} }
if kl.keepTerminatedPodVolumes { if kl.keepTerminatedPodVolumes {
if node.Annotations == nil { if node.Annotations == nil {
node.Annotations = make(map[string]string) node.Annotations = make(map[string]string)
} }
klog.Infof("Setting node annotation to keep pod volumes of terminated pods attached to the node") klog.V(2).Infof("Setting node annotation to keep pod volumes of terminated pods attached to the node")
node.Annotations[volutil.KeepTerminatedPodVolumesAnnotation] = "true" node.Annotations[volutil.KeepTerminatedPodVolumesAnnotation] = "true"
} }