-
Notifications
You must be signed in to change notification settings - Fork 717
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 a dynamic MinAvailable value for the default PDB #1775
Conversation
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.
Looks good overall, just few comments.
@@ -127,6 +169,20 @@ func (l StatefulSetList) DeepCopy() StatefulSetList { | |||
return result | |||
} | |||
|
|||
// WithStatefulSet returns the StatefulSetList updated to contain the given StatefulSet. | |||
// If one with the same namespace & name already exist, it will be replaced. |
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.
Typo/wording: If one already exists with the same namespace & name
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.
LGTM
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.
LGTM
Fixes #916.
Reconcile the default PDB to have its
MinAvailable
value consider the current number of Pods we expect to run, according to the StatefulSet specs.This is done right after handling nodes upscale: we work with the returned (updated) StatefulSets. Summing their replicas give us the maximum number of nodes we should have running. Some of them may not be running yet, but that's OK since it will lead to a higher MinAvailable value (-> no disruption allowed).
By default, we want to set MinAvailable to
NumberOfPods - 1
, so only one Pod can be disrupted.However, in cases such as:
we don't want any Pod to be disrupted.
Side-effects of this PR in the code:
ElasticsearchUnknownHealth
constFollow-up issues: