Merge pull request #63339 from sjenning/remove-mount-success-event

Automatic merge from submit-queue (batch tested with PRs 63298, 63339). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

kubelet: volume: do not create event on mount success

xref https://github.com/openshift/origin/issues/19497

There is an argument to be made that we should not emit events on volume mount successes.  Many pods have lots of volumes that generate lots of events, especially if the pods are short lived (batch, etc). This creates load on the API server and add noise in the events.

Creating events on volume mount failures is obviously a good idea.  Seems like the absence of such events or the "Started container" event implies mount success for all volumes.

/sig node
/sig storage
/release-note-none

@smarterclayton @jsafrane @saad-ali
This commit is contained in:
Kubernetes Submit Queue 2018-05-04 04:42:06 -07:00 committed by GitHub
commit 194e640bf1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -547,12 +547,10 @@ func (og *operationGenerator) GenerateMountVolumeFunc(
return volumeToMount.GenerateError("MountVolume.SetUp failed", mountErr)
}
simpleMsg, detailedMsg := volumeToMount.GenerateMsg("MountVolume.SetUp succeeded", "")
_, detailedMsg := volumeToMount.GenerateMsg("MountVolume.SetUp succeeded", "")
verbosity := glog.Level(1)
if isRemount {
verbosity = glog.Level(4)
} else {
og.recorder.Eventf(volumeToMount.Pod, v1.EventTypeNormal, kevents.SuccessfulMountVolume, simpleMsg)
}
glog.V(verbosity).Infof(detailedMsg)