Skip to content

Plugin client certificate renewal blocks CNPG reconciliation until sidecar injector restart #485

Open

Description

@hossain-rayhan

Describe the bug

Reissuing the sidecar injector's client certificate causes CNPG plugin communication to fail with:

tls: unknown certificate authority

Affected clusters enter:

Cluster cannot proceed to reconciliation due to an error while interacting with plugins

Existing database pods may continue running, but reconciliation is blocked. Newly created clusters remain stuck with zero database pods.

To Reproduce

  1. Install the DocumentDB Operator Helm chart with cert-manager and the sidecar injector enabled.

  2. Deploy a single-node DocumentDB cluster and wait until it becomes healthy. The tested cluster was named documentdb-e2e in namespace documentdb-e2e.

  3. Reissue the plugin client certificate by changing its duration from the chart's default 2160h:

    kubectl -n cnpg-system patch certificate sidecarinjector-client \
      --type=merge \
      -p '{"spec":{"duration":"2159h"}}'
  4. Wait for the certificate's .status.revision to increase. In the reproduction, it changed from 1 to 2.

  5. Trigger cluster reconciliation:

    kubectl -n documentdb-e2e annotate cluster documentdb-e2e \
      reproduction/reconcile="$(date +%s)" --overwrite
  6. Inspect the backing CNPG Cluster:

    kubectl -n documentdb-e2e get cluster documentdb-e2e \
      -o jsonpath='{.status.phase}{"\n"}{.status.phaseReason}{"\n"}'
  7. Optionally deploy another DocumentDB resource with a different name. Its backing CNPG Cluster enters the same error phase before creating any database pods.

Expected behavior

Plugin communication and cluster reconciliation should continue after certificate renewal, without manually restarting the injector.

New clusters should initialize normally.

Screenshots

Relevant error output:

Error while discovering plugins: while getting plugin connection:
while querying plugin identity: rpc error: code = Unavailable
desc = connection error:
desc = "error reading server preface:
remote error: tls: unknown certificate authority"

Kubernetes Environment (please complete the following information):

  • DocumentDB Operator Version: source commit 9b0dd5e15f638cb4fa19c76f5470edec34d05f60 / PR refactoring: product neutral operator core #482
  • Kubernetes Version: v1.35.0
  • Kubernetes Environment: single-node kind, emulated Linux AMD64 using QEMU on an ARM Mac
  • Cert Bot Version: cert-manager v1.15.3
  • CNPG Version: 1.29.1, installed through the operator Helm chart
  • Container runtime: containerd 2.2.0

Additional context

Before certificate reissuance, cluster startup, strict hostname-verified TLS, SCRAM authentication and CRUD all passed.

The shared TLS helper in cnpg-i-machinery v0.2.0 loads the plugin client trust certificate into memory at server startup. The running injector retains that trust after certificate reissuance.

The relevant helper dependency, plugin TLS wiring and certificate templates are unchanged between PR #482's base commit ee41fd9 and the tested head.

Verified workaround

kubectl -n cnpg-system rollout restart deployment/sidecar-injector
kubectl -n cnpg-system rollout status deployment/sidecar-injector

Restarting only the injector restored reconciliation for both the existing cluster and the previously podless cluster. Original data remained accessible, and strict TLS, authentication and CRUD passed afterward.

A failing CI run also showed plugin client certificate revisions 1 and 2 and the same zero-pod symptom. However, that run omitted the detailed CNPG/plugin logs, so its exact cause is not conclusively established.

Activity

  1. documentdb-triage-tool commented on Nov 12, 2026

    @documentdb-triage-tool

    👋 @xgerman — this issue has been assigned for 14 days with no activity. Is it still in progress? If you've made progress, please leave a quick update. Otherwise it'll be flagged for re-assignment at the next triage meeting.

  2. added
    bug
    go
    on Nov 12, 2026
  3. documentdb-triage-tool commented on Nov 12, 2026

    @documentdb-triage-tool

    🤖 Auto-triaged by documentdb-triage-tool.

    Applied: go, bug
    Project fields suggested: Component controllers · Priority P1 · Effort L · Status In Progress
    Confidence: 0.82 (llm)

    Reasoning

    LLM: TLS certificate renewal causes CNPG plugin communication to break and blocks all cluster reconciliation (including zero-pod new clusters) until a manual sidecar injector restart — an active blocker for any cert-manager-enabled deployment.

    If a label is wrong, ping @patty-chow so the rules can be tuned. Issues with component labels are left alone; PR component labels are reconciled from changed paths on every run.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

buggo

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions