feat: allow to configure livekit Deployment as StatefulSet #109
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 change allows Livekit to be deployed as a StatefulSet instead of a Deployment.
Motivation
Our main setup are 3 nodes on a fixed pool. For scaling we use a different, dynamic pool and when scaling down, we of course want pods from the dynamic pool to be selected for killing. Otherwise, when scaling down the pool we will have to move a pod again. Apparently Kubernetes doesn't expose many options to select pods for scaling down, so we came up with this approach.
For a StatefulSet with scale
N
, Kubernetes guarantees to kill podN-1
when scaling down. As our base nodes will always have indices 0-2, this approach will guarantee killing a pod on the dynamic poolTBD
The current change lets the user define the deployment
kind
as a raw field, where really only two values are supported. One other way I can think of would be a booleandeployAsStatefulSet
variable that then selects the proper value in the templates.