Follow up to enhancement for exposing hosted control plane metrics to data plane#1944
Follow up to enhancement for exposing hosted control plane metrics to data plane#1944csrwng wants to merge 2 commits intoopenshift:masterfrom
Conversation
|
Skipping CI for Draft Pull Request. |
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: 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 |
|
/test all |
- Replace blanket mTLS assumption with per-component upstream authentication derived from existing ServiceMonitor/PodMonitor specs (mTLS, server-side TLS only, or plain HTTP) - Add annotation-based component discovery using hypershift.openshift.io/metrics-* annotations on ServiceMonitors and PodMonitors as the opt-in mechanism and source of injected label values - Detail how the control-plane-operator builds the metrics proxy Deployment: collecting and deduplicating Secret/ConfigMap volume mounts from tlsConfig, and generating the proxy ConfigMap with file-path references - Update metrics forwarder to TCP proxy mode (no TLS termination), with end-to-end TLS between Prometheus and the metrics proxy - Add metrics-proxy-serving-ca ConfigMap synced to openshift-monitoring for Prometheus to verify the metrics proxy cert through the TCP proxy - Use bearerTokenFile for Prometheus authentication via the existing prometheus-k8s ServiceAccount token Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
4d3917d to
04a2f48
Compare
|
I think this violates a security boundary since it's a request serving component and has rbac for management cluster. In the past we put the additional ignition proxy in front of the ignition server because of this. To avoid that we would need to decouple the server from the kube logic. The controller could push over the network the data against the server which then serves the pod monitor forwarder |
…er RBAC The metrics proxy is a request-serving component exposed to the data plane via a route. Giving it management cluster RBAC (to read Endpoints for pod discovery) violates a security boundary. Introduce a separate endpoint resolver deployment that holds the RBAC and serves pod IP resolution over HTTPS, keeping the externally-exposed metrics proxy free of management cluster credentials. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
Addressed in ad7e150. The metrics proxy no longer has any management cluster RBAC. Pod endpoint discovery is moved to a separate endpoint resolver deployment in the HCP namespace. It watches Endpoints/EndpointSlices and serves pod IP resolution over HTTPS. The metrics proxy queries the endpoint resolver instead of the kube API directly. Key properties:
This follows the same pattern as the ignition server / ignition proxy split. |
|
@csrwng: all tests passed! Full PR test history. Your PR dashboard. 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. I understand the commands that are listed here. |
Summary
Follow-up changes to the hosted control plane metrics exposure enhancement,
addressing PR feedback.
Commit 1: Per-component label mappings and PR feedback
authentication derived from existing ServiceMonitor/PodMonitor specs
(mTLS, server-side TLS only, or plain HTTP)
hypershift.openshift.io/metrics-*annotations on ServiceMonitors andPodMonitors as the opt-in mechanism and source of injected label values
Deployment: collecting and deduplicating Secret/ConfigMap volume mounts
from tlsConfig, and generating the proxy ConfigMap with file-path
references
with end-to-end TLS between Prometheus and the metrics proxy
metrics-proxy-serving-caConfigMap synced toopenshift-monitoringfor Prometheus to verify the metrics proxy cert through the TCP proxy
bearerTokenFilefor Prometheus authentication via the existingprometheus-k8sServiceAccount tokenCommit 2: Add endpoint resolver to decouple metrics proxy from management cluster RBAC
Addresses #1944 (comment)
The metrics proxy is a request-serving component exposed to the data plane
via a route. Giving it management cluster RBAC (to read Endpoints for pod
discovery) violates a security boundary — the same issue that required
putting an ignition proxy in front of the ignition server.
This commit introduces a separate endpoint resolver deployment:
Endpoints/EndpointSlices and serves pod IP resolution over HTTPS
directly, so it has no management cluster RBAC
is not reachable from the data plane
certificate, and RBAC as part of reconciliation
chicken-and-egg problem: the CPO creates serving certs, so it cannot
create one for itself
Co-Authored-By: Claude Opus 4.6 noreply@anthropic.com