Skip to content

feat: add minReadySeconds and deploymentStrategy passthrough - #327

Open
rwo-trackunit wants to merge 3 commits into
openfga:mainfrom
rwo-trackunit:rwo/deployment-strategy-min-ready-seconds
Open

feat: add minReadySeconds and deploymentStrategy passthrough#327
rwo-trackunit wants to merge 3 commits into
openfga:mainfrom
rwo-trackunit:rwo/deployment-strategy-min-ready-seconds

Conversation

@rwo-trackunit

@rwo-trackunit rwo-trackunit commented Jul 10, 2026

Copy link
Copy Markdown

Description

The chart's Deployment currently always uses the Kubernetes default rollout behavior and exposes no knobs to control it. Because OpenFGA pods typically become Ready within seconds, a rolling update replaces every replica almost simultaneously — so all pods start with cold in-memory caches (check query cache, iterator cache) at the same moment, causing a datastore load spike right after every deployment.

This PR exposes two standard Deployment fields as chart values:

  • minReadySeconds (default: unset) — rendered as spec.minReadySeconds when set. Lets operators space out pod replacement so each new pod serves (and warms its cache with) live traffic before the next pod is replaced, keeping at most one cold-cache pod in rotation at a time.
  • deploymentStrategy (default: {}) — passed through verbatim as spec.strategy when set. Lets operators tune maxSurge/maxUnavailable or use Recreate.

Both are optional and omitted by default, so rendered manifests are unchanged for existing users.

Changes

  • templates/deployment.yaml: render minReadySeconds (guarded with ne ... nil so an explicit 0 renders, matching the existing falsy-numeric handling) and strategy
  • values.yaml + values.schema.json: document the new values (minReadySeconds as integer|null, deploymentStrategy as object)
  • tests/deployment_strategy_test.yaml: helm-unittest coverage — unset (omitted), 0, positive value, RollingUpdate passthrough, Recreate
  • Chart.yaml: bump version to 0.3.11

🤖 Generated with Claude Code

Real life implications

For our usage, we're seeing connection storm at the time of deployment. To be fair, the same could happen under extreme heavy load, where every single call misses the cache. So this is supporting cost-saving, where we rightsize the deployment based on actual usage, but that "actual usage" becomes worst case during deployments.
deploymentStrategy is only added as due-diligence, for future possible deployment tweaks. Let me know if we want to omit that for now.

Summary by CodeRabbit

  • New Features

    • Added Helm chart options for configuring minimum ready time and deployment strategy, including RollingUpdate and Recreate modes.
    • Deployment settings are applied only when configured, preserving existing defaults.
  • Documentation

    • Updated the chart version to 0.3.11.
  • Tests

    • Added coverage for deployment strategy and minimum ready time configurations, including zero-value and omitted settings.

@coderabbitai

coderabbitai Bot commented Jul 10, 2026

Copy link
Copy Markdown

Review Change Stack

Important

Review skipped

Auto incremental reviews are disabled on this repository.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 96dd5de1-98b5-464a-b187-8971a7cff647

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Walkthrough

Adds configurable minReadySeconds and deploymentStrategy values to the OpenFGA Helm chart, renders them conditionally in Deployments, adds coverage for supported configurations, and bumps the chart version to 0.3.11.

Changes

Deployment rollout configuration

Layer / File(s) Summary
Rollout value contract
charts/openfga/values.yaml, charts/openfga/values.schema.json
Defines default values and schema entries for minReadySeconds and deploymentStrategy.
Deployment rendering and validation
charts/openfga/templates/deployment.yaml, charts/openfga/tests/deployment_strategy_test.yaml, charts/openfga/Chart.yaml
Conditionally renders rollout settings, tests default and configured values, and updates the chart version to 0.3.11.

Estimated code review effort: 2 (Simple) | ~10 minutes

Sequence Diagram(s)

sequenceDiagram
  participant HelmValues
  participant DeploymentTemplate
  participant KubernetesDeployment
  HelmValues->>DeploymentTemplate: provide rollout values
  DeploymentTemplate->>KubernetesDeployment: render minReadySeconds and strategy
Loading

Possibly related PRs

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly summarizes the main change: adding passthrough support for minReadySeconds and deploymentStrategy in the Helm chart.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@linux-foundation-easycla

linux-foundation-easycla Bot commented Jul 10, 2026

Copy link
Copy Markdown

CLA Signed
The committers listed above are authorized under a signed CLA.

  • ✅ login: rwo-trackunit / name: Roland Wolf (8b577d2)

@rwo-trackunit
rwo-trackunit force-pushed the rwo/deployment-strategy-min-ready-seconds branch from 5703796 to 70aad35 Compare July 10, 2026 10:24
@rwo-trackunit

Copy link
Copy Markdown
Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Jul 10, 2026

Copy link
Copy Markdown
✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

The Deployment currently always uses the Kubernetes default rollout
behavior. Because OpenFGA pods typically become Ready within seconds,
a rolling update replaces every replica almost simultaneously, and all
pods start with cold in-memory caches (check query cache, iterator
cache) at the same time - causing a datastore load spike right after
each deployment.

Exposing spec.minReadySeconds lets operators space out pod replacement
so each new pod serves (and warms its cache with) live traffic before
the next one is replaced. Exposing spec.strategy (deploymentStrategy)
lets operators tune maxSurge/maxUnavailable or use Recreate.

Both values are optional and omitted by default, so rendered manifests
are unchanged for existing users.
@rwo-trackunit
rwo-trackunit force-pushed the rwo/deployment-strategy-min-ready-seconds branch from 70aad35 to 8b577d2 Compare July 10, 2026 10:34
@rwo-trackunit

Copy link
Copy Markdown
Author

Tangentially related to #293, but not quite the same.

@rwo-trackunit
rwo-trackunit marked this pull request as ready for review July 10, 2026 10:42
@rwo-trackunit
rwo-trackunit requested a review from a team as a code owner July 10, 2026 10:42
Copilot AI review requested due to automatic review settings July 10, 2026 10:42
@rwo-trackunit
rwo-trackunit requested review from a team as code owners July 10, 2026 10:42

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

This PR adds configurable Kubernetes Deployment rollout controls to the openfga Helm chart by exposing spec.minReadySeconds and spec.strategy as values, enabling operators to slow down rollouts and tune surge/unavailable behavior to avoid cache-cold load spikes after deployments.

Changes:

  • Add minReadySeconds (optional, supports explicit 0) and deploymentStrategy passthrough values.
  • Render spec.minReadySeconds and spec.strategy in templates/deployment.yaml only when configured.
  • Add helm-unittest coverage for omission, zero/positive minReadySeconds, and RollingUpdate/Recreate strategy passthrough; bump chart version.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
charts/openfga/values.yaml Adds new top-level chart values for rollout controls.
charts/openfga/values.schema.json Documents and constrains the new values via JSON schema.
charts/openfga/templates/deployment.yaml Conditionally renders spec.minReadySeconds and spec.strategy into the Deployment.
charts/openfga/tests/deployment_strategy_test.yaml Adds unit tests covering rendering/omission behavior and passthrough semantics.
charts/openfga/Chart.yaml Bumps chart version to 0.3.11.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread charts/openfga/values.schema.json Outdated
Helm merges maps recursively, so an override values file setting
deploymentStrategy: {} cannot unset a previously-defined strategy.
Allowing null lets operators explicitly clear the value so
spec.strategy is omitted; the template's 'with' guard already treats
nil as unset.
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.

3 participants