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

set default GracePeriodSeconds to -1 when draining nodes #5143

Merged
merged 1 commit into from May 17, 2018

Conversation

Projects
None yet
5 participants
@rajatjindal
Copy link
Contributor

commented May 11, 2018

the default value for GracePeriodSeconds in kubectl drain is set to -1, therefore the drain node gives pod time to terminate gracefully, but through kops its set to use default int value 0, and therefore pods are terminated immediately.

disclaimer: I've not tested it, and plan to test it tonight by triggering a rolling update on one IG for my cluster, but theoretically this seems to be the reason why our pods are not getting any graceful termination time as reported by our users.

Please let me know if this does not make sense.

@mikesplain

This comment has been minimized.

Copy link
Member

commented May 11, 2018

/ok-to-test

@rajatjindal

This comment has been minimized.

Copy link
Contributor Author

commented May 11, 2018

I just got confirmation from our user that this indeed fixes the problem for them. Kindly review and let me know if this is acceptable.

@rajatjindal

This comment has been minimized.

Copy link
Contributor Author

commented May 11, 2018

/assign @chrislovecnm

Force: true,
DeleteLocalData: true,
ErrOut: errOut,
GracePeriodSeconds: -1,

This comment has been minimized.

Copy link
@chrislovecnm

chrislovecnm May 14, 2018

Member

Where is this documented how this works? I know it may fix your problem, but we need to understand the interface more.

@rajatjindal

This comment has been minimized.

Copy link
Contributor Author

commented May 14, 2018

Hi Chris,

thanks for looking into it.

This is as per documentation here: https://github.com/kubernetes/kubernetes/blob/c9591ee6cb13f2f0e6c7431873f0ac2c1a559c37/pkg/kubectl/cmd/drain.go#L223

and its usage here:

https://github.com/kubernetes/kubernetes/blob/c9591ee6cb13f2f0e6c7431873f0ac2c1a559c37/pkg/kubectl/cmd/drain.go#L523

Please let me know if I should get more information on this.

Thanks
Rajat Jindal

@chrislovecnm

This comment has been minimized.

Copy link
Member

commented May 17, 2018

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm label May 17, 2018

@k8s-ci-robot

This comment has been minimized.

Copy link
Contributor

commented May 17, 2018

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: chrislovecnm, rajatjindal

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 merged commit 80c692f into kubernetes:master May 17, 2018

11 checks passed

cla/linuxfoundation rajatjindal authorized
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
pull-kops-bazel-build Job succeeded.
Details
pull-kops-bazel-test Job succeeded.
Details
pull-kops-e2e-kubernetes-aws Job succeeded.
Details
pull-kops-verify-bazel Job succeeded.
Details
pull-kops-verify-boilerplate Job succeeded.
Details
pull-kops-verify-gofmt Job succeeded.
Details
pull-kops-verify-govet Job succeeded.
Details
pull-kops-verify-packages Job succeeded.
Details
tide In merge pool.
Details

@rajatjindal rajatjindal deleted the rajatjindal:fix-drain branch May 30, 2018

@johanneswuerbach

This comment has been minimized.

Copy link
Contributor

commented Jun 21, 2018

@justinsb any chance to get this into a 1.9 patch release? Without this k8s upgrades are for us way more disruptive then hoped :-(

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.