Repository navigation
remote-config postgres: add --client-cert-duration flag - #849
Open
souravbiswassanto wants to merge 1 commit into
Open
souravbiswassanto wants to merge 1 commit into
souravbiswassanto wants to merge 1 commit into
Conversation
Lets the client certificate generated for a remote replica live longer than the cert-manager default (90d) or the 1y local-CA default, e.g. --client-cert-duration=87600h. The value overrides the Certificate duration on the cert-manager path and the validity on the --ca-cert path; it is still clamped to the signing CA's NotAfter. Signed-off-by: souravbiswassanto <saurov@appscode.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
The client certificate that
kubectl dba remote-config postgresgenerates is applied to the replica cluster as a static Secret that nothing renews, and the replica copies it into/tls/certs/remoteonly at pod start. When it expires the replica can no longer connect to the source. Its lifetime was not configurable:clientcertificate (cert-manager default 90d)--ca-certpath: hard-coded 1 yearChange
New flag
--client-cert-duration(e.g.87600hfor 10 years):duration; an inheritedrenewBeforethat no longer fits is dropped (cert-manager rejectsrenewBefore >= duration).--ca-certpath: overrides the 1y default validity.NotAfter(with a warning). With cert-manager the issuer may still cap the duration.Tests
go test ./pkg/remote_replica/— added tests for an explicit 10y validity and for clamping an explicit validity to the CA expiry.Not tested against a live cluster.