--- # ServiceMonitors so the platform Prometheus (kube-prometheus-stack, monitoring ns) scrapes the # KubeVirt + CDI control-plane metrics (docs/10 — "KubeVirt: VM crash-loops / failed launches" is a # first-class platform-health signal). These are CRs of the monitoring.coreos.com CRD installed by the # kube-prometheus-stack HelmRelease, so — like platform/monitoring/alerts.yaml — they are applied by # the `platform-config` Flux Kustomization (dependsOn: platform), NOT in the controllers pass (F-MON1). # # Prometheus discovers ServiceMonitors cluster-wide (serviceMonitorSelectorNilUsesHelmValues:false in # platform/monitoring/kube-prometheus-stack.yaml), so these can live beside their target Services. # NOTE (verify at bring-up, same convention as alerts.yaml): KubeVirt serves metrics over HTTPS with a # self-signed internal cert (insecureSkipVerify) on the port named `metrics`; CDI serves plain HTTP on # its `metrics` port. Port names/scheme are confirmed against the deployed Services on first reconcile. apiVersion: monitoring.coreos.com/v1 kind: ServiceMonitor metadata: name: kubevirt namespace: kubevirt labels: release: kube-prometheus-stack spec: selector: matchLabels: prometheus.kubevirt.io: "true" namespaceSelector: matchNames: - kubevirt endpoints: - port: metrics scheme: https tlsConfig: insecureSkipVerify: true honorLabels: true interval: 30s --- apiVersion: monitoring.coreos.com/v1 kind: ServiceMonitor metadata: name: cdi namespace: cdi labels: release: kube-prometheus-stack spec: selector: matchLabels: prometheus.cdi.kubevirt.io: "true" namespaceSelector: matchNames: - cdi endpoints: - port: metrics scheme: http honorLabels: true interval: 30s