Skip to content
This repository has been archived by the owner on Apr 17, 2019. It is now read-only.

Cluster-autoscaler: fix for multi-mig autoscaling #1282

Merged
merged 1 commit into from
Jun 28, 2016

Conversation

mwielgus
Copy link
Contributor

@mwielgus mwielgus commented Jun 28, 2016

@fgrzadkowski
Copy link
Contributor

@mwielgus Please explain what is the bug and how do we fix this.

return mig, nil

for _, mig := range m.migs {

Copy link
Contributor

Choose a reason for hiding this comment

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

remove empty line

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

@mwielgus
Copy link
Contributor Author

Fixes: #1283

Previously we were rising an error if we didn't have mig config for all nodes in the cluster. This error was equivalent to cluster being not in stable state and preventing CA from any scale up or scale downs. Now we raise this error only if the node has the prefix corresponding to some mig base name but the mig doesn't have this node on the list. Otherwise we assume that the node belongs to non-autoscaled mig and continue with all activities.

@piosz
Copy link
Contributor

piosz commented Jun 28, 2016

LGTM
Please create an issue and add TODO somewhere to solve this problem better as we talked offline.

@mwielgus mwielgus merged commit 5942cde into kubernetes-retired:master Jun 28, 2016
if mig.config.Project == instance.Project &&
mig.config.Zone == instance.Zone &&
strings.HasPrefix(instance.Name, mig.basename) {
if err := m.regenerateCache(); err != nil {
Copy link
Contributor

Choose a reason for hiding this comment

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

I think it'd be readable if you restructure the code such that:

  1. in a for loop check if we have any corresponding loop
  2. if we have a corresponding mig regenerate cache and return mig
  3. if don't have it return nils

@mwielgus
Copy link
Contributor Author

@fgrzadkowski sorry, too late, i will do it in a follow-up pr.

@fgrzadkowski
Copy link
Contributor

@mwielgus At the very least please answer to my question regarding base name in the first run.

mwielgus added a commit to kubernetes/autoscaler that referenced this pull request Apr 18, 2017
…node

Cluster-autoscaler: fix for multi-mig autoscaling
mwielgus added a commit to kubernetes/autoscaler that referenced this pull request Apr 18, 2017
…node

Cluster-autoscaler: fix for multi-mig autoscaling
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Cluster autoscaler requires all migs to be autoscaled
4 participants