feat(loginset): add configurable deployment strategy#135
Open
faganihajizada wants to merge 1 commit intoSlinkyProject:mainfrom
Open
feat(loginset): add configurable deployment strategy#135faganihajizada wants to merge 1 commit intoSlinkyProject:mainfrom
faganihajizada wants to merge 1 commit intoSlinkyProject:mainfrom
Conversation
Signed-off-by: Fagani Hajizada <fagani.hajizada@gmail.com>
8f94e6b to
4f58e4c
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
Add a
strategyfield toLoginSetSpecto allow configuring the Kubernetes Deployment rollout strategy for Login pods.With the default Deployment strategy, rollouts can get stuck when running one Login pod per node and cluster node capacity is fully utilized. the surge pods cannot be scheduled. This change exposes the standard
appsv1.DeploymentStrategyon the LoginSet CRD so users can set e.g.maxSurge: 0/maxUnavailable: 1to avoid requiring extra node capacity during rollouts.When the field is omitted, behavior is unchanged (Kubernetes applies its defaults).
Breaking Changes
N/A
Testing Notes
go test ./internal/builder/loginbuilder/...,go test ./internal/utils/objectutils/...)make helm-unittest) including a newshould set strategytest casestrategyfieldmaxSurge: 0,maxUnavailable: 1)Additional Context
The implementation reuses
appsv1.DeploymentStrategydirectly rather than defining custom types, since LoginSet maps 1:1 to a Kubernetes Deployment. This gives users the full standard API (RollingUpdatewithmaxUnavailable/maxSurge, orRecreate).The Deployment patch path in
objectutils.SyncObjectalready copiesStrategyfrom the built object, so no changes were needed there.