feat: support keeper on a different namespace#173
Merged
GrigoryPervakov merged 2 commits intoClickHouse:mainfrom Apr 30, 2026
Merged
feat: support keeper on a different namespace#173GrigoryPervakov merged 2 commits intoClickHouse:mainfrom
GrigoryPervakov merged 2 commits intoClickHouse:mainfrom
Conversation
There was a problem hiding this comment.
Pull request overview
Adds cross-namespace Keeper support by replacing keeperClusterRef with a custom reference type (name + optional namespace) and updating reconciliation + watches so Keeper changes can requeue dependent ClickHouse clusters across namespaces.
Changes:
- Introduce
KeeperClusterReferenceand resolution helpers, update controller to resolve Keeper by fully-qualified namespaced name. - Add a field index + watch mapping so Keeper updates enqueue referencing ClickHouse clusters (including cross-namespace references).
- Update CRD/schema, docs, and tests to use/describe the new reference format and validate
keeperClusterRef.namespace.
Reviewed changes
Copilot reviewed 14 out of 15 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| test/e2e/clickhouse_e2e_test.go | Updates e2e specs to use KeeperClusterReference. |
| test/deploy/deploy_test.go | Updates deployment test manifests to use KeeperClusterReference. |
| internal/webhook/v1alpha1/clickhousecluster_webhook_test.go | Adds webhook tests for valid/invalid keeper namespace. |
| internal/webhook/v1alpha1/clickhousecluster_webhook.go | Validates keeperClusterRef.namespace as DNS1123 label when set. |
| internal/controller/clickhouse/sync.go | Resolves Keeper using Cluster.KeeperClusterNamespacedName() and improves log/error context. |
| internal/controller/clickhouse/controller_test.go | Adds tests for cross-namespace keeper watch mapping + reconciliation behavior. |
| internal/controller/clickhouse/controller.go | Adds field indexer for keeper reference; watch mapping lists clusters via indexed field to support cross-namespace. |
| docs/introduction.md | Documents default same-namespace behavior and optional keeperClusterRef.namespace. |
| docs/configuration.md | Documents new keeperClusterRef.namespace and watch-namespace requirement. |
| docs/api_reference.md | Updates API reference to document KeeperClusterReference. |
| dist/chart/templates/crd/clickhouseclusters.clickhouse.com.yaml | Updates CRD schema for new keeper reference type. |
| config/crd/bases/clickhouse.com_clickhouseclusters.yaml | Updates CRD base schema for new keeper reference type. |
| api/v1alpha1/zz_generated.deepcopy.go | Regenerates deepcopy for the new reference type. |
| api/v1alpha1/types_test.go | Adds unit tests for keeper namespaced name resolution defaulting. |
| api/v1alpha1/clickhousecluster_types.go | Introduces KeeperClusterReference and resolution helpers on the API types. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
e226934 to
7469c6b
Compare
GrigoryPervakov
approved these changes
Apr 30, 2026
Contributor
Author
|
Thanks for merging. Is there a timeline for a new version release? |
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.
Why
ClickHouse clusters currently can only reference a Keeper cluster in the same namespace. This change is needed to allow deploying Keeper in a different namespace while keeping the existing same-namespace behavior working by default.
What
This change replaces keeperClusterRef with a small custom reference type that includes name and optional namespace. The ClickHouse controller now resolves Keeper by namespace and name, cross-namespace Keeper updates can requeue dependent ClickHouse clusters, and the CRD/docs/tests were updated to reflect the new reference format.
crd-breaking-change - suppress check, because keeperRef.name became required, which is not a breaking change as it was validated in the webhook before.