Skip to content

feat(loginset): add configurable deployment strategy#135

Open
faganihajizada wants to merge 1 commit intoSlinkyProject:mainfrom
faganihajizada:loginset-stretegy
Open

feat(loginset): add configurable deployment strategy#135
faganihajizada wants to merge 1 commit intoSlinkyProject:mainfrom
faganihajizada:loginset-stretegy

Conversation

@faganihajizada
Copy link
Contributor

Summary

Add a strategy field to LoginSetSpec to 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.DeploymentStrategy on the LoginSet CRD so users can set e.g. maxSurge: 0 / maxUnavailable: 1 to 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

  • Unit tests pass (go test ./internal/builder/loginbuilder/..., go test ./internal/utils/objectutils/...)
  • Helm unit tests pass (make helm-unittest) including a new should set strategy test case
  • Verified end-to-end on a local kind cluster:
    • LoginSet CR correctly stores the strategy field
    • Underlying Deployment reflects the configured strategy (maxSurge: 0, maxUnavailable: 1)
    • Rollout restart confirmed zero-surge behavior: old pod terminated before new pod created

Additional Context

The implementation reuses appsv1.DeploymentStrategy directly rather than defining custom types, since LoginSet maps 1:1 to a Kubernetes Deployment. This gives users the full standard API (RollingUpdate with maxUnavailable/maxSurge, or Recreate).

The Deployment patch path in objectutils.SyncObject already copies Strategy from the built object, so no changes were needed there.

Signed-off-by: Fagani Hajizada <fagani.hajizada@gmail.com>
@vivian-hafener vivian-hafener self-assigned this Mar 6, 2026
@vivian-hafener vivian-hafener self-requested a review March 6, 2026 20:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants