Skip to content

Conversation

@onematchfox
Copy link
Contributor

@onematchfox onematchfox commented Dec 2, 2025

Running multiple controller replicas when using a local SQLite database will lead to errors as API requests will inevitably end up being handled by a replicas that does not have the local state (e.g. A2A session). This check/error hopefully prevents users from making this mistake.

Split out from #1133

…te database

Signed-off-by: Brian Fox <878612+onematchfox@users.noreply.github.com>
Copy link
Contributor

Copilot AI left a comment

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 validation to prevent users from configuring multiple controller replicas when using a local SQLite database, which would cause errors as API requests would be routed to replicas without the local state.

Key changes:

  • Added a validation helper template that fails deployment when controller.replicas > 1 and database.type is sqlite
  • Integrated the validation at the top of the controller deployment template
  • Added comprehensive test coverage for both the failure case (replicas > 1 with sqlite) and the success case (replicas > 1 with postgres)

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.

File Description
helm/kagent/templates/_helpers.tpl Adds kagent.validateController helper template with validation logic to prevent scaling issues with SQLite
helm/kagent/templates/controller-deployment.yaml Includes the validation helper at the top of the deployment template to enforce the constraint
helm/kagent/tests/controller-deployment_test.yaml Adds test cases to verify the validation fails appropriately for sqlite with multiple replicas and succeeds for postgres

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

@EItanya EItanya merged commit 58a8e5f into kagent-dev:main Dec 2, 2025
24 checks passed
@onematchfox onematchfox deleted the helm-sqlite-error-when-scaling branch December 2, 2025 15:01
GTRekter pushed a commit to GTRekter/kagent that referenced this pull request Dec 4, 2025
…te database (kagent-dev#1144)

Running multiple controller replicas when using a local SQLite database
will lead to errors as API requests will inevitably end up being handled
by a replicas that does not have the local state (e.g. A2A session).
This check/error hopefully prevents users from making this mistake.

Split out from kagent-dev#1133

Signed-off-by: Brian Fox <878612+onematchfox@users.noreply.github.com>
Signed-off-by: Ivan Porta <porta.ivan@outlook.com>
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