📖 pkg/metrics/server: clarify TLS certificate configuration - #3568
kubernetes-prow[bot] merged 1 commit into
Conversation
|
Welcome @ugiordan! |
|
|
|
Hi @ugiordan. Thanks for your PR. I'm waiting for a kubernetes-sigs member to verify that this patch is reasonable to test. If it is, they should reply with Regular contributors should join the org to skip this step. Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
2a20d0e to
79f030c
Compare
|
Where did you encounter this issue?
I'm wondering how these tools would write the certificates into the manager Pod after manager startup |
The cert files arrive via a Kubernetes Secret mounted as a volume. A provisioner like cert-controller runs as a manager runnable: it generates a keypair, writes the cert data into a k8s Secret, and the kubelet then syncs that Secret to the pod's On first boot, when the Secret exists but has no cert data yet, the sequence is:
On subsequent restarts, the Secret already has cert data, so the kubelet pre-populates the volume before the container process starts, the Live cluster validationI built a minimal reproducer to confirm this on a live cluster. The binary is a single
|
|
You can just set GetCertificate and do in there whatever you want:
/hold |
|
/easycla |
@alvaroaleman You're right, setting I opened this PR because the one-shot I'd still lean toward fixing this in controller-runtime. Expecting every operator to discover the |
|
Your fix breaks anyone who wants the generated certs. The only way to avoid that would be to add yet another knob which I am opposed to. Feel free to improve the godocs |
Sounds good. I'll drop the behavior change. For the godoc improvements, do you prefer I repurpose this PR or close it and open a follow-up? |
Re-using the same PR is fine but please update the commit message and title |
32bfc8b to
e8007ab
Compare
|
@ugiordan plase fix the CLA check, co-authored-by: LLM trailers are generally not allowed since the LLM may be helping you, but it can not take responsibility for the result |
Clarify the generated certificate fallback and document TLSOpts.GetCertificate for asynchronously provisioned certificates.
e8007ab to
f4c85d0
Compare
@alvaroaleman you’re right, sorry about that. Thanks for pointing it out. |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: alvaroaleman, ugiordan The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
|
LGTM label has been added. DetailsGit tree hash: 0c7d161ce3f832c7d94c60b3eb5c4cd97f7ef600 |
Summary
Clarify how the metrics server selects its TLS certificate.
Behavior
No runtime behavior changes:
TLSOpts.GetCertificateis the opt-in path for asynchronously provisioned or dynamically supplied certificates.Tests
go test ./pkg/metrics/servergo test ./pkg/certwatcher