OCPBUGS-95087: reload client CA after kubelet-ca.crt is replaced - #149
OCPBUGS-95087: reload client CA after kubelet-ca.crt is replaced#149arpitbhagat wants to merge 1 commit into
Conversation
kube-rbac-proxy-crio authenticates Prometheus with --client-ca-file /etc/kubernetes/kubelet-ca.crt. After MCO replaces that file, the process can keep a stale in-memory CA and return HTTP 401 while TLS still succeeds. Reload the client CA (and serving cert/key) on a 1m timer as well as on filesystem events so TargetDown job=crio does not stick until a process restart. Related: OCPBUGS-95087 Signed-off-by: Arpit Bhagat <arpitbhagat@users.noreply.github.com> Co-authored-by: Cursor <cursoragent@cursor.com>
|
Pipeline controller notification For optional jobs, comment This repository is configured in: LGTM mode |
|
@arpitbhagat: This pull request references Jira Issue OCPBUGS-95087, which is invalid:
Comment The bug has been updated to refer to the pull request using the external bug tracker. DetailsIn response to this:
Instructions 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 openshift-eng/jira-lifecycle-plugin repository. |
|
Comment |
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: arpitbhagat The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
|
Hi @arpitbhagat. Thanks for your PR. I'm waiting for a openshift 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. |
What type of PR is this?
/kind bug
What this PR does / why we need it:
OpenShift scrapes CRI-O metrics through the
kube-rbac-proxy-criostatic pod on:9637(job=crio). That process authenticates Prometheus with--client-ca-file=/etc/kubernetes/kubelet-ca.crt. Machine Config Operator writes that file atomically whenever the cluster client CA is updated.Today kube-rbac-proxy loads the CA at start (and on filesystem events for the original inode) and then keeps it in memory. After MCO replaces the file, TLS to
:9637still succeeds, but client-certificate authentication returns HTTP 401 (x509: certificate signed by unknown authority). Cluster Monitoring then firesTargetDownforjob=crio. Restarting the static pod reloads the CA from disk and clears the alert until the next CA rewrite.This change reloads the client CA on a one-minute timer as well as on filesystem events, so an MCO rewrite is picked up without restarting the proxy. The same reload is applied to the serving cert/key watcher so those files cannot stick on a stale inode either.
Which issue(s) this PR is related to:
Related: OCPBUGS-95087
Special notes for your reviewer:
--client-ca-file, static auth forprometheus-k8s).Does this PR introduce a user-facing change?