Skip to content

K8SPG-911 Documented TDE - #366

Open
nastena1606 wants to merge 20 commits into
3.0from
K8SPG-911-Doc-pg-tde-support
Open

K8SPG-911 Documented TDE#366
nastena1606 wants to merge 20 commits into
3.0from
K8SPG-911-Doc-pg-tde-support

Conversation

@nastena1606

Copy link
Copy Markdown
Collaborator

No description provided.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Adds end-user documentation for Transparent Data Encryption (TDE) / data-at-rest encryption support and exposes it in the MkDocs navigation and Operator configuration reference.

Changes:

  • Adds a new “Data-at-rest encryption” documentation section (overview + Vault setup guide).
  • Updates docs/operator.md to document new extensions.* options (including extensions.pg_tde.*) and mark older extensions.builtin.* entries as deprecated.
  • Wires the new docs into the site navigation via mkdocs-base.yml.

Reviewed changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated 16 comments.

Show a summary per file
File Description
mkdocs-base.yml Adds nav entries for the new data-at-rest encryption docs.
docs/operator.md Adds/updates extension option documentation, deprecation notes, and new pg_tde/Vault settings.
docs/encryption.md New overview page for data-at-rest encryption (TDE) and how it works.
docs/encryption-setup.md New step-by-step Vault setup and CR configuration guide for pg_tde.
docs/encryption-disable.md New guide describing how to disable encryption safely.
docs/assets/fragments/vault-install-tls.txt New Vault-on-Kubernetes (Helm + TLS) procedure fragment used by the setup guide.
docs/assets/fragments/vault-generate-tls-certs.txt New TLS certificate generation procedure fragment used by the setup guide.
docs/assets/fragments/vault-enable-kv.txt New fragment describing how to enable Vault KV v2 at a mount path.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread docs/encryption-setup.md Outdated
Comment thread docs/encryption-setup.md Outdated
Comment on lines +180 to +197
??? example "Expected output"

```{.text .no-value}
Key Value
--- -----
Seal Type shamir
Initialized true
Sealed true
Total Shares 1
Threshold 1
Unseal Progress 0/1
Unseal Nonce n/a
Version 1.19.0
Build Date 2025-03-04T12:36:40Z
Storage Type raft
Removed From Cluster false
HA Enabled true
```

Copilot AI Mar 4, 2026

Copy link

Choose a reason for hiding this comment

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

The "Expected output" for unsealing the remaining pods shows Sealed true and Unseal Progress 0/1, which indicates the pod is still sealed. After a successful unseal (threshold=1), the output should show Sealed false. Also, the code fence uses .no-value, which doesn’t appear elsewhere in the docs (likely meant .no-copy).

Copilot uses AI. Check for mistakes.
Comment thread docs/operator.md Outdated
Comment thread docs/encryption.md Outdated
Comment thread docs/encryption-disable.md Outdated

```bash
openssl req -new -key $WORKDIR/vault.key \
-subj "/CN=system:node:${SERVICE}.${NAMESPACE}.svc;/O=system:nodes" \

Copilot AI Mar 4, 2026

Copy link

Choose a reason for hiding this comment

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

The OpenSSL -subj value uses ; between DN components (...svc;/O=...). OpenSSL expects DN components separated by / (e.g. /CN=.../O=...); with the current command the CSR subject may be malformed and the procedure may fail.

Suggested change
-subj "/CN=system:node:${SERVICE}.${NAMESPACE}.svc;/O=system:nodes" \
-subj "/CN=system:node:${SERVICE}.${NAMESPACE}.svc/O=system:nodes" \

Copilot uses AI. Check for mistakes.
Comment thread docs/operator.md
Comment thread docs/encryption-disable.md Outdated
Comment on lines +28 to +32
3. Apply the changes:

```bash
kubectl apply -f deploy/cr.yaml -n $NAMESPACE
```

Copilot AI Mar 4, 2026

Copy link

Choose a reason for hiding this comment

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

This guide uses $NAMESPACE in the kubectl apply commands, but the variable is never defined here (and the setup guide uses $CLUSTER_NAMESPACE for the database/CR namespace). Use the correct namespace variable consistently so the commands are runnable as-is.

Copilot uses AI. Check for mistakes.
Comment thread docs/encryption-setup.md Outdated

@egegunes egegunes 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.

LGTM. Please just check Copilot comments.

@egegunes
egegunes requested a review from janwieremjewicz March 5, 2026 05:47
@egegunes

egegunes commented Mar 5, 2026

Copy link
Copy Markdown
Contributor

@janwieremjewicz if you have some time, please take a look at this pg_tde documentation for the operator

@it-percona
it-percona temporarily deployed to K8SPG-911-Doc-pg-tde-support - percona-postgresql-operator-2.0 PR #366 March 5, 2026 09:17 — with Render Destroyed
@it-percona
it-percona temporarily deployed to K8SPG-911-Doc-pg-tde-support - percona-postgresql-operator-2.0 PR #366 March 5, 2026 09:17 — with Render Destroyed
@it-percona
it-percona temporarily deployed to K8SPG-911-Doc-pg-tde-support - percona-postgresql-operator-2.0 PR #366 March 5, 2026 09:18 — with Render Destroyed
Comment thread docs/encryption-setup.md
egegunes
egegunes previously approved these changes Mar 17, 2026
@nastena1606
nastena1606 force-pushed the K8SPG-911-Doc-pg-tde-support branch from 77e5302 to 34675a0 Compare March 17, 2026 08:36
eleo007
eleo007 previously approved these changes Aug 3, 2026
@@ -0,0 +1,197 @@
## Install Vault with TLS

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.

Taken into account that this is not our software and the vault conf can change - can we add some note about this and add link to the official vault docs?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

We do have it as it 1 in Assumptions

egegunes
egegunes previously approved these changes Aug 4, 2026
Comment thread docs/encryption.md Outdated

## Known limitations

1. WAL encryption is not yet supported. The Operator forces `pg_tde.wal_encrypt=off`. WAL encryption will be added in future releases.

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.

JFYI we're also adding WAL encryption in this release. it's okay to merge with this since we'll need to document WAL encryption in detail as well

Comment thread docs/encryption-setup.md Outdated

!!! important

Enable WAL encryption before the cluster has application writes.

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.

this sounds a bit confusing. we should say that it's our recommendation for the least amount of problems

Comment thread docs/encryption.md Outdated
### Considerations for WAL encryption

1. To enable WAL encryption, you must first enable `pg_tde` in the cluster. Wait for the cluster to become ready with `pg_tde` enabled, and only then enable WAL encryption as a separate step. Creating a new cluster with both `enabled` and `walEncryption` set to `true` causes Patroni bootstrap to fail.
2. The safest time to enable WAL encryption is before the cluster has application writes. Enabling WAL encryption on clusters that already have data needs further validation.

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.

what does further validation mean?

Comment thread docs/encryption.md

With `pg_tde` enabled you can make backups and restores as usual. For restore, the Operator must have access to the encryption key that was used to encrypt the backup data.

## Key rotation

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.

let's put a warning here for doing the rotation by creating a new secret and changing secret name in cr.yaml. changing the existing secret contents is prone to failures

egegunes
egegunes previously approved these changes Aug 6, 2026
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.

5 participants