Skip to content

K8SPG-911: Fix enabling WAL encryption on a running cluster - #1774

Open
egegunes wants to merge 3 commits into
mainfrom
K8SPS-911-fix-principal
Open

K8SPG-911: Fix enabling WAL encryption on a running cluster#1774
egegunes wants to merge 3 commits into
mainfrom
K8SPS-911-fix-principal

Conversation

@egegunes

@egegunes egegunes commented Aug 21, 2026

Copy link
Copy Markdown
Contributor

CHANGE DESCRIPTION

Problem:
If pg_tde and WAL encryption is enabled at the same time on a running cluster, some replicas fail to rejoin the cluster.

Cause:
Operator waits for primary to be rolled out with pg_tde installed before configuring providers and enabling WAL encryption but doesn't wait for replicas. Replicas might be in mid-rollout during these operations.

Solution:
Wait for all pods to be restarted with pg_tde mounts and extension is installed.

CHECKLIST

Jira

  • Is the Jira ticket created and referenced properly?
  • Does the Jira ticket have the proper statuses for documentation (Needs Doc) and QA (Needs QA)?
  • Does the Jira ticket link to the proper milestone (Fix Version field)?

Tests

  • Is an E2E test/test case added for the new feature/change?
  • Are unit tests added where appropriate?

Config/Logging/Testability

  • Are all needed new/changed options added to default YAML files?
  • Are all needed new/changed options added to the Helm Chart?
  • Did we add proper logging messages for operator actions?
  • Did we ensure compatibility with the previous version or cluster upgrade process?
  • Does the change support oldest and newest supported PG version?
  • Does the change support oldest and newest supported Kubernetes version?

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Ensures pg_tde provider configuration waits until every database Pod is running and has pg_tde installed.

Changes:

  • Gates provider setup on all Pods being ready.
  • Checks pg_tde installation across every Pod before selecting the writable instance.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment on lines +575 to +577
for _, p := range pods {
// We need to configure pg_tde after volumes are mounted and extension is created
if _, ok := p.Annotations[naming.TDEInstalledAnnotation]; !ok {
@egegunes egegunes added this to the v3.1.0 milestone Aug 24, 2026
@egegunes
egegunes marked this pull request as ready for review August 24, 2026 07:52
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.

3 participants