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
WIP: Attempt at cordon but no drain #45
Conversation
Codecov Report
@@ Coverage Diff @@
## master #45 +/- ##
==========================================
- Coverage 85.41% 84.01% -1.41%
==========================================
Files 6 6
Lines 288 294 +6
==========================================
+ Hits 246 247 +1
- Misses 40 44 +4
- Partials 2 3 +1
Continue to review full report at Codecov.
|
Thanks for the contribution @jaxxstorm! I'm on vacation for another two weeks, but will take a closer look when I'm back home if @jacobstr doesn't beat me to it. |
Any thoughts here? |
@jaxxstorm sorry for the slow response here. Thanks for this contribution - just a few comments. |
As per feedback: - Change flag name to drain (automatically adds `--no-drain` flag) - Add drain flag to NewAPICordonDrainer - Improve drain function to remove function wrap
Hi, I've implemented the suggested changes and have an open question about the |
@@ -163,6 +174,12 @@ func (d *APICordonDrainer) Cordon(n *core.Node) error { | |||
|
|||
// Drain the supplied node. Evicts the node of all but mirror and DaemonSet pods. | |||
func (d *APICordonDrainer) Drain(n *core.Node) error { | |||
|
|||
// Do nothing | |||
if !d.withDrain { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This file just needs a gofmt run on it.
Draino can be run in dry run mode using the `--dry-run` flag. | ||
|
||
### Cordon Only | ||
Draino can also optionally be run in a mode where the nodes are only cordoned, and not drained. This can be achieved by using the `--no-drain` flag |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Period at the end of this sentence.
It would be nice to see this finished up and merged. |
This is an attempt at setting an option which will cordon the nodes, but not drain them.
Some workloads, for example workloads that use a lot of
kind: Job
will eventually have nodes cleared out on their own. By specifying a flag--no-drain
and using this method, we can cordon the nodes so new workloads don't appear.I'm not the best Go programmer, so any feedback or suggestions would be greatly welcomed.