Skip to content

[Feature]: Operator to support multiple deployments in parallel #10405

Description

@GellertBabel

Is there an existing issue already for this feature request/idea?

  • I have searched for an existing issue, and could not find anything. I believe this is a new feature request to be evaluated.

What problem is this feature going to solve? Why should it be added?

When deploying multiple instances of the CloudNativePG operator in the same cluster (e.g. for staging environments), the MutatingWebhookConfiguration and ValidatingWebhookConfiguration resource names are hardcoded to cnpg-mutating-webhook-configuration and cnpg-validating-webhook-configuration. Since these are cluster-scoped resources, multiple operator deployments will collide on them.

Describe the solution you'd like

Operator to support being deployed in parallel into multiple namespaces without the webhooks colliding.

Solution ideas:

  1. Append the namespace to the name or some unique identifier to the webhook name when namespace mode is in use
  2. Configurable names for the webhook:
    Add two new fields to configuration. Data, following the existing pattern of other configurable names like OPERATOR_NAMESPACE and WATCH_NAMESPACE:
MutatingWebhookConfigurationName  string `json:"mutatingWebhookConfigurationName"  env:"MUTATING_WEBHOOK_CONFIGURATION_NAME"`
ValidatingWebhookConfigurationName string `json:"validatingWebhookConfigurationName" env:"VALIDATING_WEBHOOK_CONFIGURATION_NAME"`

These can be set via environment variables, or through the operator ConfigMap/Secret. The existing hardcoded values would remain as defaults when not configured.

Describe alternatives you've considered

  • Kustomize namePrefix: Renames resources at the manifest level but breaks the operator since the hardcoded names in the binary no longer match.
  • External CA injection (cert-manager or OLM): Requires a CA injector to patch the caBundle field, which is not always available.

Additional context

No response

Backport?

Yes

Are you willing to actively contribute to this feature?

Yes

Code of Conduct

  • I agree to follow this project's Code of Conduct

Activity

  1. changed the title [-][Feature]: allow configuring mutating and validating webhook configuration names[/-] [+][Feature]: Operator to support multiple deployments in parallel[/+] on Apr 17, 2026
  2. added this to the 1.30.0 milestone on Jun 14, 2026
  3. moved this to Waiting for Second Review in CloudNativePG operator developmenton Jun 14, 2026
  4. added and removed
    triagePending triage
    on Jun 14, 2026
  5. added theissue type on Jun 14, 2026
  6. added
    choreIntangible work to reduce technical debt
    and removed on Jun 14, 2026
  7. moved this from Waiting for Second Review to Done in CloudNativePG operator developmenton Jun 17, 2026
  8. added a commit that references this issue on Jun 17, 2026
    afdce89
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

choreIntangible work to reduce technical debt

Type

Projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions