@@ -317,8 +317,10 @@ The authentication flow:
317317 CSR controller when it reaches 20-25% remaining lifetime.
3183182 . The ` metrics-client-certs ` Secret is already mounted into the Prometheus pod
319319 at ` /etc/prometheus/secrets/metrics-client-certs/ ` (containing ` tls.crt ` and
320- ` tls.key ` ). The PodMonitor's ` tlsConfig ` references these paths for client
321- certificate authentication.
320+ ` tls.key ` ). The PodMonitor leverages CMO's ` tls-client-certificate-auth `
321+ scrape class, which automatically injects the correct cert/key file paths
322+ into the scrape configuration without HyperShift needing to reference them
323+ directly.
3223243 . On the management cluster side, the corresponding CA that signed the client
323325 certificate (` kube-csr-signer ` ) is stored as the ` cluster-signer-ca ` Secret
324326 in the HCP namespace. This Secret is created and reconciled by the
@@ -451,28 +453,18 @@ path. Each endpoint configures:
451453- ` scheme: https ` -- Prometheus initiates a TLS connection to the forwarder
452454 pod. Since the forwarder is a TCP proxy, this TLS connection passes
453455 through end-to-end to the metrics proxy, which terminates it.
454- - ` tlsConfig.ca ` -- references the ` metrics-proxy-serving-ca ` ConfigMap in
455- the ` openshift-monitoring ` namespace (synced by the HCCO from the HCP's
456- CA). This allows Prometheus to verify the metrics proxy's serving
457- certificate. The CA is referenced by ConfigMap name (not by file path),
458- since this is a custom CA not already mounted into the Prometheus pod.
459- This follows the same pattern used by ServiceMonitors like
460- ` monitor-network ` in ` openshift-multus ` , except those reference CAs
461- already available to Prometheus via ` caFile ` paths.
456+ - ` scrapeClass: tls-client-certificate-auth ` -- uses the CMO-defined scrape
457+ class that automatically injects the client certificate and key from the
458+ ` metrics-client-certs ` Secret, as well as the CA file for server
459+ verification. This means the PodMonitor does not need to explicitly
460+ reference these credentials. The client certificate is sent during the
461+ TLS handshake and forwarded transparently by the TCP proxy to the metrics
462+ proxy, which verifies it against the ` cluster-signer-ca ` CA bundle.
462463- ` tlsConfig.serverName ` -- set to the metrics proxy route hostname. This
463464 is needed for both SNI routing (so the OpenShift router directs the
464465 connection to the correct backend) and certificate verification (so
465466 Prometheus checks the cert against the route hostname, not the forwarder
466467 pod IP).
467- - ` tlsConfig.cert ` and ` tlsConfig.keySecret ` -- reference the
468- ` metrics-client-certs ` Secret in the ` openshift-monitoring ` namespace,
469- which contains the client certificate and key for the ` prometheus-k8s `
470- ServiceAccount. This Secret is already managed by CMO's embedded CSR
471- controller and is already mounted into the Prometheus pod at
472- ` /etc/prometheus/secrets/metrics-client-certs/ ` . The client certificate
473- is sent during the TLS handshake and forwarded transparently by the TCP
474- proxy to the metrics proxy, which verifies it against the
475- ` cluster-signer-ca ` CA bundle.
476468- ` honorLabels: true ` -- instructs Prometheus to keep labels from the
477469 scraped metrics as-is, rather than prefixing them with ` exported_ ` . Since
478470 the metrics proxy is a custom proxy that injects authoritative labels
@@ -487,6 +479,7 @@ metadata:
487479 name : control-plane-metrics
488480 namespace : openshift-monitoring
489481spec :
482+ scrapeClass : tls-client-certificate-auth
490483 selector :
491484 matchLabels :
492485 app : control-plane-metrics-forwarder
@@ -496,17 +489,6 @@ spec:
496489 scheme : https
497490 honorLabels : true
498491 tlsConfig : &tlsConfig
499- ca :
500- configMap :
501- name : metrics-proxy-serving-ca
502- key : ca.crt
503- cert :
504- secret :
505- name : metrics-client-certs
506- key : tls.crt
507- keySecret :
508- name : metrics-client-certs
509- key : tls.key
510492 serverName : <metrics-proxy-route-hostname>
511493 - port : metrics
512494 path : /metrics/etcd
@@ -571,12 +553,10 @@ cluster's `openshift-monitoring` namespace:
571553 hostname as the TCP backend.
572554- A **`metrics-proxy-serving-ca` ConfigMap** containing the HCP's CA
573555 certificate. This is synced from the HCP namespace on the management
574- cluster. Prometheus uses this CA (referenced by name in the PodMonitor's
575- ` tlsConfig.ca.configMap` ) to verify the metrics proxy's serving
576- certificate end-to-end through the TCP proxy.
556+ cluster.
577557- The PodMonitor targeting the forwarder pod, with `scheme : https`,
578- `honorLabels : true`, `tlsConfig` referencing the CA ConfigMap by name,
579- the `metrics- client-certs` Secret for client certificate authentication ,
558+ `honorLabels : true`, `scrapeClass: tls-client-certificate-auth` (which
559+ injects the client certificate, key, and CA for server verification) ,
580560 and `serverName` set to the metrics proxy route hostname.
581561
582562# ### 5. Control Plane Operator Changes
0 commit comments