Skip to content

feat: add minReadySeconds and deploymentStrategy passthrough - #327

Merged
SoulPancake merged 15 commits into
openfga:mainfrom
rwo-trackunit:rwo/deployment-strategy-min-ready-seconds
Oct 29, 2026
Merged

SoulPancake merged 15 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
Contributor

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.17

🤖 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.17.
  • 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
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 1ba2435b-cd19-4822-abd6-5dbc11407e81

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 | Passed 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 and concisely describes the main changes: adding passthrough support for minReadySeconds and deploymentStrategy.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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
Contributor 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
Contributor 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 Resolved
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.
Comment thread charts/openfga/values.schema.json Resolved
…tegy-min-ready-seconds

# Conflicts:
#	charts/openfga/Chart.yaml
Kubernetes requires minReadySeconds to be non-negative and smaller
than progressDeadlineSeconds (default 600, not configurable by this
chart). Add schema bounds and boundary tests so invalid values fail
helm validation instead of being rejected by the Kubernetes API.
…tegy-min-ready-seconds

# Conflicts:
#	charts/openfga/Chart.yaml
@rwo-trackunit

Copy link
Copy Markdown
Contributor Author

@Siddhant-K-code Can you have a look if this issue is acceptable after recent changes?

@Siddhant-K-code
Siddhant-K-code self-requested a review September 9, 2026 07:39
Siddhant-K-code
Siddhant-K-code previously approved these changes Sep 9, 2026

@Siddhant-K-code Siddhant-K-code left a comment •

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Approving, prior feedback is addressed & all checks pass.

I'll wait for another review someone from @openfga/backend

@rwo-trackunit

Copy link
Copy Markdown
Contributor Author

It seems this change has little interest, so closing it.
We can solve the same issue by modifying the resulting deployment "in transit".

@rwo-trackunit
rwo-trackunit deleted the rwo/deployment-strategy-min-ready-seconds branch October 28, 2026 19:16
@rwo-trackunit
rwo-trackunit restored the rwo/deployment-strategy-min-ready-seconds branch October 29, 2026 14:31
@rwo-trackunit rwo-trackunit reopened this Oct 29, 2026
@SoulPancake

Copy link
Copy Markdown
Member

Thanks a lot for reopening this and being patient with us @rwo-trackunit!

Some small suggestions:

Since deploymentStrategy goes straight through to spec.strategy, a typo like type: RollingUpdates or rollingupdate: won't get caught until it hits the cluster. Might be worth typing it in the schema so helm template catches it instead, something like:

"properties": {
  "type": { "type": "string", "enum": ["RollingUpdate", "Recreate"] },
  "rollingUpdate": {
    "type": "object",
    "properties": {
      "maxSurge": { "type": ["integer", "string"] },
      "maxUnavailable": { "type": ["integer", "string"] }
    },
    "additionalProperties": false
  }
},
"additionalProperties": false

Also on the two reject tests, failedTemplate: {} passes on any render error, so adding an errorPattern would make sure they're actually failing on the schema check:

- failedTemplate:
    errorPattern: minReadySeconds

Let me know what you think!

Restrict deploymentStrategy to Kubernetes' strategy fields so typos fail
at template time, and pin the schema-rejection tests to their error.
…tegy-min-ready-seconds

# Conflicts:
#	charts/openfga/Chart.yaml
Helm merges values maps key by key, so switching a base RollingUpdate
strategy to Recreate in an override file needs rollingUpdate: null to
drop the inherited rollingUpdate block. The typed schema rejected that.
@rwo-trackunit

Copy link
Copy Markdown
Contributor Author

Thanks a lot for reopening this and being patient with us @rwo-trackunit!

Some small suggestions:

Since deploymentStrategy goes straight through to spec.strategy, a typo like type: RollingUpdates or rollingupdate: won't get caught until it hits the cluster. Might be worth typing it in the schema so helm template catches it instead, something like:

"properties": {
  "type": { "type": "string", "enum": ["RollingUpdate", "Recreate"] },
  "rollingUpdate": {
    "type": "object",
    "properties": {
      "maxSurge": { "type": ["integer", "string"] },
      "maxUnavailable": { "type": ["integer", "string"] }
    },
    "additionalProperties": false
  }
},
"additionalProperties": false

Also on the two reject tests, failedTemplate: {} passes on any render error, so adding an errorPattern would make sure they're actually failing on the schema check:

- failedTemplate:
    errorPattern: minReadySeconds

Let me know what you think!

Agree on all points. This should be mitigated now.

@SoulPancake

Copy link
Copy Markdown
Member

thanks a lot @rwo-trackunit <3

@SoulPancake SoulPancake left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM 🚀

@SoulPancake
SoulPancake merged commit c64e132 into openfga:main Oct 29, 2026
7 checks passed
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.

5 participants