Skip to content

Support multiple DocumentDB operator instances in the same k8s cluster (blocked on CNPG webhook-name configurability) #396

@WentingWu666666

Description

@WentingWu666666

Summary

Today the DocumentDB operator cannot be deployed multiple times in the same Kubernetes cluster (e.g., one instance per namespace for multi-tenant scenarios). This is primarily blocked by an upstream limitation in CloudNative-PG (CNPG), which we ship as a Helm subchart. This issue tracks the work to lift that limitation once the upstream fix is available, and to audit our own webhook configurations for the same problem.

Context

The DocumentDB operator depends on CNPG as a Helm subchart. CNPG creates cluster-scoped MutatingWebhookConfiguration and ValidatingWebhookConfiguration resources with hardcoded names. When multiple operator instances are deployed in the same cluster, these resources collide and prevent a per-namespace deployment pattern.

Upstream fix

  • CNPG PR cloudnative-pg/cloudnative-pg#10420 "feat: make webhook configuration names configurable" by @maxlengdell.
    • Adds an ENABLE_WEBHOOK_NAMESPACE_SUFFIX config that suffixes the webhook name with the operator''s namespace.
    • Settable via env var or operator ConfigMap/Secret (mirrors the existing OPERATOR_NAMESPACE / WATCH_NAMESPACE pattern).
    • Closes CNPG issue #10405.
  • Status as of this issue: opened 2026-04-07, still OPEN, last updated 2026-04-16 (~2 months without merge).

Plan

Primary path (preferred)

Once CNPG #10420 merges and a CNPG release ships with ENABLE_WEBHOOK_NAMESPACE_SUFFIX:

  1. Bump our CNPG subchart dependency to the release containing the fix.
  2. Surface a values knob in our Helm chart so users can enable the namespace-suffixed webhook names.
  3. Apply analogous handling on the DocumentDB operator side if our own webhooks have the same cluster-scoped naming-collision problem (see acceptance criteria).

Fallback path

If CNPG #10420 stalls for an extended period (e.g., another 2+ months with no merge), evaluate either:

  • (a) carrying a patched CNPG fork as our subchart, or
  • (b) shipping our own CNPG build that embeds the patch,

until upstream merges.

Acceptance Criteria

  • Subscribe to / watch CNPG #10420; reassess fork-vs-wait decision quarterly.
  • When CNPG ships the fix: bump the CNPG subchart, expose a values knob in our Helm chart, and add an e2e test that deploys two operator instances in two namespaces against the same cluster.
  • Audit our own webhook configurations (specifically the ValidatingWebhookConfiguration added in 0.3.0 for DocumentDB CR validation) for the same cluster-scoped naming-collision problem and fix on our side analogously.
  • Document the multi-operator deployment pattern in docs/operator-public-documentation/preview/.

Additional Context

Metadata

Metadata

Labels

Type

No type
No fields configured for issues without a type.

Projects

Status
Backlog

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions