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

How to remove --force from drain command ? #47

Open
sriharim opened this issue Aug 17, 2020 · 1 comment
Open

How to remove --force from drain command ? #47

sriharim opened this issue Aug 17, 2020 · 1 comment

Comments

@sriharim
Copy link

Hi,

Due to --force drain - application is closing connection in Nginx containers ( Using all spot instances for Kubernetes cluster )

I would like to remove --force from below command in entrypoint.sh.

kubectl drain "${NODE_NAME}" --force --ignore-daemonsets --delete-local-data --grace-period="${GRACE_PERIOD}"

please let me know possible solution.

Thanks

@maksim-paskal
Copy link

--force option in drain operation (https://kubernetes.io/docs/reference/generated/kubectl/kubectl-commands#drain) only

Continue even if there are pods not managed by a ReplicationController, Job, or DaemonSet

removing --force do not resolve your problem, try to use preStop hook in nginx pod - https://blog.gruntwork.io/gracefully-shutting-down-pods-in-a-kubernetes-cluster-328aecec90d

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants