Skip to content
This repository has been archived by the owner on Jul 9, 2024. It is now read-only.

Add ASG tag to control terminate instance or not #35

Merged
merged 1 commit into from
Apr 16, 2019

Conversation

alantang888
Copy link
Contributor

I added ASG tag k8s-minion-manager/not-terminate to control is the manager terminate instance. If set the value to true/True/TRUE. Manager will not terminate that ASG's instances.

Also move k8s-minion-manager to a consistent

  • Testing Done:
    • Added unit tests.
    • Tested with real ASG

Also move `k8s-minion-manager` to a consistent

* Testing Done:
  * Added unit tests.
  * Tested with real ASG
@@ -60,6 +60,7 @@ Then, `kubectl apply -f deploy/mm.yaml`.
* "use-spot": This will make the minion-manager intelligently use spot instances in the ASG
* "no-spot": This will make the minion-manager always use on-demand instances in the ASG. This is useful when someone wants to temporarily switch to on-demand instances and at a later point switch to "use-spot"
* Note that after changing the tag value, it may take upto 5 minutes for the minion-manager pod to see the changes and make them take effect.
* The "k8s-minion-manager/not-terminate" tag can control ASG instance terminate by the minion-manager. If you want to control when to terminate ASG instances. You can set this tag to `true`. If not set or other value will disable this feature.
Copy link
Collaborator

Choose a reason for hiding this comment

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

Is this tag for the ASG or for specific instances in the ASG? If the tag is for the ASG itself, better option would be to simply set the value of the k8s-minion-manager tag to no-spot. That way, the instances in the ASG will use on-demand instances and never switch (therefore, never terminate) instances.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I want to have chance to keep an instances running instead of auto terminated. When I use use-spot. And there have change MM changed launch config to on-demand. Then switch back to spot.

Copy link
Collaborator

Choose a reason for hiding this comment

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

So, the tag is for each instance, correct?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

No, it is set on ASG.
If change the k8s-minion-manager from use-spot to no-spot. Then MM will terminate all spot instance one by one. And vice versa.
So that I want to add a tag on ASG. Let MM know if this tag exist. Don't terminate instance for this ASG.
When that tag is removed or value changed. MM will handle that ASG instance termination.

@shrinandj shrinandj merged commit e82f1bf into keikoproj:master Apr 16, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants