Skip to content

[WIP] Remove the copy-cert init containers#423

Open
prafull01 wants to merge 1 commit intocockroachdb:masterfrom
prafull01:remove-copy-cert
Open

[WIP] Remove the copy-cert init containers#423
prafull01 wants to merge 1 commit intocockroachdb:masterfrom
prafull01:remove-copy-cert

Conversation

@prafull01
Copy link
Copy Markdown
Contributor

@prafull01 prafull01 commented Oct 10, 2024

Fixes: #408

nameisbhaskar added a commit to cockroachdb/cockroach-operator that referenced this pull request Mar 10, 2026
This change introduces a new 'skipCertCopy' field to the CrdbCluster API
that enables zero-downtime certificate rotation using SIGHUP signals.

Changes:
- Add skipCertCopy boolean field to CrdbClusterSpec API
- Make cert-copy initContainer conditional based on skipCertCopy flag
- When skipCertCopy=true: mount certs directly from secrets for SIGHUP rotation
- When skipCertCopy=false (default): use initContainer for strict 0400 permissions
- Add comprehensive documentation in README.md
- Add example manifests demonstrating both modes
- Add detailed testing guide

When skipCertCopy is enabled:
- No initContainer is created
- Certificates are mounted directly from Kubernetes secrets
- Certificate files have 0440 permissions (group readable)
- Certificates can be reloaded via SIGHUP without pod restart

When skipCertCopy is disabled (default):
- initContainer 'db-init' copies certificates to emptyDir
- Private keys have strict 0400 permissions
- Pod restart required for certificate rotation

Trade-offs are documented in README.md to help users choose the
appropriate mode for their security and operational requirements.

Fixes: cockroachdb/helm-charts#408
Related: cockroachdb/helm-charts#423
JIRA: CRDB-42772
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.

Change copy-certs initContainer as optional in StatefulSet

1 participant