Add HPA example and fix autoscaling support (#13) - #56
Merged
Merged
Conversation
… override When users omit `spec.replicas`, the field stays nil and the controller doesn't enforce a value, allowing HorizontalPodAutoscaler to manage scaling freely without interference from reconciliation loops. Updates ApplicationSpec documentation to clarify this behavior and regenerates CRDs. Closes kubesmarts#13
Contributor
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
The documented HPA target bypasses durable lease scaling, while removing the default undermines the existing scale subresource.
Review effort: Balanced
Findings: 1
Open (2)
What changed in this PR
Updates runtime autoscaling defaults and documentation, but currently targets the Deployment instead of the runtime scale subresource.
Changes:
- Removes the default replica value from shared application schemas.
- Regenerates affected CRDs.
- Adds an HPA production example.
| File | Description |
|---|---|
api/v1/deployment_types.go |
Changes replica defaulting behavior. |
config/crd/bases/logic.kubesmarts.org_logicplatforms.yaml |
Regenerates platform schemas. |
config/crd/bases/logic.kubesmarts.org_logicflowruntimes.yaml |
Regenerates runtime schema. |
docs/antora/modules/ROOT/pages/deployment/production.adoc |
Documents HPA configuration. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
…eting - Add mutating webhook to default LogicFlowRuntime.spec.replicas=1 - Remove kubebuilder default from ApplicationSpec to allow LogicPlatform.DataIndex HPA management - Register defaulter in webhook manager and test setup - Regenerate CRDs with updated ApplicationSpec (no default) Update HPA documentation: - Clarify that LogicFlowRuntime HPA must target the CR (not Deployment) for lease reconciliation - Add separate Data Index HPA section targeting the Deployment - Explain why: leases derive desired count from spec.replicas, so HPA must update the CR - Data Index can omit replicas to let HPA manage freely This enables HPA on both runtimes (via scale subresource) and Data Index (via nil replicas).
ricardozanini
force-pushed
the
issues/13
branch
from
October 1, 2026 19:47
aa34c5b to
9a1919c
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
Complete issue #13: Runtime Autoscaling support by:
ApplicationSpec.Replicasto allow HPA overrideChanges
+kubebuilder:default=1from Replicas field; update doc to clarify HPA behaviorHow it works
When
spec.replicasis omitted:Existing lease management (scale up/down) already handles dynamic replica changes.
E2E Coverage
Autoscaling is tested in
test/e2e/durable_test.go:Closes #13