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

checkLimitsForResolvConf for the pod create and update events instead of checking period #64860

Merged

Conversation

wgliang
Copy link
Contributor

@wgliang wgliang commented Jun 7, 2018

What this PR does / why we need it:

  • Check for the same at pod create and update events instead of checking continuously for every 30 seconds.
  • Increase the logging level to 4 or higher since the event is not catastrophic to cluster health .

Which issue(s) this PR fixes (optional, in fixes #<issue number>(, fixes #<issue_number>, ...) format, will close the issue(s) when PR gets merged):
Fixes #64849

Special notes for your reviewer:
@ravisantoshgudimetla

Release note:

checkLimitsForResolvConf for the  pod create and update events instead of checking period

@k8s-ci-robot k8s-ci-robot added release-note Denotes a PR that will be considered when it comes time to generate release notes. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Jun 7, 2018
@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Jun 7, 2018
@wgliang wgliang force-pushed the master.kubelet-check-limit branch from 6125e67 to 5973832 Compare June 7, 2018 00:29
@@ -1975,6 +1970,10 @@ func (kl *Kubelet) handleMirrorPod(mirrorPod *v1.Pod, start time.Time) {
// HandlePodAdditions is the callback in SyncHandler for pods being added from
// a config source.
func (kl *Kubelet) HandlePodAdditions(pods []*v1.Pod) {
// Responsible for checking limits in resolv.conf
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This probably should go into loop, because we need to check for each pod that is getting added.

@@ -2013,6 +2012,10 @@ func (kl *Kubelet) HandlePodAdditions(pods []*v1.Pod) {
// HandlePodUpdates is the callback in the SyncHandler interface for pods
// being updated from a config source.
func (kl *Kubelet) HandlePodUpdates(pods []*v1.Pod) {
// Responsible for checking limits in resolv.conf
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same as above comment

Copy link
Contributor

@ravisantoshgudimetla ravisantoshgudimetla left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @wgliang. Can you please update PR as suggested.

This is more of an exploratory step. I still need confirmation from @vishh and @thockin, if this is right path to take. More context here: #29666 (comment)

@wgliang wgliang force-pushed the master.kubelet-check-limit branch from 5973832 to 4f9d204 Compare June 7, 2018 02:14
@wgliang
Copy link
Contributor Author

wgliang commented Jun 7, 2018

@ravisantoshgudimetla All right.Thanks for your review, please notify me of any updates.

@wgliang
Copy link
Contributor Author

wgliang commented Jun 7, 2018

/test pull-kubernetes-e2e-gce
/test pull-kubernetes-kubemark-e2e-gce

@ravisantoshgudimetla
Copy link
Contributor

/cc @sjenning @derekwaynecarr

@wgliang
Copy link
Contributor Author

wgliang commented Jun 9, 2018

/test pull-kubernetes-local-e2e-containerized

@tallclair tallclair removed their request for review June 20, 2018 22:49
@tallclair
Copy link
Member

/cc @kubernetes/sig-network-pr-reviews

@k8s-ci-robot k8s-ci-robot added the sig/network Categorizes an issue or PR as relevant to SIG Network. label Jun 20, 2018
@@ -156,15 +156,15 @@ func (c *Configurer) CheckLimitsForResolvConf() {
f, err := os.Open(c.ResolverConfig)
if err != nil {
c.recorder.Event(c.nodeRef, v1.EventTypeWarning, "CheckLimitsForResolvConf", err.Error())
glog.Error("CheckLimitsForResolvConf: " + err.Error())
glog.V(4).Infof("CheckLimitsForResolvConf: " + err.Error())
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why change the log level from Error to Info?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TBH, I don't think it is an error. We are anyway creating the pod. It probably would have made sense if we stopped the pod creation/update event based on this error.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i agree that since we still start the pod, its not really an error.

return
}
defer f.Close()

_, hostSearch, _, err := parseResolvConf(f)
if err != nil {
c.recorder.Event(c.nodeRef, v1.EventTypeWarning, "CheckLimitsForResolvConf", err.Error())
glog.Error("CheckLimitsForResolvConf: " + err.Error())
glog.V(4).Infof("CheckLimitsForResolvConf: " + err.Error())
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same as above.

@derekwaynecarr
Copy link
Member

this is an improvement over operational spam imho.

/approve
/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Jun 21, 2018
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: derekwaynecarr, wgliang

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jun 21, 2018
@k8s-github-robot
Copy link

Automatic merge from submit-queue (batch tested with PRs 65290, 65326, 65289, 65334, 64860). If you want to cherry-pick this change to another branch, please follow the instructions here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. release-note Denotes a PR that will be considered when it comes time to generate release notes. sig/network Categorizes an issue or PR as relevant to SIG Network. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

checkLimitsForResolvConf spamming events and logs
7 participants