This repository has been archived by the owner on Jan 21, 2020. It is now read-only.
[Experimental] - Max resource lifetime controller #545
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR adds a simple utility that sets maximum resource lifetime by scanning and finding the oldest resource. If the oldest instance's age is greater than the set max lifetime, and that the system is in steady-state (ie, the successive counts of instances are not decreasing over time), then destroy the instance. Once the instance is destroyed, the other controller (specifically the Group plugin) will detect the change and replace the instance with a new one.
This is useful for rotating compute nodes / workers in a cluster such that no instances can exceed a certain lifetime and can be subjected to attacks. This serves as a POC for combining container and infrastructure orchestration to improve security of a compute cluster.
It's possible to add interaction with a flavor plugin to force a "Drain" of the targeted resource before destruction. It will be done in a future PR.
A new subcommand
x
for experimental is added to the CLI so that this feature is added as a subcommand of the experimental features.Signed-off-by: David Chung [email protected]