Repository navigation
feat: add minReadySeconds and deploymentStrategy passthrough - #327
SoulPancake merged 15 commits into
Conversation
|
Important Review skippedAuto incremental reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the
|
| 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
Possibly related PRs
- openfga/helm-charts#322: Updates the same chart version field in the preceding chart release.
Pre-merge checks | 
5
-
✅ Passed checks (5 passed)
-
✨ 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.
Comment @coderabbitai help to get the list of available commands.
|
|
5703796 to
70aad35
Compare
|
@coderabbitai review |
✅ Action performedReview finished.
|
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.
70aad35 to
8b577d2
Compare
|
Tangentially related to #293, but not quite the same. |
There was a problem hiding this comment.
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 explicit0) anddeploymentStrategypassthrough values. - Render
spec.minReadySecondsandspec.strategyintemplates/deployment.yamlonly 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.
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.
…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
|
@Siddhant-K-code Can you have a look if this issue is acceptable after recent changes? |
…tegy-min-ready-seconds # Conflicts: # charts/openfga/Chart.yaml
|
It seems this change has little interest, so closing it. |
|
Thanks a lot for reopening this and being patient with us @rwo-trackunit! Some small suggestions: Since "properties": {
"type": { "type": "string", "enum": ["RollingUpdate", "Recreate"] },
"rollingUpdate": {
"type": "object",
"properties": {
"maxSurge": { "type": ["integer", "string"] },
"maxUnavailable": { "type": ["integer", "string"] }
},
"additionalProperties": false
}
},
"additionalProperties": falseAlso on the two reject tests, - failedTemplate:
errorPattern: minReadySecondsLet 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.
Agree on all points. This should be mitigated now. |
|
thanks a lot @rwo-trackunit <3 |
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 asspec.minReadySecondswhen 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 asspec.strategywhen set. Lets operators tunemaxSurge/maxUnavailableor useRecreate.Both are optional and omitted by default, so rendered manifests are unchanged for existing users.
Changes
templates/deployment.yaml: renderminReadySeconds(guarded withne ... nilso an explicit0renders, matching the existing falsy-numeric handling) andstrategyvalues.yaml+values.schema.json: document the new values (minReadySecondsasinteger|null,deploymentStrategyas object)tests/deployment_strategy_test.yaml: helm-unittest coverage — unset (omitted),0, positive value, RollingUpdate passthrough, RecreateChart.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.
deploymentStrategyis 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
Documentation
Tests