From cf87e5d4c91a5d2f1f9f9647250df3c87346a3a7 Mon Sep 17 00:00:00 2001 From: Mulham Raee Date: Thu, 11 Jun 2026 17:03:44 +0200 Subject: [PATCH 1/6] feat(api): add spec.monitoring with metricsForwarding API Add MonitoringSpec and MetricsForwardingSpec types to HostedCluster and HostedControlPlane specs, replacing the annotation-based EnableMetricsForwarding mechanism with a proper API field. The new API adds: - monitoring.metricsForwarding.mode (Forward/None) to control metrics forwarding per cluster - monitoring.metricsSet (Telemetry/SRE/All) to override the global METRICS_SET environment variable per cluster Signed-off-by: Mulham Raee Co-Authored-By: Claude Opus 4.6 (1M context) --- api/hypershift/v1beta1/hosted_controlplane.go | 7 ++ api/hypershift/v1beta1/hostedcluster_types.go | 86 +++++++++++++++++++ 2 files changed, 93 insertions(+) diff --git a/api/hypershift/v1beta1/hosted_controlplane.go b/api/hypershift/v1beta1/hosted_controlplane.go index 9c4358622169..9dc6fd0b1bc0 100644 --- a/api/hypershift/v1beta1/hosted_controlplane.go +++ b/api/hypershift/v1beta1/hosted_controlplane.go @@ -188,6 +188,13 @@ type HostedControlPlaneSpec struct { // +optional OperatorConfiguration *OperatorConfiguration `json:"operatorConfiguration,omitempty"` + // monitoring configures monitoring for the hosted cluster, including + // forwarding of control plane metrics to the hosted cluster's monitoring stack. + // When omitted, metrics forwarding is not configured and will be inactive. + // + // +optional + Monitoring MonitoringSpec `json:"monitoring,omitzero"` + // imageContentSources lists sources/repositories for the release-image content. // +optional // +kubebuilder:validation:MaxItems=255 diff --git a/api/hypershift/v1beta1/hostedcluster_types.go b/api/hypershift/v1beta1/hostedcluster_types.go index 35ebbeb44811..6524c9129019 100644 --- a/api/hypershift/v1beta1/hostedcluster_types.go +++ b/api/hypershift/v1beta1/hostedcluster_types.go @@ -278,6 +278,8 @@ const ( // EnableMetricsForwarding enables metrics forwarding from the management cluster to hosted clusters. // When present, components like the endpoint-resolver and metrics-proxy will be deployed. + // Deprecated: Use spec.monitoring.metricsForwarding instead. This annotation is preserved + // for backward compatibility and will be honored when spec.monitoring is not set. EnableMetricsForwarding = "hypershift.openshift.io/enable-metrics-forwarding" // JSONPatchAnnotation allow modifying the kubevirt VM template using jsonpatch @@ -839,6 +841,15 @@ type HostedClusterSpec struct { // +kubebuilder:default={} // +kubebuilder:validation:XValidation:rule="self == oldSelf", message="Capabilities is immutable. Changes might result in unpredictable and disruptive behavior." Capabilities *Capabilities `json:"capabilities,omitempty"` + + // monitoring configures monitoring for the hosted cluster, including + // forwarding of control plane metrics to the hosted cluster's monitoring stack. + // When omitted, metrics forwarding behavior is determined by the + // hypershift.openshift.io/enable-metrics-forwarding annotation for backward compatibility. + // If neither is set, metrics forwarding is disabled. + // + // +optional + Monitoring MonitoringSpec `json:"monitoring,omitzero"` } // OLMCatalogPlacement is an enum specifying the placement of OLM catalog components. @@ -875,6 +886,81 @@ func (olm *OLMCatalogPlacement) Type() string { return "OLMCatalogPlacement" } +// MetricsForwardingMode controls whether metrics forwarding is active for a hosted cluster. +// +// +kubebuilder:validation:Enum=Forward;None +type MetricsForwardingMode string + +const ( + // MetricsForwardingModeForward indicates metrics forwarding is active. + MetricsForwardingModeForward MetricsForwardingMode = "Forward" + + // MetricsForwardingModeNone indicates metrics forwarding is inactive. + MetricsForwardingModeNone MetricsForwardingMode = "None" +) + +// MetricsSet specifies the set of metrics to collect and forward from hosted clusters. +// +// +kubebuilder:validation:Enum=Telemetry;SRE;All +type MetricsSet string + +const ( + // MetricsSetTelemetry collects only the minimal set of metrics required for + // OpenShift Telemetry. Use this to minimize metrics volume while still + // satisfying cluster telemetry requirements. + MetricsSetTelemetry MetricsSet = "Telemetry" + + // MetricsSetSRE collects the metrics defined in the sre-metric-set ConfigMap, + // which includes the Telemetry set plus additional metrics needed for SRE + // monitoring dashboards and alerts. Use this for clusters that require + // SRE observability. + MetricsSetSRE MetricsSet = "SRE" + + // MetricsSetAll collects all metrics from control plane components without + // any filtering. Use this for debugging or when full metric visibility is + // needed, but be aware it produces significantly higher metrics volume. + MetricsSetAll MetricsSet = "All" +) + +// MonitoringSpec configures monitoring for the hosted cluster. +// At least one field must be specified when this struct is present. +// +// +kubebuilder:validation:MinProperties=1 +type MonitoringSpec struct { + // metricsForwarding configures forwarding of control plane metrics into + // the hosted cluster's monitoring stack. + // When omitted, metrics forwarding behavior is determined by the + // hypershift.openshift.io/enable-metrics-forwarding annotation for backward compatibility. + // If neither is set, metrics forwarding is disabled. + // + // +optional + MetricsForwarding MetricsForwardingSpec `json:"metricsForwarding,omitzero"` + + // metricsSet specifies which set of metrics to collect and forward. + // This overrides the global METRICS_SET environment variable configured on the HyperShift Operator. + // When not specified, the global METRICS_SET value is used, which defaults to "Telemetry". + // + // "Telemetry" collects only the minimal set of metrics required for OpenShift Telemetry. + // "SRE" collects the Telemetry set plus additional metrics defined in the sre-metric-set ConfigMap, + // needed for SRE dashboards and alerts. + // "All" collects all metrics from control plane components without filtering, + // which produces significantly higher metrics volume. + // + // +optional + MetricsSet MetricsSet `json:"metricsSet,omitempty"` +} + +// MetricsForwardingSpec configures metrics forwarding for the hosted cluster. +type MetricsForwardingSpec struct { + // mode controls whether metrics forwarding is active for this hosted cluster. + // When set to "Forward", metrics-proxy and endpoint-resolver are deployed in the + // control plane, and a metrics-forwarder is deployed in the hosted cluster. + // When set to "None", metrics forwarding is inactive. + // + // +required + Mode MetricsForwardingMode `json:"mode,omitempty"` +} + // ImageContentSource specifies image mirrors that can be used by cluster nodes // to pull content. For cluster workloads, if a container image registry host of // the pullspec matches Source then one of the Mirrors are substituted as hosts From 18b5d7b9149be012be2a538e774a48ee55dff4dc Mon Sep 17 00:00:00 2001 From: Mulham Raee Date: Thu, 11 Jun 2026 17:04:11 +0200 Subject: [PATCH 2/6] chore(api): regenerate CRDs, deepcopy, clients, vendor, and docs Generated by: make update Signed-off-by: Mulham Raee Co-Authored-By: Claude Opus 4.6 (1M context) --- .../v1beta1/zz_generated.deepcopy.go | 33 +++ .../AAA_ungated.yaml | 47 ++++ .../ClusterUpdateAcceptRisks.yaml | 47 ++++ .../ClusterVersionOperatorConfiguration.yaml | 47 ++++ .../ExternalOIDC.yaml | 47 ++++ ...ernalOIDCWithUIDAndExtraClaimMappings.yaml | 47 ++++ .../ExternalOIDCWithUpstreamParity.yaml | 47 ++++ .../GCPPlatform.yaml | 47 ++++ .../HCPEtcdBackup.yaml | 47 ++++ ...perShiftOnlyDynamicResourceAllocation.yaml | 47 ++++ .../ImageStreamImportMode.yaml | 47 ++++ .../KMSEncryptionProvider.yaml | 47 ++++ .../OpenStack.yaml | 47 ++++ .../TLSAdherence.yaml | 47 ++++ .../AAA_ungated.yaml | 45 ++++ .../ClusterUpdateAcceptRisks.yaml | 45 ++++ .../ClusterVersionOperatorConfiguration.yaml | 45 ++++ .../ExternalOIDC.yaml | 45 ++++ ...ernalOIDCWithUIDAndExtraClaimMappings.yaml | 45 ++++ .../ExternalOIDCWithUpstreamParity.yaml | 45 ++++ .../GCPPlatform.yaml | 45 ++++ .../HCPEtcdBackup.yaml | 45 ++++ ...perShiftOnlyDynamicResourceAllocation.yaml | 45 ++++ .../ImageStreamImportMode.yaml | 45 ++++ .../KMSEncryptionProvider.yaml | 45 ++++ .../OpenStack.yaml | 45 ++++ .../TLSAdherence.yaml | 45 ++++ .../hypershift/v1beta1/hostedclusterspec.go | 9 + .../v1beta1/hostedcontrolplanespec.go | 9 + .../v1beta1/metricsforwardingspec.go | 42 ++++ .../hypershift/v1beta1/monitoringspec.go | 51 +++++ client/applyconfiguration/utils.go | 4 + ...usters-Hypershift-CustomNoUpgrade.crd.yaml | 47 ++++ ...hostedclusters-Hypershift-Default.crd.yaml | 47 ++++ ...s-Hypershift-TechPreviewNoUpgrade.crd.yaml | 47 ++++ ...planes-Hypershift-CustomNoUpgrade.crd.yaml | 45 ++++ ...dcontrolplanes-Hypershift-Default.crd.yaml | 45 ++++ ...s-Hypershift-TechPreviewNoUpgrade.crd.yaml | 45 ++++ docs/content/reference/aggregated-docs.md | 201 ++++++++++++++++++ docs/content/reference/api.md | 201 ++++++++++++++++++ .../hypershift/v1beta1/hosted_controlplane.go | 7 + .../hypershift/v1beta1/hostedcluster_types.go | 86 ++++++++ .../v1beta1/zz_generated.deepcopy.go | 33 +++ 43 files changed, 2148 insertions(+) create mode 100644 client/applyconfiguration/hypershift/v1beta1/metricsforwardingspec.go create mode 100644 client/applyconfiguration/hypershift/v1beta1/monitoringspec.go diff --git a/api/hypershift/v1beta1/zz_generated.deepcopy.go b/api/hypershift/v1beta1/zz_generated.deepcopy.go index 23d872bde66d..ba481ba6e9b7 100644 --- a/api/hypershift/v1beta1/zz_generated.deepcopy.go +++ b/api/hypershift/v1beta1/zz_generated.deepcopy.go @@ -2489,6 +2489,7 @@ func (in *HostedClusterSpec) DeepCopyInto(out *HostedClusterSpec) { *out = new(Capabilities) (*in).DeepCopyInto(*out) } + out.Monitoring = in.Monitoring } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new HostedClusterSpec. @@ -2662,6 +2663,7 @@ func (in *HostedControlPlaneSpec) DeepCopyInto(out *HostedControlPlaneSpec) { *out = new(OperatorConfiguration) (*in).DeepCopyInto(*out) } + out.Monitoring = in.Monitoring if in.ImageContentSources != nil { in, out := &in.ImageContentSources, &out.ImageContentSources *out = make([]ImageContentSource, len(*in)) @@ -3513,6 +3515,37 @@ func (in *ManagedIdentity) DeepCopy() *ManagedIdentity { return out } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *MetricsForwardingSpec) DeepCopyInto(out *MetricsForwardingSpec) { + *out = *in +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MetricsForwardingSpec. +func (in *MetricsForwardingSpec) DeepCopy() *MetricsForwardingSpec { + if in == nil { + return nil + } + out := new(MetricsForwardingSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *MonitoringSpec) DeepCopyInto(out *MonitoringSpec) { + *out = *in + out.MetricsForwarding = in.MetricsForwarding +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MonitoringSpec. +func (in *MonitoringSpec) DeepCopy() *MonitoringSpec { + if in == nil { + return nil + } + out := new(MonitoringSpec) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *NetworkFilter) DeepCopyInto(out *NetworkFilter) { *out = *in diff --git a/api/hypershift/v1beta1/zz_generated.featuregated-crd-manifests/hostedclusters.hypershift.openshift.io/AAA_ungated.yaml b/api/hypershift/v1beta1/zz_generated.featuregated-crd-manifests/hostedclusters.hypershift.openshift.io/AAA_ungated.yaml index c1f6131492a3..99cfe712fae9 100644 --- a/api/hypershift/v1beta1/zz_generated.featuregated-crd-manifests/hostedclusters.hypershift.openshift.io/AAA_ungated.yaml +++ b/api/hypershift/v1beta1/zz_generated.featuregated-crd-manifests/hostedclusters.hypershift.openshift.io/AAA_ungated.yaml @@ -2877,6 +2877,53 @@ spec: -kubebuilder:validation:XValidation:rule=`self.all(key, size(self[key]) <= 63 && self[key].matches('^(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])?$'))`, message="label value must be 63 characters or less (can be empty), consist of alphanumeric characters, dashes (-), underscores (_) or dots (.), and begin and end with an alphanumeric character" maxProperties: 20 type: object + monitoring: + description: |- + monitoring configures monitoring for the hosted cluster, including + forwarding of control plane metrics to the hosted cluster's monitoring stack. + When omitted, metrics forwarding behavior is determined by the + hypershift.openshift.io/enable-metrics-forwarding annotation for backward compatibility. + If neither is set, metrics forwarding is disabled. + minProperties: 1 + properties: + metricsForwarding: + description: |- + metricsForwarding configures forwarding of control plane metrics into + the hosted cluster's monitoring stack. + When omitted, metrics forwarding behavior is determined by the + hypershift.openshift.io/enable-metrics-forwarding annotation for backward compatibility. + If neither is set, metrics forwarding is disabled. + properties: + mode: + description: |- + mode controls whether metrics forwarding is active for this hosted cluster. + When set to "Forward", metrics-proxy and endpoint-resolver are deployed in the + control plane, and a metrics-forwarder is deployed in the hosted cluster. + When set to "None", metrics forwarding is inactive. + enum: + - Forward + - None + type: string + required: + - mode + type: object + metricsSet: + description: |- + metricsSet specifies which set of metrics to collect and forward. + This overrides the global METRICS_SET environment variable configured on the HyperShift Operator. + When not specified, the global METRICS_SET value is used, which defaults to "Telemetry". + + "Telemetry" collects only the minimal set of metrics required for OpenShift Telemetry. + "SRE" collects the Telemetry set plus additional metrics defined in the sre-metric-set ConfigMap, + needed for SRE dashboards and alerts. + "All" collects all metrics from control plane components without filtering, + which produces significantly higher metrics volume. + enum: + - Telemetry + - SRE + - All + type: string + type: object networking: default: clusterNetwork: diff --git a/api/hypershift/v1beta1/zz_generated.featuregated-crd-manifests/hostedclusters.hypershift.openshift.io/ClusterUpdateAcceptRisks.yaml b/api/hypershift/v1beta1/zz_generated.featuregated-crd-manifests/hostedclusters.hypershift.openshift.io/ClusterUpdateAcceptRisks.yaml index ea5874e40555..75bf45dc36ff 100644 --- a/api/hypershift/v1beta1/zz_generated.featuregated-crd-manifests/hostedclusters.hypershift.openshift.io/ClusterUpdateAcceptRisks.yaml +++ b/api/hypershift/v1beta1/zz_generated.featuregated-crd-manifests/hostedclusters.hypershift.openshift.io/ClusterUpdateAcceptRisks.yaml @@ -2868,6 +2868,53 @@ spec: -kubebuilder:validation:XValidation:rule=`self.all(key, size(self[key]) <= 63 && self[key].matches('^(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])?$'))`, message="label value must be 63 characters or less (can be empty), consist of alphanumeric characters, dashes (-), underscores (_) or dots (.), and begin and end with an alphanumeric character" maxProperties: 20 type: object + monitoring: + description: |- + monitoring configures monitoring for the hosted cluster, including + forwarding of control plane metrics to the hosted cluster's monitoring stack. + When omitted, metrics forwarding behavior is determined by the + hypershift.openshift.io/enable-metrics-forwarding annotation for backward compatibility. + If neither is set, metrics forwarding is disabled. + minProperties: 1 + properties: + metricsForwarding: + description: |- + metricsForwarding configures forwarding of control plane metrics into + the hosted cluster's monitoring stack. + When omitted, metrics forwarding behavior is determined by the + hypershift.openshift.io/enable-metrics-forwarding annotation for backward compatibility. + If neither is set, metrics forwarding is disabled. + properties: + mode: + description: |- + mode controls whether metrics forwarding is active for this hosted cluster. + When set to "Forward", metrics-proxy and endpoint-resolver are deployed in the + control plane, and a metrics-forwarder is deployed in the hosted cluster. + When set to "None", metrics forwarding is inactive. + enum: + - Forward + - None + type: string + required: + - mode + type: object + metricsSet: + description: |- + metricsSet specifies which set of metrics to collect and forward. + This overrides the global METRICS_SET environment variable configured on the HyperShift Operator. + When not specified, the global METRICS_SET value is used, which defaults to "Telemetry". + + "Telemetry" collects only the minimal set of metrics required for OpenShift Telemetry. + "SRE" collects the Telemetry set plus additional metrics defined in the sre-metric-set ConfigMap, + needed for SRE dashboards and alerts. + "All" collects all metrics from control plane components without filtering, + which produces significantly higher metrics volume. + enum: + - Telemetry + - SRE + - All + type: string + type: object networking: default: clusterNetwork: diff --git a/api/hypershift/v1beta1/zz_generated.featuregated-crd-manifests/hostedclusters.hypershift.openshift.io/ClusterVersionOperatorConfiguration.yaml b/api/hypershift/v1beta1/zz_generated.featuregated-crd-manifests/hostedclusters.hypershift.openshift.io/ClusterVersionOperatorConfiguration.yaml index 5e72e5aa3649..3394f1c1cacf 100644 --- a/api/hypershift/v1beta1/zz_generated.featuregated-crd-manifests/hostedclusters.hypershift.openshift.io/ClusterVersionOperatorConfiguration.yaml +++ b/api/hypershift/v1beta1/zz_generated.featuregated-crd-manifests/hostedclusters.hypershift.openshift.io/ClusterVersionOperatorConfiguration.yaml @@ -2868,6 +2868,53 @@ spec: -kubebuilder:validation:XValidation:rule=`self.all(key, size(self[key]) <= 63 && self[key].matches('^(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])?$'))`, message="label value must be 63 characters or less (can be empty), consist of alphanumeric characters, dashes (-), underscores (_) or dots (.), and begin and end with an alphanumeric character" maxProperties: 20 type: object + monitoring: + description: |- + monitoring configures monitoring for the hosted cluster, including + forwarding of control plane metrics to the hosted cluster's monitoring stack. + When omitted, metrics forwarding behavior is determined by the + hypershift.openshift.io/enable-metrics-forwarding annotation for backward compatibility. + If neither is set, metrics forwarding is disabled. + minProperties: 1 + properties: + metricsForwarding: + description: |- + metricsForwarding configures forwarding of control plane metrics into + the hosted cluster's monitoring stack. + When omitted, metrics forwarding behavior is determined by the + hypershift.openshift.io/enable-metrics-forwarding annotation for backward compatibility. + If neither is set, metrics forwarding is disabled. + properties: + mode: + description: |- + mode controls whether metrics forwarding is active for this hosted cluster. + When set to "Forward", metrics-proxy and endpoint-resolver are deployed in the + control plane, and a metrics-forwarder is deployed in the hosted cluster. + When set to "None", metrics forwarding is inactive. + enum: + - Forward + - None + type: string + required: + - mode + type: object + metricsSet: + description: |- + metricsSet specifies which set of metrics to collect and forward. + This overrides the global METRICS_SET environment variable configured on the HyperShift Operator. + When not specified, the global METRICS_SET value is used, which defaults to "Telemetry". + + "Telemetry" collects only the minimal set of metrics required for OpenShift Telemetry. + "SRE" collects the Telemetry set plus additional metrics defined in the sre-metric-set ConfigMap, + needed for SRE dashboards and alerts. + "All" collects all metrics from control plane components without filtering, + which produces significantly higher metrics volume. + enum: + - Telemetry + - SRE + - All + type: string + type: object networking: default: clusterNetwork: diff --git a/api/hypershift/v1beta1/zz_generated.featuregated-crd-manifests/hostedclusters.hypershift.openshift.io/ExternalOIDC.yaml b/api/hypershift/v1beta1/zz_generated.featuregated-crd-manifests/hostedclusters.hypershift.openshift.io/ExternalOIDC.yaml index 3b56e82e3e5c..2f0e19e50a6f 100644 --- a/api/hypershift/v1beta1/zz_generated.featuregated-crd-manifests/hostedclusters.hypershift.openshift.io/ExternalOIDC.yaml +++ b/api/hypershift/v1beta1/zz_generated.featuregated-crd-manifests/hostedclusters.hypershift.openshift.io/ExternalOIDC.yaml @@ -3200,6 +3200,53 @@ spec: -kubebuilder:validation:XValidation:rule=`self.all(key, size(self[key]) <= 63 && self[key].matches('^(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])?$'))`, message="label value must be 63 characters or less (can be empty), consist of alphanumeric characters, dashes (-), underscores (_) or dots (.), and begin and end with an alphanumeric character" maxProperties: 20 type: object + monitoring: + description: |- + monitoring configures monitoring for the hosted cluster, including + forwarding of control plane metrics to the hosted cluster's monitoring stack. + When omitted, metrics forwarding behavior is determined by the + hypershift.openshift.io/enable-metrics-forwarding annotation for backward compatibility. + If neither is set, metrics forwarding is disabled. + minProperties: 1 + properties: + metricsForwarding: + description: |- + metricsForwarding configures forwarding of control plane metrics into + the hosted cluster's monitoring stack. + When omitted, metrics forwarding behavior is determined by the + hypershift.openshift.io/enable-metrics-forwarding annotation for backward compatibility. + If neither is set, metrics forwarding is disabled. + properties: + mode: + description: |- + mode controls whether metrics forwarding is active for this hosted cluster. + When set to "Forward", metrics-proxy and endpoint-resolver are deployed in the + control plane, and a metrics-forwarder is deployed in the hosted cluster. + When set to "None", metrics forwarding is inactive. + enum: + - Forward + - None + type: string + required: + - mode + type: object + metricsSet: + description: |- + metricsSet specifies which set of metrics to collect and forward. + This overrides the global METRICS_SET environment variable configured on the HyperShift Operator. + When not specified, the global METRICS_SET value is used, which defaults to "Telemetry". + + "Telemetry" collects only the minimal set of metrics required for OpenShift Telemetry. + "SRE" collects the Telemetry set plus additional metrics defined in the sre-metric-set ConfigMap, + needed for SRE dashboards and alerts. + "All" collects all metrics from control plane components without filtering, + which produces significantly higher metrics volume. + enum: + - Telemetry + - SRE + - All + type: string + type: object networking: default: clusterNetwork: diff --git a/api/hypershift/v1beta1/zz_generated.featuregated-crd-manifests/hostedclusters.hypershift.openshift.io/ExternalOIDCWithUIDAndExtraClaimMappings.yaml b/api/hypershift/v1beta1/zz_generated.featuregated-crd-manifests/hostedclusters.hypershift.openshift.io/ExternalOIDCWithUIDAndExtraClaimMappings.yaml index 00fbec3a66c9..2406038135ff 100644 --- a/api/hypershift/v1beta1/zz_generated.featuregated-crd-manifests/hostedclusters.hypershift.openshift.io/ExternalOIDCWithUIDAndExtraClaimMappings.yaml +++ b/api/hypershift/v1beta1/zz_generated.featuregated-crd-manifests/hostedclusters.hypershift.openshift.io/ExternalOIDCWithUIDAndExtraClaimMappings.yaml @@ -3340,6 +3340,53 @@ spec: -kubebuilder:validation:XValidation:rule=`self.all(key, size(self[key]) <= 63 && self[key].matches('^(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])?$'))`, message="label value must be 63 characters or less (can be empty), consist of alphanumeric characters, dashes (-), underscores (_) or dots (.), and begin and end with an alphanumeric character" maxProperties: 20 type: object + monitoring: + description: |- + monitoring configures monitoring for the hosted cluster, including + forwarding of control plane metrics to the hosted cluster's monitoring stack. + When omitted, metrics forwarding behavior is determined by the + hypershift.openshift.io/enable-metrics-forwarding annotation for backward compatibility. + If neither is set, metrics forwarding is disabled. + minProperties: 1 + properties: + metricsForwarding: + description: |- + metricsForwarding configures forwarding of control plane metrics into + the hosted cluster's monitoring stack. + When omitted, metrics forwarding behavior is determined by the + hypershift.openshift.io/enable-metrics-forwarding annotation for backward compatibility. + If neither is set, metrics forwarding is disabled. + properties: + mode: + description: |- + mode controls whether metrics forwarding is active for this hosted cluster. + When set to "Forward", metrics-proxy and endpoint-resolver are deployed in the + control plane, and a metrics-forwarder is deployed in the hosted cluster. + When set to "None", metrics forwarding is inactive. + enum: + - Forward + - None + type: string + required: + - mode + type: object + metricsSet: + description: |- + metricsSet specifies which set of metrics to collect and forward. + This overrides the global METRICS_SET environment variable configured on the HyperShift Operator. + When not specified, the global METRICS_SET value is used, which defaults to "Telemetry". + + "Telemetry" collects only the minimal set of metrics required for OpenShift Telemetry. + "SRE" collects the Telemetry set plus additional metrics defined in the sre-metric-set ConfigMap, + needed for SRE dashboards and alerts. + "All" collects all metrics from control plane components without filtering, + which produces significantly higher metrics volume. + enum: + - Telemetry + - SRE + - All + type: string + type: object networking: default: clusterNetwork: diff --git a/api/hypershift/v1beta1/zz_generated.featuregated-crd-manifests/hostedclusters.hypershift.openshift.io/ExternalOIDCWithUpstreamParity.yaml b/api/hypershift/v1beta1/zz_generated.featuregated-crd-manifests/hostedclusters.hypershift.openshift.io/ExternalOIDCWithUpstreamParity.yaml index 2d530e5f14a3..fc5256fe09f5 100644 --- a/api/hypershift/v1beta1/zz_generated.featuregated-crd-manifests/hostedclusters.hypershift.openshift.io/ExternalOIDCWithUpstreamParity.yaml +++ b/api/hypershift/v1beta1/zz_generated.featuregated-crd-manifests/hostedclusters.hypershift.openshift.io/ExternalOIDCWithUpstreamParity.yaml @@ -3331,6 +3331,53 @@ spec: -kubebuilder:validation:XValidation:rule=`self.all(key, size(self[key]) <= 63 && self[key].matches('^(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])?$'))`, message="label value must be 63 characters or less (can be empty), consist of alphanumeric characters, dashes (-), underscores (_) or dots (.), and begin and end with an alphanumeric character" maxProperties: 20 type: object + monitoring: + description: |- + monitoring configures monitoring for the hosted cluster, including + forwarding of control plane metrics to the hosted cluster's monitoring stack. + When omitted, metrics forwarding behavior is determined by the + hypershift.openshift.io/enable-metrics-forwarding annotation for backward compatibility. + If neither is set, metrics forwarding is disabled. + minProperties: 1 + properties: + metricsForwarding: + description: |- + metricsForwarding configures forwarding of control plane metrics into + the hosted cluster's monitoring stack. + When omitted, metrics forwarding behavior is determined by the + hypershift.openshift.io/enable-metrics-forwarding annotation for backward compatibility. + If neither is set, metrics forwarding is disabled. + properties: + mode: + description: |- + mode controls whether metrics forwarding is active for this hosted cluster. + When set to "Forward", metrics-proxy and endpoint-resolver are deployed in the + control plane, and a metrics-forwarder is deployed in the hosted cluster. + When set to "None", metrics forwarding is inactive. + enum: + - Forward + - None + type: string + required: + - mode + type: object + metricsSet: + description: |- + metricsSet specifies which set of metrics to collect and forward. + This overrides the global METRICS_SET environment variable configured on the HyperShift Operator. + When not specified, the global METRICS_SET value is used, which defaults to "Telemetry". + + "Telemetry" collects only the minimal set of metrics required for OpenShift Telemetry. + "SRE" collects the Telemetry set plus additional metrics defined in the sre-metric-set ConfigMap, + needed for SRE dashboards and alerts. + "All" collects all metrics from control plane components without filtering, + which produces significantly higher metrics volume. + enum: + - Telemetry + - SRE + - All + type: string + type: object networking: default: clusterNetwork: diff --git a/api/hypershift/v1beta1/zz_generated.featuregated-crd-manifests/hostedclusters.hypershift.openshift.io/GCPPlatform.yaml b/api/hypershift/v1beta1/zz_generated.featuregated-crd-manifests/hostedclusters.hypershift.openshift.io/GCPPlatform.yaml index dd19ac89afad..7ab4ba1a1d17 100644 --- a/api/hypershift/v1beta1/zz_generated.featuregated-crd-manifests/hostedclusters.hypershift.openshift.io/GCPPlatform.yaml +++ b/api/hypershift/v1beta1/zz_generated.featuregated-crd-manifests/hostedclusters.hypershift.openshift.io/GCPPlatform.yaml @@ -2868,6 +2868,53 @@ spec: -kubebuilder:validation:XValidation:rule=`self.all(key, size(self[key]) <= 63 && self[key].matches('^(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])?$'))`, message="label value must be 63 characters or less (can be empty), consist of alphanumeric characters, dashes (-), underscores (_) or dots (.), and begin and end with an alphanumeric character" maxProperties: 20 type: object + monitoring: + description: |- + monitoring configures monitoring for the hosted cluster, including + forwarding of control plane metrics to the hosted cluster's monitoring stack. + When omitted, metrics forwarding behavior is determined by the + hypershift.openshift.io/enable-metrics-forwarding annotation for backward compatibility. + If neither is set, metrics forwarding is disabled. + minProperties: 1 + properties: + metricsForwarding: + description: |- + metricsForwarding configures forwarding of control plane metrics into + the hosted cluster's monitoring stack. + When omitted, metrics forwarding behavior is determined by the + hypershift.openshift.io/enable-metrics-forwarding annotation for backward compatibility. + If neither is set, metrics forwarding is disabled. + properties: + mode: + description: |- + mode controls whether metrics forwarding is active for this hosted cluster. + When set to "Forward", metrics-proxy and endpoint-resolver are deployed in the + control plane, and a metrics-forwarder is deployed in the hosted cluster. + When set to "None", metrics forwarding is inactive. + enum: + - Forward + - None + type: string + required: + - mode + type: object + metricsSet: + description: |- + metricsSet specifies which set of metrics to collect and forward. + This overrides the global METRICS_SET environment variable configured on the HyperShift Operator. + When not specified, the global METRICS_SET value is used, which defaults to "Telemetry". + + "Telemetry" collects only the minimal set of metrics required for OpenShift Telemetry. + "SRE" collects the Telemetry set plus additional metrics defined in the sre-metric-set ConfigMap, + needed for SRE dashboards and alerts. + "All" collects all metrics from control plane components without filtering, + which produces significantly higher metrics volume. + enum: + - Telemetry + - SRE + - All + type: string + type: object networking: default: clusterNetwork: diff --git a/api/hypershift/v1beta1/zz_generated.featuregated-crd-manifests/hostedclusters.hypershift.openshift.io/HCPEtcdBackup.yaml b/api/hypershift/v1beta1/zz_generated.featuregated-crd-manifests/hostedclusters.hypershift.openshift.io/HCPEtcdBackup.yaml index abb8acb668a5..03723228e71d 100644 --- a/api/hypershift/v1beta1/zz_generated.featuregated-crd-manifests/hostedclusters.hypershift.openshift.io/HCPEtcdBackup.yaml +++ b/api/hypershift/v1beta1/zz_generated.featuregated-crd-manifests/hostedclusters.hypershift.openshift.io/HCPEtcdBackup.yaml @@ -2933,6 +2933,53 @@ spec: -kubebuilder:validation:XValidation:rule=`self.all(key, size(self[key]) <= 63 && self[key].matches('^(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])?$'))`, message="label value must be 63 characters or less (can be empty), consist of alphanumeric characters, dashes (-), underscores (_) or dots (.), and begin and end with an alphanumeric character" maxProperties: 20 type: object + monitoring: + description: |- + monitoring configures monitoring for the hosted cluster, including + forwarding of control plane metrics to the hosted cluster's monitoring stack. + When omitted, metrics forwarding behavior is determined by the + hypershift.openshift.io/enable-metrics-forwarding annotation for backward compatibility. + If neither is set, metrics forwarding is disabled. + minProperties: 1 + properties: + metricsForwarding: + description: |- + metricsForwarding configures forwarding of control plane metrics into + the hosted cluster's monitoring stack. + When omitted, metrics forwarding behavior is determined by the + hypershift.openshift.io/enable-metrics-forwarding annotation for backward compatibility. + If neither is set, metrics forwarding is disabled. + properties: + mode: + description: |- + mode controls whether metrics forwarding is active for this hosted cluster. + When set to "Forward", metrics-proxy and endpoint-resolver are deployed in the + control plane, and a metrics-forwarder is deployed in the hosted cluster. + When set to "None", metrics forwarding is inactive. + enum: + - Forward + - None + type: string + required: + - mode + type: object + metricsSet: + description: |- + metricsSet specifies which set of metrics to collect and forward. + This overrides the global METRICS_SET environment variable configured on the HyperShift Operator. + When not specified, the global METRICS_SET value is used, which defaults to "Telemetry". + + "Telemetry" collects only the minimal set of metrics required for OpenShift Telemetry. + "SRE" collects the Telemetry set plus additional metrics defined in the sre-metric-set ConfigMap, + needed for SRE dashboards and alerts. + "All" collects all metrics from control plane components without filtering, + which produces significantly higher metrics volume. + enum: + - Telemetry + - SRE + - All + type: string + type: object networking: default: clusterNetwork: diff --git a/api/hypershift/v1beta1/zz_generated.featuregated-crd-manifests/hostedclusters.hypershift.openshift.io/HyperShiftOnlyDynamicResourceAllocation.yaml b/api/hypershift/v1beta1/zz_generated.featuregated-crd-manifests/hostedclusters.hypershift.openshift.io/HyperShiftOnlyDynamicResourceAllocation.yaml index 7334c1fd456b..cd11289a80e5 100644 --- a/api/hypershift/v1beta1/zz_generated.featuregated-crd-manifests/hostedclusters.hypershift.openshift.io/HyperShiftOnlyDynamicResourceAllocation.yaml +++ b/api/hypershift/v1beta1/zz_generated.featuregated-crd-manifests/hostedclusters.hypershift.openshift.io/HyperShiftOnlyDynamicResourceAllocation.yaml @@ -2890,6 +2890,53 @@ spec: -kubebuilder:validation:XValidation:rule=`self.all(key, size(self[key]) <= 63 && self[key].matches('^(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])?$'))`, message="label value must be 63 characters or less (can be empty), consist of alphanumeric characters, dashes (-), underscores (_) or dots (.), and begin and end with an alphanumeric character" maxProperties: 20 type: object + monitoring: + description: |- + monitoring configures monitoring for the hosted cluster, including + forwarding of control plane metrics to the hosted cluster's monitoring stack. + When omitted, metrics forwarding behavior is determined by the + hypershift.openshift.io/enable-metrics-forwarding annotation for backward compatibility. + If neither is set, metrics forwarding is disabled. + minProperties: 1 + properties: + metricsForwarding: + description: |- + metricsForwarding configures forwarding of control plane metrics into + the hosted cluster's monitoring stack. + When omitted, metrics forwarding behavior is determined by the + hypershift.openshift.io/enable-metrics-forwarding annotation for backward compatibility. + If neither is set, metrics forwarding is disabled. + properties: + mode: + description: |- + mode controls whether metrics forwarding is active for this hosted cluster. + When set to "Forward", metrics-proxy and endpoint-resolver are deployed in the + control plane, and a metrics-forwarder is deployed in the hosted cluster. + When set to "None", metrics forwarding is inactive. + enum: + - Forward + - None + type: string + required: + - mode + type: object + metricsSet: + description: |- + metricsSet specifies which set of metrics to collect and forward. + This overrides the global METRICS_SET environment variable configured on the HyperShift Operator. + When not specified, the global METRICS_SET value is used, which defaults to "Telemetry". + + "Telemetry" collects only the minimal set of metrics required for OpenShift Telemetry. + "SRE" collects the Telemetry set plus additional metrics defined in the sre-metric-set ConfigMap, + needed for SRE dashboards and alerts. + "All" collects all metrics from control plane components without filtering, + which produces significantly higher metrics volume. + enum: + - Telemetry + - SRE + - All + type: string + type: object networking: default: clusterNetwork: diff --git a/api/hypershift/v1beta1/zz_generated.featuregated-crd-manifests/hostedclusters.hypershift.openshift.io/ImageStreamImportMode.yaml b/api/hypershift/v1beta1/zz_generated.featuregated-crd-manifests/hostedclusters.hypershift.openshift.io/ImageStreamImportMode.yaml index 5587abf97c55..61138ad6f4a4 100644 --- a/api/hypershift/v1beta1/zz_generated.featuregated-crd-manifests/hostedclusters.hypershift.openshift.io/ImageStreamImportMode.yaml +++ b/api/hypershift/v1beta1/zz_generated.featuregated-crd-manifests/hostedclusters.hypershift.openshift.io/ImageStreamImportMode.yaml @@ -2886,6 +2886,53 @@ spec: -kubebuilder:validation:XValidation:rule=`self.all(key, size(self[key]) <= 63 && self[key].matches('^(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])?$'))`, message="label value must be 63 characters or less (can be empty), consist of alphanumeric characters, dashes (-), underscores (_) or dots (.), and begin and end with an alphanumeric character" maxProperties: 20 type: object + monitoring: + description: |- + monitoring configures monitoring for the hosted cluster, including + forwarding of control plane metrics to the hosted cluster's monitoring stack. + When omitted, metrics forwarding behavior is determined by the + hypershift.openshift.io/enable-metrics-forwarding annotation for backward compatibility. + If neither is set, metrics forwarding is disabled. + minProperties: 1 + properties: + metricsForwarding: + description: |- + metricsForwarding configures forwarding of control plane metrics into + the hosted cluster's monitoring stack. + When omitted, metrics forwarding behavior is determined by the + hypershift.openshift.io/enable-metrics-forwarding annotation for backward compatibility. + If neither is set, metrics forwarding is disabled. + properties: + mode: + description: |- + mode controls whether metrics forwarding is active for this hosted cluster. + When set to "Forward", metrics-proxy and endpoint-resolver are deployed in the + control plane, and a metrics-forwarder is deployed in the hosted cluster. + When set to "None", metrics forwarding is inactive. + enum: + - Forward + - None + type: string + required: + - mode + type: object + metricsSet: + description: |- + metricsSet specifies which set of metrics to collect and forward. + This overrides the global METRICS_SET environment variable configured on the HyperShift Operator. + When not specified, the global METRICS_SET value is used, which defaults to "Telemetry". + + "Telemetry" collects only the minimal set of metrics required for OpenShift Telemetry. + "SRE" collects the Telemetry set plus additional metrics defined in the sre-metric-set ConfigMap, + needed for SRE dashboards and alerts. + "All" collects all metrics from control plane components without filtering, + which produces significantly higher metrics volume. + enum: + - Telemetry + - SRE + - All + type: string + type: object networking: default: clusterNetwork: diff --git a/api/hypershift/v1beta1/zz_generated.featuregated-crd-manifests/hostedclusters.hypershift.openshift.io/KMSEncryptionProvider.yaml b/api/hypershift/v1beta1/zz_generated.featuregated-crd-manifests/hostedclusters.hypershift.openshift.io/KMSEncryptionProvider.yaml index cad4d0b27bd6..4e6f9e23be51 100644 --- a/api/hypershift/v1beta1/zz_generated.featuregated-crd-manifests/hostedclusters.hypershift.openshift.io/KMSEncryptionProvider.yaml +++ b/api/hypershift/v1beta1/zz_generated.featuregated-crd-manifests/hostedclusters.hypershift.openshift.io/KMSEncryptionProvider.yaml @@ -2944,6 +2944,53 @@ spec: -kubebuilder:validation:XValidation:rule=`self.all(key, size(self[key]) <= 63 && self[key].matches('^(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])?$'))`, message="label value must be 63 characters or less (can be empty), consist of alphanumeric characters, dashes (-), underscores (_) or dots (.), and begin and end with an alphanumeric character" maxProperties: 20 type: object + monitoring: + description: |- + monitoring configures monitoring for the hosted cluster, including + forwarding of control plane metrics to the hosted cluster's monitoring stack. + When omitted, metrics forwarding behavior is determined by the + hypershift.openshift.io/enable-metrics-forwarding annotation for backward compatibility. + If neither is set, metrics forwarding is disabled. + minProperties: 1 + properties: + metricsForwarding: + description: |- + metricsForwarding configures forwarding of control plane metrics into + the hosted cluster's monitoring stack. + When omitted, metrics forwarding behavior is determined by the + hypershift.openshift.io/enable-metrics-forwarding annotation for backward compatibility. + If neither is set, metrics forwarding is disabled. + properties: + mode: + description: |- + mode controls whether metrics forwarding is active for this hosted cluster. + When set to "Forward", metrics-proxy and endpoint-resolver are deployed in the + control plane, and a metrics-forwarder is deployed in the hosted cluster. + When set to "None", metrics forwarding is inactive. + enum: + - Forward + - None + type: string + required: + - mode + type: object + metricsSet: + description: |- + metricsSet specifies which set of metrics to collect and forward. + This overrides the global METRICS_SET environment variable configured on the HyperShift Operator. + When not specified, the global METRICS_SET value is used, which defaults to "Telemetry". + + "Telemetry" collects only the minimal set of metrics required for OpenShift Telemetry. + "SRE" collects the Telemetry set plus additional metrics defined in the sre-metric-set ConfigMap, + needed for SRE dashboards and alerts. + "All" collects all metrics from control plane components without filtering, + which produces significantly higher metrics volume. + enum: + - Telemetry + - SRE + - All + type: string + type: object networking: default: clusterNetwork: diff --git a/api/hypershift/v1beta1/zz_generated.featuregated-crd-manifests/hostedclusters.hypershift.openshift.io/OpenStack.yaml b/api/hypershift/v1beta1/zz_generated.featuregated-crd-manifests/hostedclusters.hypershift.openshift.io/OpenStack.yaml index 5575f68fe822..062f1453a234 100644 --- a/api/hypershift/v1beta1/zz_generated.featuregated-crd-manifests/hostedclusters.hypershift.openshift.io/OpenStack.yaml +++ b/api/hypershift/v1beta1/zz_generated.featuregated-crd-manifests/hostedclusters.hypershift.openshift.io/OpenStack.yaml @@ -2868,6 +2868,53 @@ spec: -kubebuilder:validation:XValidation:rule=`self.all(key, size(self[key]) <= 63 && self[key].matches('^(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])?$'))`, message="label value must be 63 characters or less (can be empty), consist of alphanumeric characters, dashes (-), underscores (_) or dots (.), and begin and end with an alphanumeric character" maxProperties: 20 type: object + monitoring: + description: |- + monitoring configures monitoring for the hosted cluster, including + forwarding of control plane metrics to the hosted cluster's monitoring stack. + When omitted, metrics forwarding behavior is determined by the + hypershift.openshift.io/enable-metrics-forwarding annotation for backward compatibility. + If neither is set, metrics forwarding is disabled. + minProperties: 1 + properties: + metricsForwarding: + description: |- + metricsForwarding configures forwarding of control plane metrics into + the hosted cluster's monitoring stack. + When omitted, metrics forwarding behavior is determined by the + hypershift.openshift.io/enable-metrics-forwarding annotation for backward compatibility. + If neither is set, metrics forwarding is disabled. + properties: + mode: + description: |- + mode controls whether metrics forwarding is active for this hosted cluster. + When set to "Forward", metrics-proxy and endpoint-resolver are deployed in the + control plane, and a metrics-forwarder is deployed in the hosted cluster. + When set to "None", metrics forwarding is inactive. + enum: + - Forward + - None + type: string + required: + - mode + type: object + metricsSet: + description: |- + metricsSet specifies which set of metrics to collect and forward. + This overrides the global METRICS_SET environment variable configured on the HyperShift Operator. + When not specified, the global METRICS_SET value is used, which defaults to "Telemetry". + + "Telemetry" collects only the minimal set of metrics required for OpenShift Telemetry. + "SRE" collects the Telemetry set plus additional metrics defined in the sre-metric-set ConfigMap, + needed for SRE dashboards and alerts. + "All" collects all metrics from control plane components without filtering, + which produces significantly higher metrics volume. + enum: + - Telemetry + - SRE + - All + type: string + type: object networking: default: clusterNetwork: diff --git a/api/hypershift/v1beta1/zz_generated.featuregated-crd-manifests/hostedclusters.hypershift.openshift.io/TLSAdherence.yaml b/api/hypershift/v1beta1/zz_generated.featuregated-crd-manifests/hostedclusters.hypershift.openshift.io/TLSAdherence.yaml index 44d0d5ea7ba9..ee7e71dd2f96 100644 --- a/api/hypershift/v1beta1/zz_generated.featuregated-crd-manifests/hostedclusters.hypershift.openshift.io/TLSAdherence.yaml +++ b/api/hypershift/v1beta1/zz_generated.featuregated-crd-manifests/hostedclusters.hypershift.openshift.io/TLSAdherence.yaml @@ -2908,6 +2908,53 @@ spec: -kubebuilder:validation:XValidation:rule=`self.all(key, size(self[key]) <= 63 && self[key].matches('^(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])?$'))`, message="label value must be 63 characters or less (can be empty), consist of alphanumeric characters, dashes (-), underscores (_) or dots (.), and begin and end with an alphanumeric character" maxProperties: 20 type: object + monitoring: + description: |- + monitoring configures monitoring for the hosted cluster, including + forwarding of control plane metrics to the hosted cluster's monitoring stack. + When omitted, metrics forwarding behavior is determined by the + hypershift.openshift.io/enable-metrics-forwarding annotation for backward compatibility. + If neither is set, metrics forwarding is disabled. + minProperties: 1 + properties: + metricsForwarding: + description: |- + metricsForwarding configures forwarding of control plane metrics into + the hosted cluster's monitoring stack. + When omitted, metrics forwarding behavior is determined by the + hypershift.openshift.io/enable-metrics-forwarding annotation for backward compatibility. + If neither is set, metrics forwarding is disabled. + properties: + mode: + description: |- + mode controls whether metrics forwarding is active for this hosted cluster. + When set to "Forward", metrics-proxy and endpoint-resolver are deployed in the + control plane, and a metrics-forwarder is deployed in the hosted cluster. + When set to "None", metrics forwarding is inactive. + enum: + - Forward + - None + type: string + required: + - mode + type: object + metricsSet: + description: |- + metricsSet specifies which set of metrics to collect and forward. + This overrides the global METRICS_SET environment variable configured on the HyperShift Operator. + When not specified, the global METRICS_SET value is used, which defaults to "Telemetry". + + "Telemetry" collects only the minimal set of metrics required for OpenShift Telemetry. + "SRE" collects the Telemetry set plus additional metrics defined in the sre-metric-set ConfigMap, + needed for SRE dashboards and alerts. + "All" collects all metrics from control plane components without filtering, + which produces significantly higher metrics volume. + enum: + - Telemetry + - SRE + - All + type: string + type: object networking: default: clusterNetwork: diff --git a/api/hypershift/v1beta1/zz_generated.featuregated-crd-manifests/hostedcontrolplanes.hypershift.openshift.io/AAA_ungated.yaml b/api/hypershift/v1beta1/zz_generated.featuregated-crd-manifests/hostedcontrolplanes.hypershift.openshift.io/AAA_ungated.yaml index 52537f51278c..964c8665065b 100644 --- a/api/hypershift/v1beta1/zz_generated.featuregated-crd-manifests/hostedcontrolplanes.hypershift.openshift.io/AAA_ungated.yaml +++ b/api/hypershift/v1beta1/zz_generated.featuregated-crd-manifests/hostedcontrolplanes.hypershift.openshift.io/AAA_ungated.yaml @@ -2779,6 +2779,51 @@ spec: -kubebuilder:validation:XValidation:rule=`self.all(key, size(self[key]) <= 63 && self[key].matches('^(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])?$'))`, message="label value must be 63 characters or less (can be empty), consist of alphanumeric characters, dashes (-), underscores (_) or dots (.), and begin and end with an alphanumeric character" maxProperties: 20 type: object + monitoring: + description: |- + monitoring configures monitoring for the hosted cluster, including + forwarding of control plane metrics to the hosted cluster's monitoring stack. + When omitted, metrics forwarding is not configured and will be inactive. + minProperties: 1 + properties: + metricsForwarding: + description: |- + metricsForwarding configures forwarding of control plane metrics into + the hosted cluster's monitoring stack. + When omitted, metrics forwarding behavior is determined by the + hypershift.openshift.io/enable-metrics-forwarding annotation for backward compatibility. + If neither is set, metrics forwarding is disabled. + properties: + mode: + description: |- + mode controls whether metrics forwarding is active for this hosted cluster. + When set to "Forward", metrics-proxy and endpoint-resolver are deployed in the + control plane, and a metrics-forwarder is deployed in the hosted cluster. + When set to "None", metrics forwarding is inactive. + enum: + - Forward + - None + type: string + required: + - mode + type: object + metricsSet: + description: |- + metricsSet specifies which set of metrics to collect and forward. + This overrides the global METRICS_SET environment variable configured on the HyperShift Operator. + When not specified, the global METRICS_SET value is used, which defaults to "Telemetry". + + "Telemetry" collects only the minimal set of metrics required for OpenShift Telemetry. + "SRE" collects the Telemetry set plus additional metrics defined in the sre-metric-set ConfigMap, + needed for SRE dashboards and alerts. + "All" collects all metrics from control plane components without filtering, + which produces significantly higher metrics volume. + enum: + - Telemetry + - SRE + - All + type: string + type: object networking: description: |- networking specifies network configuration for the cluster. diff --git a/api/hypershift/v1beta1/zz_generated.featuregated-crd-manifests/hostedcontrolplanes.hypershift.openshift.io/ClusterUpdateAcceptRisks.yaml b/api/hypershift/v1beta1/zz_generated.featuregated-crd-manifests/hostedcontrolplanes.hypershift.openshift.io/ClusterUpdateAcceptRisks.yaml index 134afaece5c9..10f467f7fd9c 100644 --- a/api/hypershift/v1beta1/zz_generated.featuregated-crd-manifests/hostedcontrolplanes.hypershift.openshift.io/ClusterUpdateAcceptRisks.yaml +++ b/api/hypershift/v1beta1/zz_generated.featuregated-crd-manifests/hostedcontrolplanes.hypershift.openshift.io/ClusterUpdateAcceptRisks.yaml @@ -2770,6 +2770,51 @@ spec: -kubebuilder:validation:XValidation:rule=`self.all(key, size(self[key]) <= 63 && self[key].matches('^(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])?$'))`, message="label value must be 63 characters or less (can be empty), consist of alphanumeric characters, dashes (-), underscores (_) or dots (.), and begin and end with an alphanumeric character" maxProperties: 20 type: object + monitoring: + description: |- + monitoring configures monitoring for the hosted cluster, including + forwarding of control plane metrics to the hosted cluster's monitoring stack. + When omitted, metrics forwarding is not configured and will be inactive. + minProperties: 1 + properties: + metricsForwarding: + description: |- + metricsForwarding configures forwarding of control plane metrics into + the hosted cluster's monitoring stack. + When omitted, metrics forwarding behavior is determined by the + hypershift.openshift.io/enable-metrics-forwarding annotation for backward compatibility. + If neither is set, metrics forwarding is disabled. + properties: + mode: + description: |- + mode controls whether metrics forwarding is active for this hosted cluster. + When set to "Forward", metrics-proxy and endpoint-resolver are deployed in the + control plane, and a metrics-forwarder is deployed in the hosted cluster. + When set to "None", metrics forwarding is inactive. + enum: + - Forward + - None + type: string + required: + - mode + type: object + metricsSet: + description: |- + metricsSet specifies which set of metrics to collect and forward. + This overrides the global METRICS_SET environment variable configured on the HyperShift Operator. + When not specified, the global METRICS_SET value is used, which defaults to "Telemetry". + + "Telemetry" collects only the minimal set of metrics required for OpenShift Telemetry. + "SRE" collects the Telemetry set plus additional metrics defined in the sre-metric-set ConfigMap, + needed for SRE dashboards and alerts. + "All" collects all metrics from control plane components without filtering, + which produces significantly higher metrics volume. + enum: + - Telemetry + - SRE + - All + type: string + type: object networking: description: |- networking specifies network configuration for the cluster. diff --git a/api/hypershift/v1beta1/zz_generated.featuregated-crd-manifests/hostedcontrolplanes.hypershift.openshift.io/ClusterVersionOperatorConfiguration.yaml b/api/hypershift/v1beta1/zz_generated.featuregated-crd-manifests/hostedcontrolplanes.hypershift.openshift.io/ClusterVersionOperatorConfiguration.yaml index b789374f6929..82179855b362 100644 --- a/api/hypershift/v1beta1/zz_generated.featuregated-crd-manifests/hostedcontrolplanes.hypershift.openshift.io/ClusterVersionOperatorConfiguration.yaml +++ b/api/hypershift/v1beta1/zz_generated.featuregated-crd-manifests/hostedcontrolplanes.hypershift.openshift.io/ClusterVersionOperatorConfiguration.yaml @@ -2770,6 +2770,51 @@ spec: -kubebuilder:validation:XValidation:rule=`self.all(key, size(self[key]) <= 63 && self[key].matches('^(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])?$'))`, message="label value must be 63 characters or less (can be empty), consist of alphanumeric characters, dashes (-), underscores (_) or dots (.), and begin and end with an alphanumeric character" maxProperties: 20 type: object + monitoring: + description: |- + monitoring configures monitoring for the hosted cluster, including + forwarding of control plane metrics to the hosted cluster's monitoring stack. + When omitted, metrics forwarding is not configured and will be inactive. + minProperties: 1 + properties: + metricsForwarding: + description: |- + metricsForwarding configures forwarding of control plane metrics into + the hosted cluster's monitoring stack. + When omitted, metrics forwarding behavior is determined by the + hypershift.openshift.io/enable-metrics-forwarding annotation for backward compatibility. + If neither is set, metrics forwarding is disabled. + properties: + mode: + description: |- + mode controls whether metrics forwarding is active for this hosted cluster. + When set to "Forward", metrics-proxy and endpoint-resolver are deployed in the + control plane, and a metrics-forwarder is deployed in the hosted cluster. + When set to "None", metrics forwarding is inactive. + enum: + - Forward + - None + type: string + required: + - mode + type: object + metricsSet: + description: |- + metricsSet specifies which set of metrics to collect and forward. + This overrides the global METRICS_SET environment variable configured on the HyperShift Operator. + When not specified, the global METRICS_SET value is used, which defaults to "Telemetry". + + "Telemetry" collects only the minimal set of metrics required for OpenShift Telemetry. + "SRE" collects the Telemetry set plus additional metrics defined in the sre-metric-set ConfigMap, + needed for SRE dashboards and alerts. + "All" collects all metrics from control plane components without filtering, + which produces significantly higher metrics volume. + enum: + - Telemetry + - SRE + - All + type: string + type: object networking: description: |- networking specifies network configuration for the cluster. diff --git a/api/hypershift/v1beta1/zz_generated.featuregated-crd-manifests/hostedcontrolplanes.hypershift.openshift.io/ExternalOIDC.yaml b/api/hypershift/v1beta1/zz_generated.featuregated-crd-manifests/hostedcontrolplanes.hypershift.openshift.io/ExternalOIDC.yaml index 79baf6256a0f..b183508c7f5d 100644 --- a/api/hypershift/v1beta1/zz_generated.featuregated-crd-manifests/hostedcontrolplanes.hypershift.openshift.io/ExternalOIDC.yaml +++ b/api/hypershift/v1beta1/zz_generated.featuregated-crd-manifests/hostedcontrolplanes.hypershift.openshift.io/ExternalOIDC.yaml @@ -3102,6 +3102,51 @@ spec: -kubebuilder:validation:XValidation:rule=`self.all(key, size(self[key]) <= 63 && self[key].matches('^(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])?$'))`, message="label value must be 63 characters or less (can be empty), consist of alphanumeric characters, dashes (-), underscores (_) or dots (.), and begin and end with an alphanumeric character" maxProperties: 20 type: object + monitoring: + description: |- + monitoring configures monitoring for the hosted cluster, including + forwarding of control plane metrics to the hosted cluster's monitoring stack. + When omitted, metrics forwarding is not configured and will be inactive. + minProperties: 1 + properties: + metricsForwarding: + description: |- + metricsForwarding configures forwarding of control plane metrics into + the hosted cluster's monitoring stack. + When omitted, metrics forwarding behavior is determined by the + hypershift.openshift.io/enable-metrics-forwarding annotation for backward compatibility. + If neither is set, metrics forwarding is disabled. + properties: + mode: + description: |- + mode controls whether metrics forwarding is active for this hosted cluster. + When set to "Forward", metrics-proxy and endpoint-resolver are deployed in the + control plane, and a metrics-forwarder is deployed in the hosted cluster. + When set to "None", metrics forwarding is inactive. + enum: + - Forward + - None + type: string + required: + - mode + type: object + metricsSet: + description: |- + metricsSet specifies which set of metrics to collect and forward. + This overrides the global METRICS_SET environment variable configured on the HyperShift Operator. + When not specified, the global METRICS_SET value is used, which defaults to "Telemetry". + + "Telemetry" collects only the minimal set of metrics required for OpenShift Telemetry. + "SRE" collects the Telemetry set plus additional metrics defined in the sre-metric-set ConfigMap, + needed for SRE dashboards and alerts. + "All" collects all metrics from control plane components without filtering, + which produces significantly higher metrics volume. + enum: + - Telemetry + - SRE + - All + type: string + type: object networking: description: |- networking specifies network configuration for the cluster. diff --git a/api/hypershift/v1beta1/zz_generated.featuregated-crd-manifests/hostedcontrolplanes.hypershift.openshift.io/ExternalOIDCWithUIDAndExtraClaimMappings.yaml b/api/hypershift/v1beta1/zz_generated.featuregated-crd-manifests/hostedcontrolplanes.hypershift.openshift.io/ExternalOIDCWithUIDAndExtraClaimMappings.yaml index fd637d9a5cee..bf5e25518e03 100644 --- a/api/hypershift/v1beta1/zz_generated.featuregated-crd-manifests/hostedcontrolplanes.hypershift.openshift.io/ExternalOIDCWithUIDAndExtraClaimMappings.yaml +++ b/api/hypershift/v1beta1/zz_generated.featuregated-crd-manifests/hostedcontrolplanes.hypershift.openshift.io/ExternalOIDCWithUIDAndExtraClaimMappings.yaml @@ -3242,6 +3242,51 @@ spec: -kubebuilder:validation:XValidation:rule=`self.all(key, size(self[key]) <= 63 && self[key].matches('^(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])?$'))`, message="label value must be 63 characters or less (can be empty), consist of alphanumeric characters, dashes (-), underscores (_) or dots (.), and begin and end with an alphanumeric character" maxProperties: 20 type: object + monitoring: + description: |- + monitoring configures monitoring for the hosted cluster, including + forwarding of control plane metrics to the hosted cluster's monitoring stack. + When omitted, metrics forwarding is not configured and will be inactive. + minProperties: 1 + properties: + metricsForwarding: + description: |- + metricsForwarding configures forwarding of control plane metrics into + the hosted cluster's monitoring stack. + When omitted, metrics forwarding behavior is determined by the + hypershift.openshift.io/enable-metrics-forwarding annotation for backward compatibility. + If neither is set, metrics forwarding is disabled. + properties: + mode: + description: |- + mode controls whether metrics forwarding is active for this hosted cluster. + When set to "Forward", metrics-proxy and endpoint-resolver are deployed in the + control plane, and a metrics-forwarder is deployed in the hosted cluster. + When set to "None", metrics forwarding is inactive. + enum: + - Forward + - None + type: string + required: + - mode + type: object + metricsSet: + description: |- + metricsSet specifies which set of metrics to collect and forward. + This overrides the global METRICS_SET environment variable configured on the HyperShift Operator. + When not specified, the global METRICS_SET value is used, which defaults to "Telemetry". + + "Telemetry" collects only the minimal set of metrics required for OpenShift Telemetry. + "SRE" collects the Telemetry set plus additional metrics defined in the sre-metric-set ConfigMap, + needed for SRE dashboards and alerts. + "All" collects all metrics from control plane components without filtering, + which produces significantly higher metrics volume. + enum: + - Telemetry + - SRE + - All + type: string + type: object networking: description: |- networking specifies network configuration for the cluster. diff --git a/api/hypershift/v1beta1/zz_generated.featuregated-crd-manifests/hostedcontrolplanes.hypershift.openshift.io/ExternalOIDCWithUpstreamParity.yaml b/api/hypershift/v1beta1/zz_generated.featuregated-crd-manifests/hostedcontrolplanes.hypershift.openshift.io/ExternalOIDCWithUpstreamParity.yaml index a9d109aaed49..77e7e2636cf1 100644 --- a/api/hypershift/v1beta1/zz_generated.featuregated-crd-manifests/hostedcontrolplanes.hypershift.openshift.io/ExternalOIDCWithUpstreamParity.yaml +++ b/api/hypershift/v1beta1/zz_generated.featuregated-crd-manifests/hostedcontrolplanes.hypershift.openshift.io/ExternalOIDCWithUpstreamParity.yaml @@ -3233,6 +3233,51 @@ spec: -kubebuilder:validation:XValidation:rule=`self.all(key, size(self[key]) <= 63 && self[key].matches('^(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])?$'))`, message="label value must be 63 characters or less (can be empty), consist of alphanumeric characters, dashes (-), underscores (_) or dots (.), and begin and end with an alphanumeric character" maxProperties: 20 type: object + monitoring: + description: |- + monitoring configures monitoring for the hosted cluster, including + forwarding of control plane metrics to the hosted cluster's monitoring stack. + When omitted, metrics forwarding is not configured and will be inactive. + minProperties: 1 + properties: + metricsForwarding: + description: |- + metricsForwarding configures forwarding of control plane metrics into + the hosted cluster's monitoring stack. + When omitted, metrics forwarding behavior is determined by the + hypershift.openshift.io/enable-metrics-forwarding annotation for backward compatibility. + If neither is set, metrics forwarding is disabled. + properties: + mode: + description: |- + mode controls whether metrics forwarding is active for this hosted cluster. + When set to "Forward", metrics-proxy and endpoint-resolver are deployed in the + control plane, and a metrics-forwarder is deployed in the hosted cluster. + When set to "None", metrics forwarding is inactive. + enum: + - Forward + - None + type: string + required: + - mode + type: object + metricsSet: + description: |- + metricsSet specifies which set of metrics to collect and forward. + This overrides the global METRICS_SET environment variable configured on the HyperShift Operator. + When not specified, the global METRICS_SET value is used, which defaults to "Telemetry". + + "Telemetry" collects only the minimal set of metrics required for OpenShift Telemetry. + "SRE" collects the Telemetry set plus additional metrics defined in the sre-metric-set ConfigMap, + needed for SRE dashboards and alerts. + "All" collects all metrics from control plane components without filtering, + which produces significantly higher metrics volume. + enum: + - Telemetry + - SRE + - All + type: string + type: object networking: description: |- networking specifies network configuration for the cluster. diff --git a/api/hypershift/v1beta1/zz_generated.featuregated-crd-manifests/hostedcontrolplanes.hypershift.openshift.io/GCPPlatform.yaml b/api/hypershift/v1beta1/zz_generated.featuregated-crd-manifests/hostedcontrolplanes.hypershift.openshift.io/GCPPlatform.yaml index c0a24c55b033..62f36f3a753f 100644 --- a/api/hypershift/v1beta1/zz_generated.featuregated-crd-manifests/hostedcontrolplanes.hypershift.openshift.io/GCPPlatform.yaml +++ b/api/hypershift/v1beta1/zz_generated.featuregated-crd-manifests/hostedcontrolplanes.hypershift.openshift.io/GCPPlatform.yaml @@ -2770,6 +2770,51 @@ spec: -kubebuilder:validation:XValidation:rule=`self.all(key, size(self[key]) <= 63 && self[key].matches('^(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])?$'))`, message="label value must be 63 characters or less (can be empty), consist of alphanumeric characters, dashes (-), underscores (_) or dots (.), and begin and end with an alphanumeric character" maxProperties: 20 type: object + monitoring: + description: |- + monitoring configures monitoring for the hosted cluster, including + forwarding of control plane metrics to the hosted cluster's monitoring stack. + When omitted, metrics forwarding is not configured and will be inactive. + minProperties: 1 + properties: + metricsForwarding: + description: |- + metricsForwarding configures forwarding of control plane metrics into + the hosted cluster's monitoring stack. + When omitted, metrics forwarding behavior is determined by the + hypershift.openshift.io/enable-metrics-forwarding annotation for backward compatibility. + If neither is set, metrics forwarding is disabled. + properties: + mode: + description: |- + mode controls whether metrics forwarding is active for this hosted cluster. + When set to "Forward", metrics-proxy and endpoint-resolver are deployed in the + control plane, and a metrics-forwarder is deployed in the hosted cluster. + When set to "None", metrics forwarding is inactive. + enum: + - Forward + - None + type: string + required: + - mode + type: object + metricsSet: + description: |- + metricsSet specifies which set of metrics to collect and forward. + This overrides the global METRICS_SET environment variable configured on the HyperShift Operator. + When not specified, the global METRICS_SET value is used, which defaults to "Telemetry". + + "Telemetry" collects only the minimal set of metrics required for OpenShift Telemetry. + "SRE" collects the Telemetry set plus additional metrics defined in the sre-metric-set ConfigMap, + needed for SRE dashboards and alerts. + "All" collects all metrics from control plane components without filtering, + which produces significantly higher metrics volume. + enum: + - Telemetry + - SRE + - All + type: string + type: object networking: description: |- networking specifies network configuration for the cluster. diff --git a/api/hypershift/v1beta1/zz_generated.featuregated-crd-manifests/hostedcontrolplanes.hypershift.openshift.io/HCPEtcdBackup.yaml b/api/hypershift/v1beta1/zz_generated.featuregated-crd-manifests/hostedcontrolplanes.hypershift.openshift.io/HCPEtcdBackup.yaml index 6edc6f5b80aa..3fc6830451e8 100644 --- a/api/hypershift/v1beta1/zz_generated.featuregated-crd-manifests/hostedcontrolplanes.hypershift.openshift.io/HCPEtcdBackup.yaml +++ b/api/hypershift/v1beta1/zz_generated.featuregated-crd-manifests/hostedcontrolplanes.hypershift.openshift.io/HCPEtcdBackup.yaml @@ -2835,6 +2835,51 @@ spec: -kubebuilder:validation:XValidation:rule=`self.all(key, size(self[key]) <= 63 && self[key].matches('^(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])?$'))`, message="label value must be 63 characters or less (can be empty), consist of alphanumeric characters, dashes (-), underscores (_) or dots (.), and begin and end with an alphanumeric character" maxProperties: 20 type: object + monitoring: + description: |- + monitoring configures monitoring for the hosted cluster, including + forwarding of control plane metrics to the hosted cluster's monitoring stack. + When omitted, metrics forwarding is not configured and will be inactive. + minProperties: 1 + properties: + metricsForwarding: + description: |- + metricsForwarding configures forwarding of control plane metrics into + the hosted cluster's monitoring stack. + When omitted, metrics forwarding behavior is determined by the + hypershift.openshift.io/enable-metrics-forwarding annotation for backward compatibility. + If neither is set, metrics forwarding is disabled. + properties: + mode: + description: |- + mode controls whether metrics forwarding is active for this hosted cluster. + When set to "Forward", metrics-proxy and endpoint-resolver are deployed in the + control plane, and a metrics-forwarder is deployed in the hosted cluster. + When set to "None", metrics forwarding is inactive. + enum: + - Forward + - None + type: string + required: + - mode + type: object + metricsSet: + description: |- + metricsSet specifies which set of metrics to collect and forward. + This overrides the global METRICS_SET environment variable configured on the HyperShift Operator. + When not specified, the global METRICS_SET value is used, which defaults to "Telemetry". + + "Telemetry" collects only the minimal set of metrics required for OpenShift Telemetry. + "SRE" collects the Telemetry set plus additional metrics defined in the sre-metric-set ConfigMap, + needed for SRE dashboards and alerts. + "All" collects all metrics from control plane components without filtering, + which produces significantly higher metrics volume. + enum: + - Telemetry + - SRE + - All + type: string + type: object networking: description: |- networking specifies network configuration for the cluster. diff --git a/api/hypershift/v1beta1/zz_generated.featuregated-crd-manifests/hostedcontrolplanes.hypershift.openshift.io/HyperShiftOnlyDynamicResourceAllocation.yaml b/api/hypershift/v1beta1/zz_generated.featuregated-crd-manifests/hostedcontrolplanes.hypershift.openshift.io/HyperShiftOnlyDynamicResourceAllocation.yaml index 8f7e6c8fdcfe..2284146766ca 100644 --- a/api/hypershift/v1beta1/zz_generated.featuregated-crd-manifests/hostedcontrolplanes.hypershift.openshift.io/HyperShiftOnlyDynamicResourceAllocation.yaml +++ b/api/hypershift/v1beta1/zz_generated.featuregated-crd-manifests/hostedcontrolplanes.hypershift.openshift.io/HyperShiftOnlyDynamicResourceAllocation.yaml @@ -2792,6 +2792,51 @@ spec: -kubebuilder:validation:XValidation:rule=`self.all(key, size(self[key]) <= 63 && self[key].matches('^(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])?$'))`, message="label value must be 63 characters or less (can be empty), consist of alphanumeric characters, dashes (-), underscores (_) or dots (.), and begin and end with an alphanumeric character" maxProperties: 20 type: object + monitoring: + description: |- + monitoring configures monitoring for the hosted cluster, including + forwarding of control plane metrics to the hosted cluster's monitoring stack. + When omitted, metrics forwarding is not configured and will be inactive. + minProperties: 1 + properties: + metricsForwarding: + description: |- + metricsForwarding configures forwarding of control plane metrics into + the hosted cluster's monitoring stack. + When omitted, metrics forwarding behavior is determined by the + hypershift.openshift.io/enable-metrics-forwarding annotation for backward compatibility. + If neither is set, metrics forwarding is disabled. + properties: + mode: + description: |- + mode controls whether metrics forwarding is active for this hosted cluster. + When set to "Forward", metrics-proxy and endpoint-resolver are deployed in the + control plane, and a metrics-forwarder is deployed in the hosted cluster. + When set to "None", metrics forwarding is inactive. + enum: + - Forward + - None + type: string + required: + - mode + type: object + metricsSet: + description: |- + metricsSet specifies which set of metrics to collect and forward. + This overrides the global METRICS_SET environment variable configured on the HyperShift Operator. + When not specified, the global METRICS_SET value is used, which defaults to "Telemetry". + + "Telemetry" collects only the minimal set of metrics required for OpenShift Telemetry. + "SRE" collects the Telemetry set plus additional metrics defined in the sre-metric-set ConfigMap, + needed for SRE dashboards and alerts. + "All" collects all metrics from control plane components without filtering, + which produces significantly higher metrics volume. + enum: + - Telemetry + - SRE + - All + type: string + type: object networking: description: |- networking specifies network configuration for the cluster. diff --git a/api/hypershift/v1beta1/zz_generated.featuregated-crd-manifests/hostedcontrolplanes.hypershift.openshift.io/ImageStreamImportMode.yaml b/api/hypershift/v1beta1/zz_generated.featuregated-crd-manifests/hostedcontrolplanes.hypershift.openshift.io/ImageStreamImportMode.yaml index 3b3e79aa5494..b8e43647e4a3 100644 --- a/api/hypershift/v1beta1/zz_generated.featuregated-crd-manifests/hostedcontrolplanes.hypershift.openshift.io/ImageStreamImportMode.yaml +++ b/api/hypershift/v1beta1/zz_generated.featuregated-crd-manifests/hostedcontrolplanes.hypershift.openshift.io/ImageStreamImportMode.yaml @@ -2788,6 +2788,51 @@ spec: -kubebuilder:validation:XValidation:rule=`self.all(key, size(self[key]) <= 63 && self[key].matches('^(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])?$'))`, message="label value must be 63 characters or less (can be empty), consist of alphanumeric characters, dashes (-), underscores (_) or dots (.), and begin and end with an alphanumeric character" maxProperties: 20 type: object + monitoring: + description: |- + monitoring configures monitoring for the hosted cluster, including + forwarding of control plane metrics to the hosted cluster's monitoring stack. + When omitted, metrics forwarding is not configured and will be inactive. + minProperties: 1 + properties: + metricsForwarding: + description: |- + metricsForwarding configures forwarding of control plane metrics into + the hosted cluster's monitoring stack. + When omitted, metrics forwarding behavior is determined by the + hypershift.openshift.io/enable-metrics-forwarding annotation for backward compatibility. + If neither is set, metrics forwarding is disabled. + properties: + mode: + description: |- + mode controls whether metrics forwarding is active for this hosted cluster. + When set to "Forward", metrics-proxy and endpoint-resolver are deployed in the + control plane, and a metrics-forwarder is deployed in the hosted cluster. + When set to "None", metrics forwarding is inactive. + enum: + - Forward + - None + type: string + required: + - mode + type: object + metricsSet: + description: |- + metricsSet specifies which set of metrics to collect and forward. + This overrides the global METRICS_SET environment variable configured on the HyperShift Operator. + When not specified, the global METRICS_SET value is used, which defaults to "Telemetry". + + "Telemetry" collects only the minimal set of metrics required for OpenShift Telemetry. + "SRE" collects the Telemetry set plus additional metrics defined in the sre-metric-set ConfigMap, + needed for SRE dashboards and alerts. + "All" collects all metrics from control plane components without filtering, + which produces significantly higher metrics volume. + enum: + - Telemetry + - SRE + - All + type: string + type: object networking: description: |- networking specifies network configuration for the cluster. diff --git a/api/hypershift/v1beta1/zz_generated.featuregated-crd-manifests/hostedcontrolplanes.hypershift.openshift.io/KMSEncryptionProvider.yaml b/api/hypershift/v1beta1/zz_generated.featuregated-crd-manifests/hostedcontrolplanes.hypershift.openshift.io/KMSEncryptionProvider.yaml index 950995af685b..7711978bccb7 100644 --- a/api/hypershift/v1beta1/zz_generated.featuregated-crd-manifests/hostedcontrolplanes.hypershift.openshift.io/KMSEncryptionProvider.yaml +++ b/api/hypershift/v1beta1/zz_generated.featuregated-crd-manifests/hostedcontrolplanes.hypershift.openshift.io/KMSEncryptionProvider.yaml @@ -2846,6 +2846,51 @@ spec: -kubebuilder:validation:XValidation:rule=`self.all(key, size(self[key]) <= 63 && self[key].matches('^(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])?$'))`, message="label value must be 63 characters or less (can be empty), consist of alphanumeric characters, dashes (-), underscores (_) or dots (.), and begin and end with an alphanumeric character" maxProperties: 20 type: object + monitoring: + description: |- + monitoring configures monitoring for the hosted cluster, including + forwarding of control plane metrics to the hosted cluster's monitoring stack. + When omitted, metrics forwarding is not configured and will be inactive. + minProperties: 1 + properties: + metricsForwarding: + description: |- + metricsForwarding configures forwarding of control plane metrics into + the hosted cluster's monitoring stack. + When omitted, metrics forwarding behavior is determined by the + hypershift.openshift.io/enable-metrics-forwarding annotation for backward compatibility. + If neither is set, metrics forwarding is disabled. + properties: + mode: + description: |- + mode controls whether metrics forwarding is active for this hosted cluster. + When set to "Forward", metrics-proxy and endpoint-resolver are deployed in the + control plane, and a metrics-forwarder is deployed in the hosted cluster. + When set to "None", metrics forwarding is inactive. + enum: + - Forward + - None + type: string + required: + - mode + type: object + metricsSet: + description: |- + metricsSet specifies which set of metrics to collect and forward. + This overrides the global METRICS_SET environment variable configured on the HyperShift Operator. + When not specified, the global METRICS_SET value is used, which defaults to "Telemetry". + + "Telemetry" collects only the minimal set of metrics required for OpenShift Telemetry. + "SRE" collects the Telemetry set plus additional metrics defined in the sre-metric-set ConfigMap, + needed for SRE dashboards and alerts. + "All" collects all metrics from control plane components without filtering, + which produces significantly higher metrics volume. + enum: + - Telemetry + - SRE + - All + type: string + type: object networking: description: |- networking specifies network configuration for the cluster. diff --git a/api/hypershift/v1beta1/zz_generated.featuregated-crd-manifests/hostedcontrolplanes.hypershift.openshift.io/OpenStack.yaml b/api/hypershift/v1beta1/zz_generated.featuregated-crd-manifests/hostedcontrolplanes.hypershift.openshift.io/OpenStack.yaml index abaca481eb73..0a25883e120f 100644 --- a/api/hypershift/v1beta1/zz_generated.featuregated-crd-manifests/hostedcontrolplanes.hypershift.openshift.io/OpenStack.yaml +++ b/api/hypershift/v1beta1/zz_generated.featuregated-crd-manifests/hostedcontrolplanes.hypershift.openshift.io/OpenStack.yaml @@ -2770,6 +2770,51 @@ spec: -kubebuilder:validation:XValidation:rule=`self.all(key, size(self[key]) <= 63 && self[key].matches('^(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])?$'))`, message="label value must be 63 characters or less (can be empty), consist of alphanumeric characters, dashes (-), underscores (_) or dots (.), and begin and end with an alphanumeric character" maxProperties: 20 type: object + monitoring: + description: |- + monitoring configures monitoring for the hosted cluster, including + forwarding of control plane metrics to the hosted cluster's monitoring stack. + When omitted, metrics forwarding is not configured and will be inactive. + minProperties: 1 + properties: + metricsForwarding: + description: |- + metricsForwarding configures forwarding of control plane metrics into + the hosted cluster's monitoring stack. + When omitted, metrics forwarding behavior is determined by the + hypershift.openshift.io/enable-metrics-forwarding annotation for backward compatibility. + If neither is set, metrics forwarding is disabled. + properties: + mode: + description: |- + mode controls whether metrics forwarding is active for this hosted cluster. + When set to "Forward", metrics-proxy and endpoint-resolver are deployed in the + control plane, and a metrics-forwarder is deployed in the hosted cluster. + When set to "None", metrics forwarding is inactive. + enum: + - Forward + - None + type: string + required: + - mode + type: object + metricsSet: + description: |- + metricsSet specifies which set of metrics to collect and forward. + This overrides the global METRICS_SET environment variable configured on the HyperShift Operator. + When not specified, the global METRICS_SET value is used, which defaults to "Telemetry". + + "Telemetry" collects only the minimal set of metrics required for OpenShift Telemetry. + "SRE" collects the Telemetry set plus additional metrics defined in the sre-metric-set ConfigMap, + needed for SRE dashboards and alerts. + "All" collects all metrics from control plane components without filtering, + which produces significantly higher metrics volume. + enum: + - Telemetry + - SRE + - All + type: string + type: object networking: description: |- networking specifies network configuration for the cluster. diff --git a/api/hypershift/v1beta1/zz_generated.featuregated-crd-manifests/hostedcontrolplanes.hypershift.openshift.io/TLSAdherence.yaml b/api/hypershift/v1beta1/zz_generated.featuregated-crd-manifests/hostedcontrolplanes.hypershift.openshift.io/TLSAdherence.yaml index d96d79c33ae3..a8ea56299e7f 100644 --- a/api/hypershift/v1beta1/zz_generated.featuregated-crd-manifests/hostedcontrolplanes.hypershift.openshift.io/TLSAdherence.yaml +++ b/api/hypershift/v1beta1/zz_generated.featuregated-crd-manifests/hostedcontrolplanes.hypershift.openshift.io/TLSAdherence.yaml @@ -2810,6 +2810,51 @@ spec: -kubebuilder:validation:XValidation:rule=`self.all(key, size(self[key]) <= 63 && self[key].matches('^(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])?$'))`, message="label value must be 63 characters or less (can be empty), consist of alphanumeric characters, dashes (-), underscores (_) or dots (.), and begin and end with an alphanumeric character" maxProperties: 20 type: object + monitoring: + description: |- + monitoring configures monitoring for the hosted cluster, including + forwarding of control plane metrics to the hosted cluster's monitoring stack. + When omitted, metrics forwarding is not configured and will be inactive. + minProperties: 1 + properties: + metricsForwarding: + description: |- + metricsForwarding configures forwarding of control plane metrics into + the hosted cluster's monitoring stack. + When omitted, metrics forwarding behavior is determined by the + hypershift.openshift.io/enable-metrics-forwarding annotation for backward compatibility. + If neither is set, metrics forwarding is disabled. + properties: + mode: + description: |- + mode controls whether metrics forwarding is active for this hosted cluster. + When set to "Forward", metrics-proxy and endpoint-resolver are deployed in the + control plane, and a metrics-forwarder is deployed in the hosted cluster. + When set to "None", metrics forwarding is inactive. + enum: + - Forward + - None + type: string + required: + - mode + type: object + metricsSet: + description: |- + metricsSet specifies which set of metrics to collect and forward. + This overrides the global METRICS_SET environment variable configured on the HyperShift Operator. + When not specified, the global METRICS_SET value is used, which defaults to "Telemetry". + + "Telemetry" collects only the minimal set of metrics required for OpenShift Telemetry. + "SRE" collects the Telemetry set plus additional metrics defined in the sre-metric-set ConfigMap, + needed for SRE dashboards and alerts. + "All" collects all metrics from control plane components without filtering, + which produces significantly higher metrics volume. + enum: + - Telemetry + - SRE + - All + type: string + type: object networking: description: |- networking specifies network configuration for the cluster. diff --git a/client/applyconfiguration/hypershift/v1beta1/hostedclusterspec.go b/client/applyconfiguration/hypershift/v1beta1/hostedclusterspec.go index 4f13f8c36935..62eaf6849716 100644 --- a/client/applyconfiguration/hypershift/v1beta1/hostedclusterspec.go +++ b/client/applyconfiguration/hypershift/v1beta1/hostedclusterspec.go @@ -59,6 +59,7 @@ type HostedClusterSpecApplyConfiguration struct { Tolerations []corev1.Toleration `json:"tolerations,omitempty"` Labels map[string]string `json:"labels,omitempty"` Capabilities *CapabilitiesApplyConfiguration `json:"capabilities,omitempty"` + Monitoring *MonitoringSpecApplyConfiguration `json:"monitoring,omitempty"` } // HostedClusterSpecApplyConfiguration constructs a declarative configuration of the HostedClusterSpec type for use with @@ -354,3 +355,11 @@ func (b *HostedClusterSpecApplyConfiguration) WithCapabilities(value *Capabiliti b.Capabilities = value return b } + +// WithMonitoring sets the Monitoring field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Monitoring field is set to the value of the last call. +func (b *HostedClusterSpecApplyConfiguration) WithMonitoring(value *MonitoringSpecApplyConfiguration) *HostedClusterSpecApplyConfiguration { + b.Monitoring = value + return b +} diff --git a/client/applyconfiguration/hypershift/v1beta1/hostedcontrolplanespec.go b/client/applyconfiguration/hypershift/v1beta1/hostedcontrolplanespec.go index e1387bb9f9f9..07dd37ef521d 100644 --- a/client/applyconfiguration/hypershift/v1beta1/hostedcontrolplanespec.go +++ b/client/applyconfiguration/hypershift/v1beta1/hostedcontrolplanespec.go @@ -49,6 +49,7 @@ type HostedControlPlaneSpecApplyConfiguration struct { Etcd *EtcdSpecApplyConfiguration `json:"etcd,omitempty"` Configuration *ClusterConfigurationApplyConfiguration `json:"configuration,omitempty"` OperatorConfiguration *OperatorConfigurationApplyConfiguration `json:"operatorConfiguration,omitempty"` + Monitoring *MonitoringSpecApplyConfiguration `json:"monitoring,omitempty"` ImageContentSources []ImageContentSourceApplyConfiguration `json:"imageContentSources,omitempty"` AdditionalTrustBundle *corev1.LocalObjectReference `json:"additionalTrustBundle,omitempty"` SecretEncryption *SecretEncryptionSpecApplyConfiguration `json:"secretEncryption,omitempty"` @@ -257,6 +258,14 @@ func (b *HostedControlPlaneSpecApplyConfiguration) WithOperatorConfiguration(val return b } +// WithMonitoring sets the Monitoring field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Monitoring field is set to the value of the last call. +func (b *HostedControlPlaneSpecApplyConfiguration) WithMonitoring(value *MonitoringSpecApplyConfiguration) *HostedControlPlaneSpecApplyConfiguration { + b.Monitoring = value + return b +} + // WithImageContentSources adds the given value to the ImageContentSources field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the ImageContentSources field. diff --git a/client/applyconfiguration/hypershift/v1beta1/metricsforwardingspec.go b/client/applyconfiguration/hypershift/v1beta1/metricsforwardingspec.go new file mode 100644 index 000000000000..5cce10720800 --- /dev/null +++ b/client/applyconfiguration/hypershift/v1beta1/metricsforwardingspec.go @@ -0,0 +1,42 @@ +/* + + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1beta1 + +import ( + hypershiftv1beta1 "github.com/openshift/hypershift/api/hypershift/v1beta1" +) + +// MetricsForwardingSpecApplyConfiguration represents a declarative configuration of the MetricsForwardingSpec type for use +// with apply. +type MetricsForwardingSpecApplyConfiguration struct { + Mode *hypershiftv1beta1.MetricsForwardingMode `json:"mode,omitempty"` +} + +// MetricsForwardingSpecApplyConfiguration constructs a declarative configuration of the MetricsForwardingSpec type for use with +// apply. +func MetricsForwardingSpec() *MetricsForwardingSpecApplyConfiguration { + return &MetricsForwardingSpecApplyConfiguration{} +} + +// WithMode sets the Mode field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Mode field is set to the value of the last call. +func (b *MetricsForwardingSpecApplyConfiguration) WithMode(value hypershiftv1beta1.MetricsForwardingMode) *MetricsForwardingSpecApplyConfiguration { + b.Mode = &value + return b +} diff --git a/client/applyconfiguration/hypershift/v1beta1/monitoringspec.go b/client/applyconfiguration/hypershift/v1beta1/monitoringspec.go new file mode 100644 index 000000000000..9aa62943f4ad --- /dev/null +++ b/client/applyconfiguration/hypershift/v1beta1/monitoringspec.go @@ -0,0 +1,51 @@ +/* + + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1beta1 + +import ( + hypershiftv1beta1 "github.com/openshift/hypershift/api/hypershift/v1beta1" +) + +// MonitoringSpecApplyConfiguration represents a declarative configuration of the MonitoringSpec type for use +// with apply. +type MonitoringSpecApplyConfiguration struct { + MetricsForwarding *MetricsForwardingSpecApplyConfiguration `json:"metricsForwarding,omitempty"` + MetricsSet *hypershiftv1beta1.MetricsSet `json:"metricsSet,omitempty"` +} + +// MonitoringSpecApplyConfiguration constructs a declarative configuration of the MonitoringSpec type for use with +// apply. +func MonitoringSpec() *MonitoringSpecApplyConfiguration { + return &MonitoringSpecApplyConfiguration{} +} + +// WithMetricsForwarding sets the MetricsForwarding field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the MetricsForwarding field is set to the value of the last call. +func (b *MonitoringSpecApplyConfiguration) WithMetricsForwarding(value *MetricsForwardingSpecApplyConfiguration) *MonitoringSpecApplyConfiguration { + b.MetricsForwarding = value + return b +} + +// WithMetricsSet sets the MetricsSet field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the MetricsSet field is set to the value of the last call. +func (b *MonitoringSpecApplyConfiguration) WithMetricsSet(value hypershiftv1beta1.MetricsSet) *MonitoringSpecApplyConfiguration { + b.MetricsSet = &value + return b +} diff --git a/client/applyconfiguration/utils.go b/client/applyconfiguration/utils.go index 0b363c9bd0e4..61d0a4744f69 100644 --- a/client/applyconfiguration/utils.go +++ b/client/applyconfiguration/utils.go @@ -323,6 +323,10 @@ func ForKind(kind schema.GroupVersionKind) interface{} { return &hypershiftv1beta1.ManagedEtcdStorageSpecApplyConfiguration{} case v1beta1.SchemeGroupVersion.WithKind("ManagedIdentity"): return &hypershiftv1beta1.ManagedIdentityApplyConfiguration{} + case v1beta1.SchemeGroupVersion.WithKind("MetricsForwardingSpec"): + return &hypershiftv1beta1.MetricsForwardingSpecApplyConfiguration{} + case v1beta1.SchemeGroupVersion.WithKind("MonitoringSpec"): + return &hypershiftv1beta1.MonitoringSpecApplyConfiguration{} case v1beta1.SchemeGroupVersion.WithKind("NetworkFilter"): return &hypershiftv1beta1.NetworkFilterApplyConfiguration{} case v1beta1.SchemeGroupVersion.WithKind("NetworkParam"): diff --git a/cmd/install/assets/crds/hypershift-operator/zz_generated.crd-manifests/hostedclusters-Hypershift-CustomNoUpgrade.crd.yaml b/cmd/install/assets/crds/hypershift-operator/zz_generated.crd-manifests/hostedclusters-Hypershift-CustomNoUpgrade.crd.yaml index 614656f7a1b3..5a0b5070557d 100644 --- a/cmd/install/assets/crds/hypershift-operator/zz_generated.crd-manifests/hostedclusters-Hypershift-CustomNoUpgrade.crd.yaml +++ b/cmd/install/assets/crds/hypershift-operator/zz_generated.crd-manifests/hostedclusters-Hypershift-CustomNoUpgrade.crd.yaml @@ -3699,6 +3699,53 @@ spec: -kubebuilder:validation:XValidation:rule=`self.all(key, size(self[key]) <= 63 && self[key].matches('^(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])?$'))`, message="label value must be 63 characters or less (can be empty), consist of alphanumeric characters, dashes (-), underscores (_) or dots (.), and begin and end with an alphanumeric character" maxProperties: 20 type: object + monitoring: + description: |- + monitoring configures monitoring for the hosted cluster, including + forwarding of control plane metrics to the hosted cluster's monitoring stack. + When omitted, metrics forwarding behavior is determined by the + hypershift.openshift.io/enable-metrics-forwarding annotation for backward compatibility. + If neither is set, metrics forwarding is disabled. + minProperties: 1 + properties: + metricsForwarding: + description: |- + metricsForwarding configures forwarding of control plane metrics into + the hosted cluster's monitoring stack. + When omitted, metrics forwarding behavior is determined by the + hypershift.openshift.io/enable-metrics-forwarding annotation for backward compatibility. + If neither is set, metrics forwarding is disabled. + properties: + mode: + description: |- + mode controls whether metrics forwarding is active for this hosted cluster. + When set to "Forward", metrics-proxy and endpoint-resolver are deployed in the + control plane, and a metrics-forwarder is deployed in the hosted cluster. + When set to "None", metrics forwarding is inactive. + enum: + - Forward + - None + type: string + required: + - mode + type: object + metricsSet: + description: |- + metricsSet specifies which set of metrics to collect and forward. + This overrides the global METRICS_SET environment variable configured on the HyperShift Operator. + When not specified, the global METRICS_SET value is used, which defaults to "Telemetry". + + "Telemetry" collects only the minimal set of metrics required for OpenShift Telemetry. + "SRE" collects the Telemetry set plus additional metrics defined in the sre-metric-set ConfigMap, + needed for SRE dashboards and alerts. + "All" collects all metrics from control plane components without filtering, + which produces significantly higher metrics volume. + enum: + - Telemetry + - SRE + - All + type: string + type: object networking: default: clusterNetwork: diff --git a/cmd/install/assets/crds/hypershift-operator/zz_generated.crd-manifests/hostedclusters-Hypershift-Default.crd.yaml b/cmd/install/assets/crds/hypershift-operator/zz_generated.crd-manifests/hostedclusters-Hypershift-Default.crd.yaml index 675f7fa0b91f..51d196212970 100644 --- a/cmd/install/assets/crds/hypershift-operator/zz_generated.crd-manifests/hostedclusters-Hypershift-Default.crd.yaml +++ b/cmd/install/assets/crds/hypershift-operator/zz_generated.crd-manifests/hostedclusters-Hypershift-Default.crd.yaml @@ -3369,6 +3369,53 @@ spec: -kubebuilder:validation:XValidation:rule=`self.all(key, size(self[key]) <= 63 && self[key].matches('^(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])?$'))`, message="label value must be 63 characters or less (can be empty), consist of alphanumeric characters, dashes (-), underscores (_) or dots (.), and begin and end with an alphanumeric character" maxProperties: 20 type: object + monitoring: + description: |- + monitoring configures monitoring for the hosted cluster, including + forwarding of control plane metrics to the hosted cluster's monitoring stack. + When omitted, metrics forwarding behavior is determined by the + hypershift.openshift.io/enable-metrics-forwarding annotation for backward compatibility. + If neither is set, metrics forwarding is disabled. + minProperties: 1 + properties: + metricsForwarding: + description: |- + metricsForwarding configures forwarding of control plane metrics into + the hosted cluster's monitoring stack. + When omitted, metrics forwarding behavior is determined by the + hypershift.openshift.io/enable-metrics-forwarding annotation for backward compatibility. + If neither is set, metrics forwarding is disabled. + properties: + mode: + description: |- + mode controls whether metrics forwarding is active for this hosted cluster. + When set to "Forward", metrics-proxy and endpoint-resolver are deployed in the + control plane, and a metrics-forwarder is deployed in the hosted cluster. + When set to "None", metrics forwarding is inactive. + enum: + - Forward + - None + type: string + required: + - mode + type: object + metricsSet: + description: |- + metricsSet specifies which set of metrics to collect and forward. + This overrides the global METRICS_SET environment variable configured on the HyperShift Operator. + When not specified, the global METRICS_SET value is used, which defaults to "Telemetry". + + "Telemetry" collects only the minimal set of metrics required for OpenShift Telemetry. + "SRE" collects the Telemetry set plus additional metrics defined in the sre-metric-set ConfigMap, + needed for SRE dashboards and alerts. + "All" collects all metrics from control plane components without filtering, + which produces significantly higher metrics volume. + enum: + - Telemetry + - SRE + - All + type: string + type: object networking: default: clusterNetwork: diff --git a/cmd/install/assets/crds/hypershift-operator/zz_generated.crd-manifests/hostedclusters-Hypershift-TechPreviewNoUpgrade.crd.yaml b/cmd/install/assets/crds/hypershift-operator/zz_generated.crd-manifests/hostedclusters-Hypershift-TechPreviewNoUpgrade.crd.yaml index a55fc7dd702a..73f48a75ea10 100644 --- a/cmd/install/assets/crds/hypershift-operator/zz_generated.crd-manifests/hostedclusters-Hypershift-TechPreviewNoUpgrade.crd.yaml +++ b/cmd/install/assets/crds/hypershift-operator/zz_generated.crd-manifests/hostedclusters-Hypershift-TechPreviewNoUpgrade.crd.yaml @@ -3570,6 +3570,53 @@ spec: -kubebuilder:validation:XValidation:rule=`self.all(key, size(self[key]) <= 63 && self[key].matches('^(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])?$'))`, message="label value must be 63 characters or less (can be empty), consist of alphanumeric characters, dashes (-), underscores (_) or dots (.), and begin and end with an alphanumeric character" maxProperties: 20 type: object + monitoring: + description: |- + monitoring configures monitoring for the hosted cluster, including + forwarding of control plane metrics to the hosted cluster's monitoring stack. + When omitted, metrics forwarding behavior is determined by the + hypershift.openshift.io/enable-metrics-forwarding annotation for backward compatibility. + If neither is set, metrics forwarding is disabled. + minProperties: 1 + properties: + metricsForwarding: + description: |- + metricsForwarding configures forwarding of control plane metrics into + the hosted cluster's monitoring stack. + When omitted, metrics forwarding behavior is determined by the + hypershift.openshift.io/enable-metrics-forwarding annotation for backward compatibility. + If neither is set, metrics forwarding is disabled. + properties: + mode: + description: |- + mode controls whether metrics forwarding is active for this hosted cluster. + When set to "Forward", metrics-proxy and endpoint-resolver are deployed in the + control plane, and a metrics-forwarder is deployed in the hosted cluster. + When set to "None", metrics forwarding is inactive. + enum: + - Forward + - None + type: string + required: + - mode + type: object + metricsSet: + description: |- + metricsSet specifies which set of metrics to collect and forward. + This overrides the global METRICS_SET environment variable configured on the HyperShift Operator. + When not specified, the global METRICS_SET value is used, which defaults to "Telemetry". + + "Telemetry" collects only the minimal set of metrics required for OpenShift Telemetry. + "SRE" collects the Telemetry set plus additional metrics defined in the sre-metric-set ConfigMap, + needed for SRE dashboards and alerts. + "All" collects all metrics from control plane components without filtering, + which produces significantly higher metrics volume. + enum: + - Telemetry + - SRE + - All + type: string + type: object networking: default: clusterNetwork: diff --git a/cmd/install/assets/crds/hypershift-operator/zz_generated.crd-manifests/hostedcontrolplanes-Hypershift-CustomNoUpgrade.crd.yaml b/cmd/install/assets/crds/hypershift-operator/zz_generated.crd-manifests/hostedcontrolplanes-Hypershift-CustomNoUpgrade.crd.yaml index 184e1da178d7..c2c2269ccc13 100644 --- a/cmd/install/assets/crds/hypershift-operator/zz_generated.crd-manifests/hostedcontrolplanes-Hypershift-CustomNoUpgrade.crd.yaml +++ b/cmd/install/assets/crds/hypershift-operator/zz_generated.crd-manifests/hostedcontrolplanes-Hypershift-CustomNoUpgrade.crd.yaml @@ -3601,6 +3601,51 @@ spec: -kubebuilder:validation:XValidation:rule=`self.all(key, size(self[key]) <= 63 && self[key].matches('^(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])?$'))`, message="label value must be 63 characters or less (can be empty), consist of alphanumeric characters, dashes (-), underscores (_) or dots (.), and begin and end with an alphanumeric character" maxProperties: 20 type: object + monitoring: + description: |- + monitoring configures monitoring for the hosted cluster, including + forwarding of control plane metrics to the hosted cluster's monitoring stack. + When omitted, metrics forwarding is not configured and will be inactive. + minProperties: 1 + properties: + metricsForwarding: + description: |- + metricsForwarding configures forwarding of control plane metrics into + the hosted cluster's monitoring stack. + When omitted, metrics forwarding behavior is determined by the + hypershift.openshift.io/enable-metrics-forwarding annotation for backward compatibility. + If neither is set, metrics forwarding is disabled. + properties: + mode: + description: |- + mode controls whether metrics forwarding is active for this hosted cluster. + When set to "Forward", metrics-proxy and endpoint-resolver are deployed in the + control plane, and a metrics-forwarder is deployed in the hosted cluster. + When set to "None", metrics forwarding is inactive. + enum: + - Forward + - None + type: string + required: + - mode + type: object + metricsSet: + description: |- + metricsSet specifies which set of metrics to collect and forward. + This overrides the global METRICS_SET environment variable configured on the HyperShift Operator. + When not specified, the global METRICS_SET value is used, which defaults to "Telemetry". + + "Telemetry" collects only the minimal set of metrics required for OpenShift Telemetry. + "SRE" collects the Telemetry set plus additional metrics defined in the sre-metric-set ConfigMap, + needed for SRE dashboards and alerts. + "All" collects all metrics from control plane components without filtering, + which produces significantly higher metrics volume. + enum: + - Telemetry + - SRE + - All + type: string + type: object networking: description: |- networking specifies network configuration for the cluster. diff --git a/cmd/install/assets/crds/hypershift-operator/zz_generated.crd-manifests/hostedcontrolplanes-Hypershift-Default.crd.yaml b/cmd/install/assets/crds/hypershift-operator/zz_generated.crd-manifests/hostedcontrolplanes-Hypershift-Default.crd.yaml index faa000175f8f..6e7c663c9c99 100644 --- a/cmd/install/assets/crds/hypershift-operator/zz_generated.crd-manifests/hostedcontrolplanes-Hypershift-Default.crd.yaml +++ b/cmd/install/assets/crds/hypershift-operator/zz_generated.crd-manifests/hostedcontrolplanes-Hypershift-Default.crd.yaml @@ -3271,6 +3271,51 @@ spec: -kubebuilder:validation:XValidation:rule=`self.all(key, size(self[key]) <= 63 && self[key].matches('^(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])?$'))`, message="label value must be 63 characters or less (can be empty), consist of alphanumeric characters, dashes (-), underscores (_) or dots (.), and begin and end with an alphanumeric character" maxProperties: 20 type: object + monitoring: + description: |- + monitoring configures monitoring for the hosted cluster, including + forwarding of control plane metrics to the hosted cluster's monitoring stack. + When omitted, metrics forwarding is not configured and will be inactive. + minProperties: 1 + properties: + metricsForwarding: + description: |- + metricsForwarding configures forwarding of control plane metrics into + the hosted cluster's monitoring stack. + When omitted, metrics forwarding behavior is determined by the + hypershift.openshift.io/enable-metrics-forwarding annotation for backward compatibility. + If neither is set, metrics forwarding is disabled. + properties: + mode: + description: |- + mode controls whether metrics forwarding is active for this hosted cluster. + When set to "Forward", metrics-proxy and endpoint-resolver are deployed in the + control plane, and a metrics-forwarder is deployed in the hosted cluster. + When set to "None", metrics forwarding is inactive. + enum: + - Forward + - None + type: string + required: + - mode + type: object + metricsSet: + description: |- + metricsSet specifies which set of metrics to collect and forward. + This overrides the global METRICS_SET environment variable configured on the HyperShift Operator. + When not specified, the global METRICS_SET value is used, which defaults to "Telemetry". + + "Telemetry" collects only the minimal set of metrics required for OpenShift Telemetry. + "SRE" collects the Telemetry set plus additional metrics defined in the sre-metric-set ConfigMap, + needed for SRE dashboards and alerts. + "All" collects all metrics from control plane components without filtering, + which produces significantly higher metrics volume. + enum: + - Telemetry + - SRE + - All + type: string + type: object networking: description: |- networking specifies network configuration for the cluster. diff --git a/cmd/install/assets/crds/hypershift-operator/zz_generated.crd-manifests/hostedcontrolplanes-Hypershift-TechPreviewNoUpgrade.crd.yaml b/cmd/install/assets/crds/hypershift-operator/zz_generated.crd-manifests/hostedcontrolplanes-Hypershift-TechPreviewNoUpgrade.crd.yaml index 80d83a4173ce..a3112d08641f 100644 --- a/cmd/install/assets/crds/hypershift-operator/zz_generated.crd-manifests/hostedcontrolplanes-Hypershift-TechPreviewNoUpgrade.crd.yaml +++ b/cmd/install/assets/crds/hypershift-operator/zz_generated.crd-manifests/hostedcontrolplanes-Hypershift-TechPreviewNoUpgrade.crd.yaml @@ -3472,6 +3472,51 @@ spec: -kubebuilder:validation:XValidation:rule=`self.all(key, size(self[key]) <= 63 && self[key].matches('^(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])?$'))`, message="label value must be 63 characters or less (can be empty), consist of alphanumeric characters, dashes (-), underscores (_) or dots (.), and begin and end with an alphanumeric character" maxProperties: 20 type: object + monitoring: + description: |- + monitoring configures monitoring for the hosted cluster, including + forwarding of control plane metrics to the hosted cluster's monitoring stack. + When omitted, metrics forwarding is not configured and will be inactive. + minProperties: 1 + properties: + metricsForwarding: + description: |- + metricsForwarding configures forwarding of control plane metrics into + the hosted cluster's monitoring stack. + When omitted, metrics forwarding behavior is determined by the + hypershift.openshift.io/enable-metrics-forwarding annotation for backward compatibility. + If neither is set, metrics forwarding is disabled. + properties: + mode: + description: |- + mode controls whether metrics forwarding is active for this hosted cluster. + When set to "Forward", metrics-proxy and endpoint-resolver are deployed in the + control plane, and a metrics-forwarder is deployed in the hosted cluster. + When set to "None", metrics forwarding is inactive. + enum: + - Forward + - None + type: string + required: + - mode + type: object + metricsSet: + description: |- + metricsSet specifies which set of metrics to collect and forward. + This overrides the global METRICS_SET environment variable configured on the HyperShift Operator. + When not specified, the global METRICS_SET value is used, which defaults to "Telemetry". + + "Telemetry" collects only the minimal set of metrics required for OpenShift Telemetry. + "SRE" collects the Telemetry set plus additional metrics defined in the sre-metric-set ConfigMap, + needed for SRE dashboards and alerts. + "All" collects all metrics from control plane components without filtering, + which produces significantly higher metrics volume. + enum: + - Telemetry + - SRE + - All + type: string + type: object networking: description: |- networking specifies network configuration for the cluster. diff --git a/docs/content/reference/aggregated-docs.md b/docs/content/reference/aggregated-docs.md index aac77dde2d07..34defd482599 100644 --- a/docs/content/reference/aggregated-docs.md +++ b/docs/content/reference/aggregated-docs.md @@ -37477,6 +37477,24 @@ Capabilities This field is optional and once set cannot be changed.

+ + +monitoring,omitzero
+ + +MonitoringSpec + + + + +(Optional) +

monitoring configures monitoring for the hosted cluster, including +forwarding of control plane metrics to the hosted cluster’s monitoring stack. +When omitted, metrics forwarding behavior is determined by the +hypershift.openshift.io/enable-metrics-forwarding annotation for backward compatibility. +If neither is set, metrics forwarding is disabled.

+ + @@ -46226,6 +46244,24 @@ Capabilities This field is optional and once set cannot be changed.

+ + +monitoring,omitzero
+ + +MonitoringSpec + + + + +(Optional) +

monitoring configures monitoring for the hosted cluster, including +forwarding of control plane metrics to the hosted cluster’s monitoring stack. +When omitted, metrics forwarding behavior is determined by the +hypershift.openshift.io/enable-metrics-forwarding annotation for backward compatibility. +If neither is set, metrics forwarding is disabled.

+ + ###HostedClusterStatus { #hypershift.openshift.io/v1beta1.HostedClusterStatus } @@ -46809,6 +46845,22 @@ OperatorConfiguration +monitoring,omitzero
+ + +MonitoringSpec + + + + +(Optional) +

monitoring configures monitoring for the hosted cluster, including +forwarding of control plane metrics to the hosted cluster’s monitoring stack. +When omitted, metrics forwarding is not configured and will be inactive.

+ + + + imageContentSources
@@ -49423,6 +49475,155 @@ Spot instances use spare EC2 capacity at reduced prices but may be interrupted.< +###MetricsForwardingMode { #hypershift.openshift.io/v1beta1.MetricsForwardingMode } +

+(Appears on: +MetricsForwardingSpec) +

+

+

MetricsForwardingMode controls whether metrics forwarding is active for a hosted cluster.

+

+ + + + + + + + + + + + +
ValueDescription

"Forward"

MetricsForwardingModeForward indicates metrics forwarding is active.

+

"None"

MetricsForwardingModeNone indicates metrics forwarding is inactive.

+
+###MetricsForwardingSpec { #hypershift.openshift.io/v1beta1.MetricsForwardingSpec } +

+(Appears on: +MonitoringSpec) +

+

+

MetricsForwardingSpec configures metrics forwarding for the hosted cluster.

+

+ + + + + + + + + + + + + +
FieldDescription
+mode
+ + +MetricsForwardingMode + + +
+

mode controls whether metrics forwarding is active for this hosted cluster. +When set to “Forward”, metrics-proxy and endpoint-resolver are deployed in the +control plane, and a metrics-forwarder is deployed in the hosted cluster. +When set to “None”, metrics forwarding is inactive.

+
+###MetricsSet { #hypershift.openshift.io/v1beta1.MetricsSet } +

+(Appears on: +MonitoringSpec) +

+

+

MetricsSet specifies the set of metrics to collect and forward from hosted clusters.

+

+ + + + + + + + + + + + + + +
ValueDescription

"All"

MetricsSetAll collects all metrics from control plane components without +any filtering. Use this for debugging or when full metric visibility is +needed, but be aware it produces significantly higher metrics volume.

+

"SRE"

MetricsSetSRE collects the metrics defined in the sre-metric-set ConfigMap, +which includes the Telemetry set plus additional metrics needed for SRE +monitoring dashboards and alerts. Use this for clusters that require +SRE observability.

+

"Telemetry"

MetricsSetTelemetry collects only the minimal set of metrics required for +OpenShift Telemetry. Use this to minimize metrics volume while still +satisfying cluster telemetry requirements.

+
+###MonitoringSpec { #hypershift.openshift.io/v1beta1.MonitoringSpec } +

+(Appears on: +HostedClusterSpec, +HostedControlPlaneSpec) +

+

+

MonitoringSpec configures monitoring for the hosted cluster. +At least one field must be specified when this struct is present.

+

+ + + + + + + + + + + + + + + + + +
FieldDescription
+metricsForwarding,omitzero
+ + +MetricsForwardingSpec + + +
+(Optional) +

metricsForwarding configures forwarding of control plane metrics into +the hosted cluster’s monitoring stack. +When omitted, metrics forwarding behavior is determined by the +hypershift.openshift.io/enable-metrics-forwarding annotation for backward compatibility. +If neither is set, metrics forwarding is disabled.

+
+metricsSet
+ + +MetricsSet + + +
+(Optional) +

metricsSet specifies which set of metrics to collect and forward. +This overrides the global METRICS_SET environment variable configured on the HyperShift Operator. +When not specified, the global METRICS_SET value is used, which defaults to “Telemetry”.

+

“Telemetry” collects only the minimal set of metrics required for OpenShift Telemetry. +“SRE” collects the Telemetry set plus additional metrics defined in the sre-metric-set ConfigMap, +needed for SRE dashboards and alerts. +“All” collects all metrics from control plane components without filtering, +which produces significantly higher metrics volume.

+
###MultiQueueSetting { #hypershift.openshift.io/v1beta1.MultiQueueSetting }

(Appears on: diff --git a/docs/content/reference/api.md b/docs/content/reference/api.md index 5b1a828d9f17..1cce087a89ce 100644 --- a/docs/content/reference/api.md +++ b/docs/content/reference/api.md @@ -1004,6 +1004,24 @@ Capabilities This field is optional and once set cannot be changed.

+ + +monitoring,omitzero
+ + +MonitoringSpec + + + + +(Optional) +

monitoring configures monitoring for the hosted cluster, including +forwarding of control plane metrics to the hosted cluster’s monitoring stack. +When omitted, metrics forwarding behavior is determined by the +hypershift.openshift.io/enable-metrics-forwarding annotation for backward compatibility. +If neither is set, metrics forwarding is disabled.

+ + @@ -9753,6 +9771,24 @@ Capabilities This field is optional and once set cannot be changed.

+ + +monitoring,omitzero
+ + +MonitoringSpec + + + + +(Optional) +

monitoring configures monitoring for the hosted cluster, including +forwarding of control plane metrics to the hosted cluster’s monitoring stack. +When omitted, metrics forwarding behavior is determined by the +hypershift.openshift.io/enable-metrics-forwarding annotation for backward compatibility. +If neither is set, metrics forwarding is disabled.

+ + ###HostedClusterStatus { #hypershift.openshift.io/v1beta1.HostedClusterStatus } @@ -10336,6 +10372,22 @@ OperatorConfiguration +monitoring,omitzero
+ + +MonitoringSpec + + + + +(Optional) +

monitoring configures monitoring for the hosted cluster, including +forwarding of control plane metrics to the hosted cluster’s monitoring stack. +When omitted, metrics forwarding is not configured and will be inactive.

+ + + + imageContentSources
@@ -12950,6 +13002,155 @@ Spot instances use spare EC2 capacity at reduced prices but may be interrupted.< +###MetricsForwardingMode { #hypershift.openshift.io/v1beta1.MetricsForwardingMode } +

+(Appears on: +MetricsForwardingSpec) +

+

+

MetricsForwardingMode controls whether metrics forwarding is active for a hosted cluster.

+

+ + + + + + + + + + + + +
ValueDescription

"Forward"

MetricsForwardingModeForward indicates metrics forwarding is active.

+

"None"

MetricsForwardingModeNone indicates metrics forwarding is inactive.

+
+###MetricsForwardingSpec { #hypershift.openshift.io/v1beta1.MetricsForwardingSpec } +

+(Appears on: +MonitoringSpec) +

+

+

MetricsForwardingSpec configures metrics forwarding for the hosted cluster.

+

+ + + + + + + + + + + + + +
FieldDescription
+mode
+ + +MetricsForwardingMode + + +
+

mode controls whether metrics forwarding is active for this hosted cluster. +When set to “Forward”, metrics-proxy and endpoint-resolver are deployed in the +control plane, and a metrics-forwarder is deployed in the hosted cluster. +When set to “None”, metrics forwarding is inactive.

+
+###MetricsSet { #hypershift.openshift.io/v1beta1.MetricsSet } +

+(Appears on: +MonitoringSpec) +

+

+

MetricsSet specifies the set of metrics to collect and forward from hosted clusters.

+

+ + + + + + + + + + + + + + +
ValueDescription

"All"

MetricsSetAll collects all metrics from control plane components without +any filtering. Use this for debugging or when full metric visibility is +needed, but be aware it produces significantly higher metrics volume.

+

"SRE"

MetricsSetSRE collects the metrics defined in the sre-metric-set ConfigMap, +which includes the Telemetry set plus additional metrics needed for SRE +monitoring dashboards and alerts. Use this for clusters that require +SRE observability.

+

"Telemetry"

MetricsSetTelemetry collects only the minimal set of metrics required for +OpenShift Telemetry. Use this to minimize metrics volume while still +satisfying cluster telemetry requirements.

+
+###MonitoringSpec { #hypershift.openshift.io/v1beta1.MonitoringSpec } +

+(Appears on: +HostedClusterSpec, +HostedControlPlaneSpec) +

+

+

MonitoringSpec configures monitoring for the hosted cluster. +At least one field must be specified when this struct is present.

+

+ + + + + + + + + + + + + + + + + +
FieldDescription
+metricsForwarding,omitzero
+ + +MetricsForwardingSpec + + +
+(Optional) +

metricsForwarding configures forwarding of control plane metrics into +the hosted cluster’s monitoring stack. +When omitted, metrics forwarding behavior is determined by the +hypershift.openshift.io/enable-metrics-forwarding annotation for backward compatibility. +If neither is set, metrics forwarding is disabled.

+
+metricsSet
+ + +MetricsSet + + +
+(Optional) +

metricsSet specifies which set of metrics to collect and forward. +This overrides the global METRICS_SET environment variable configured on the HyperShift Operator. +When not specified, the global METRICS_SET value is used, which defaults to “Telemetry”.

+

“Telemetry” collects only the minimal set of metrics required for OpenShift Telemetry. +“SRE” collects the Telemetry set plus additional metrics defined in the sre-metric-set ConfigMap, +needed for SRE dashboards and alerts. +“All” collects all metrics from control plane components without filtering, +which produces significantly higher metrics volume.

+
###MultiQueueSetting { #hypershift.openshift.io/v1beta1.MultiQueueSetting }

(Appears on: diff --git a/vendor/github.com/openshift/hypershift/api/hypershift/v1beta1/hosted_controlplane.go b/vendor/github.com/openshift/hypershift/api/hypershift/v1beta1/hosted_controlplane.go index 9c4358622169..9dc6fd0b1bc0 100644 --- a/vendor/github.com/openshift/hypershift/api/hypershift/v1beta1/hosted_controlplane.go +++ b/vendor/github.com/openshift/hypershift/api/hypershift/v1beta1/hosted_controlplane.go @@ -188,6 +188,13 @@ type HostedControlPlaneSpec struct { // +optional OperatorConfiguration *OperatorConfiguration `json:"operatorConfiguration,omitempty"` + // monitoring configures monitoring for the hosted cluster, including + // forwarding of control plane metrics to the hosted cluster's monitoring stack. + // When omitted, metrics forwarding is not configured and will be inactive. + // + // +optional + Monitoring MonitoringSpec `json:"monitoring,omitzero"` + // imageContentSources lists sources/repositories for the release-image content. // +optional // +kubebuilder:validation:MaxItems=255 diff --git a/vendor/github.com/openshift/hypershift/api/hypershift/v1beta1/hostedcluster_types.go b/vendor/github.com/openshift/hypershift/api/hypershift/v1beta1/hostedcluster_types.go index 35ebbeb44811..6524c9129019 100644 --- a/vendor/github.com/openshift/hypershift/api/hypershift/v1beta1/hostedcluster_types.go +++ b/vendor/github.com/openshift/hypershift/api/hypershift/v1beta1/hostedcluster_types.go @@ -278,6 +278,8 @@ const ( // EnableMetricsForwarding enables metrics forwarding from the management cluster to hosted clusters. // When present, components like the endpoint-resolver and metrics-proxy will be deployed. + // Deprecated: Use spec.monitoring.metricsForwarding instead. This annotation is preserved + // for backward compatibility and will be honored when spec.monitoring is not set. EnableMetricsForwarding = "hypershift.openshift.io/enable-metrics-forwarding" // JSONPatchAnnotation allow modifying the kubevirt VM template using jsonpatch @@ -839,6 +841,15 @@ type HostedClusterSpec struct { // +kubebuilder:default={} // +kubebuilder:validation:XValidation:rule="self == oldSelf", message="Capabilities is immutable. Changes might result in unpredictable and disruptive behavior." Capabilities *Capabilities `json:"capabilities,omitempty"` + + // monitoring configures monitoring for the hosted cluster, including + // forwarding of control plane metrics to the hosted cluster's monitoring stack. + // When omitted, metrics forwarding behavior is determined by the + // hypershift.openshift.io/enable-metrics-forwarding annotation for backward compatibility. + // If neither is set, metrics forwarding is disabled. + // + // +optional + Monitoring MonitoringSpec `json:"monitoring,omitzero"` } // OLMCatalogPlacement is an enum specifying the placement of OLM catalog components. @@ -875,6 +886,81 @@ func (olm *OLMCatalogPlacement) Type() string { return "OLMCatalogPlacement" } +// MetricsForwardingMode controls whether metrics forwarding is active for a hosted cluster. +// +// +kubebuilder:validation:Enum=Forward;None +type MetricsForwardingMode string + +const ( + // MetricsForwardingModeForward indicates metrics forwarding is active. + MetricsForwardingModeForward MetricsForwardingMode = "Forward" + + // MetricsForwardingModeNone indicates metrics forwarding is inactive. + MetricsForwardingModeNone MetricsForwardingMode = "None" +) + +// MetricsSet specifies the set of metrics to collect and forward from hosted clusters. +// +// +kubebuilder:validation:Enum=Telemetry;SRE;All +type MetricsSet string + +const ( + // MetricsSetTelemetry collects only the minimal set of metrics required for + // OpenShift Telemetry. Use this to minimize metrics volume while still + // satisfying cluster telemetry requirements. + MetricsSetTelemetry MetricsSet = "Telemetry" + + // MetricsSetSRE collects the metrics defined in the sre-metric-set ConfigMap, + // which includes the Telemetry set plus additional metrics needed for SRE + // monitoring dashboards and alerts. Use this for clusters that require + // SRE observability. + MetricsSetSRE MetricsSet = "SRE" + + // MetricsSetAll collects all metrics from control plane components without + // any filtering. Use this for debugging or when full metric visibility is + // needed, but be aware it produces significantly higher metrics volume. + MetricsSetAll MetricsSet = "All" +) + +// MonitoringSpec configures monitoring for the hosted cluster. +// At least one field must be specified when this struct is present. +// +// +kubebuilder:validation:MinProperties=1 +type MonitoringSpec struct { + // metricsForwarding configures forwarding of control plane metrics into + // the hosted cluster's monitoring stack. + // When omitted, metrics forwarding behavior is determined by the + // hypershift.openshift.io/enable-metrics-forwarding annotation for backward compatibility. + // If neither is set, metrics forwarding is disabled. + // + // +optional + MetricsForwarding MetricsForwardingSpec `json:"metricsForwarding,omitzero"` + + // metricsSet specifies which set of metrics to collect and forward. + // This overrides the global METRICS_SET environment variable configured on the HyperShift Operator. + // When not specified, the global METRICS_SET value is used, which defaults to "Telemetry". + // + // "Telemetry" collects only the minimal set of metrics required for OpenShift Telemetry. + // "SRE" collects the Telemetry set plus additional metrics defined in the sre-metric-set ConfigMap, + // needed for SRE dashboards and alerts. + // "All" collects all metrics from control plane components without filtering, + // which produces significantly higher metrics volume. + // + // +optional + MetricsSet MetricsSet `json:"metricsSet,omitempty"` +} + +// MetricsForwardingSpec configures metrics forwarding for the hosted cluster. +type MetricsForwardingSpec struct { + // mode controls whether metrics forwarding is active for this hosted cluster. + // When set to "Forward", metrics-proxy and endpoint-resolver are deployed in the + // control plane, and a metrics-forwarder is deployed in the hosted cluster. + // When set to "None", metrics forwarding is inactive. + // + // +required + Mode MetricsForwardingMode `json:"mode,omitempty"` +} + // ImageContentSource specifies image mirrors that can be used by cluster nodes // to pull content. For cluster workloads, if a container image registry host of // the pullspec matches Source then one of the Mirrors are substituted as hosts diff --git a/vendor/github.com/openshift/hypershift/api/hypershift/v1beta1/zz_generated.deepcopy.go b/vendor/github.com/openshift/hypershift/api/hypershift/v1beta1/zz_generated.deepcopy.go index 23d872bde66d..ba481ba6e9b7 100644 --- a/vendor/github.com/openshift/hypershift/api/hypershift/v1beta1/zz_generated.deepcopy.go +++ b/vendor/github.com/openshift/hypershift/api/hypershift/v1beta1/zz_generated.deepcopy.go @@ -2489,6 +2489,7 @@ func (in *HostedClusterSpec) DeepCopyInto(out *HostedClusterSpec) { *out = new(Capabilities) (*in).DeepCopyInto(*out) } + out.Monitoring = in.Monitoring } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new HostedClusterSpec. @@ -2662,6 +2663,7 @@ func (in *HostedControlPlaneSpec) DeepCopyInto(out *HostedControlPlaneSpec) { *out = new(OperatorConfiguration) (*in).DeepCopyInto(*out) } + out.Monitoring = in.Monitoring if in.ImageContentSources != nil { in, out := &in.ImageContentSources, &out.ImageContentSources *out = make([]ImageContentSource, len(*in)) @@ -3513,6 +3515,37 @@ func (in *ManagedIdentity) DeepCopy() *ManagedIdentity { return out } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *MetricsForwardingSpec) DeepCopyInto(out *MetricsForwardingSpec) { + *out = *in +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MetricsForwardingSpec. +func (in *MetricsForwardingSpec) DeepCopy() *MetricsForwardingSpec { + if in == nil { + return nil + } + out := new(MetricsForwardingSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *MonitoringSpec) DeepCopyInto(out *MonitoringSpec) { + *out = *in + out.MetricsForwarding = in.MetricsForwarding +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MonitoringSpec. +func (in *MonitoringSpec) DeepCopy() *MonitoringSpec { + if in == nil { + return nil + } + out := new(MonitoringSpec) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *NetworkFilter) DeepCopyInto(out *NetworkFilter) { *out = *in From ea1eb172ac1b285415ab568f30142b6f2ea204a4 Mon Sep 17 00:00:00 2001 From: Mulham Raee Date: Thu, 11 Jun 2026 17:04:27 +0200 Subject: [PATCH 3/6] feat(cpo,ho): use spec.monitoring API instead of annotation Update all consumers to check the new spec field: - HC controller copies Monitoring from HC to HCP with backward compat for the deprecated EnableMetricsForwarding annotation (only when mode is unset; explicit Disabled takes precedence) - CPO resolves per-cluster MetricsSet override before SRE config loading and passes it through ControlPlaneContext - metrics-proxy and endpoint-resolver predicates check Mode enum - HCCO reconcileMetricsForwarder checks spec instead of annotation - HO SRE ConfigMap sync supports per-cluster MetricsSet=SRE Signed-off-by: Mulham Raee Co-Authored-By: Claude Opus 4.6 (1M context) --- ...e.hostedclusters.monitoring.testsuite.yaml | 320 ++++++++++++++++++ .../v2/endpoint_resolver/component.go | 7 +- .../v2/endpoint_resolver/component_test.go | 34 +- .../v2/metrics_proxy/component.go | 8 +- .../controllers/resources/resources.go | 2 +- .../controllers/resources/resources_test.go | 28 +- .../hostedcluster/hostedcluster_controller.go | 22 +- .../hostedcluster_controller_test.go | 189 +++++++++++ test/e2e/util/util_metrics_proxy.go | 9 +- .../v2/tests/hosted_cluster_metrics_test.go | 4 +- 10 files changed, 587 insertions(+), 36 deletions(-) create mode 100644 cmd/install/assets/crds/hypershift-operator/tests/hostedclusters.hypershift.openshift.io/stable.hostedclusters.monitoring.testsuite.yaml diff --git a/cmd/install/assets/crds/hypershift-operator/tests/hostedclusters.hypershift.openshift.io/stable.hostedclusters.monitoring.testsuite.yaml b/cmd/install/assets/crds/hypershift-operator/tests/hostedclusters.hypershift.openshift.io/stable.hostedclusters.monitoring.testsuite.yaml new file mode 100644 index 000000000000..3b7a2ab73bb9 --- /dev/null +++ b/cmd/install/assets/crds/hypershift-operator/tests/hostedclusters.hypershift.openshift.io/stable.hostedclusters.monitoring.testsuite.yaml @@ -0,0 +1,320 @@ +apiVersion: apiextensions.k8s.io/v1 +name: "HostedCluster monitoring validation" +crdName: hostedclusters.hypershift.openshift.io +version: v1beta1 +tests: + onCreate: + - name: When monitoring is omitted it should pass + initial: | + apiVersion: hypershift.openshift.io/v1beta1 + kind: HostedCluster + spec: + dns: + baseDomain: example.com + platform: + type: AWS + pullSecret: + name: secret + release: + image: quay.io/openshift-release-dev/ocp-release:4.15.11-x86_64 + secretEncryption: + aescbc: + activeKey: + name: key + type: aescbc + services: + - service: APIServer + servicePublishingStrategy: + type: Route + route: {} + - service: OAuthServer + servicePublishingStrategy: + type: Route + route: {} + - service: Konnectivity + servicePublishingStrategy: + type: Route + route: {} + - service: Ignition + servicePublishingStrategy: + type: Route + route: {} + + - name: When metricsForwarding mode is Forward it should pass + initial: | + apiVersion: hypershift.openshift.io/v1beta1 + kind: HostedCluster + spec: + monitoring: + metricsForwarding: + mode: Forward + dns: + baseDomain: example.com + platform: + type: AWS + pullSecret: + name: secret + release: + image: quay.io/openshift-release-dev/ocp-release:4.15.11-x86_64 + secretEncryption: + aescbc: + activeKey: + name: key + type: aescbc + services: + - service: APIServer + servicePublishingStrategy: + type: Route + route: {} + - service: OAuthServer + servicePublishingStrategy: + type: Route + route: {} + - service: Konnectivity + servicePublishingStrategy: + type: Route + route: {} + - service: Ignition + servicePublishingStrategy: + type: Route + route: {} + + - name: When metricsForwarding mode is None it should pass + initial: | + apiVersion: hypershift.openshift.io/v1beta1 + kind: HostedCluster + spec: + monitoring: + metricsForwarding: + mode: None + dns: + baseDomain: example.com + platform: + type: AWS + pullSecret: + name: secret + release: + image: quay.io/openshift-release-dev/ocp-release:4.15.11-x86_64 + secretEncryption: + aescbc: + activeKey: + name: key + type: aescbc + services: + - service: APIServer + servicePublishingStrategy: + type: Route + route: {} + - service: OAuthServer + servicePublishingStrategy: + type: Route + route: {} + - service: Konnectivity + servicePublishingStrategy: + type: Route + route: {} + - service: Ignition + servicePublishingStrategy: + type: Route + route: {} + + - name: When metricsSet is Telemetry it should pass + initial: | + apiVersion: hypershift.openshift.io/v1beta1 + kind: HostedCluster + spec: + monitoring: + metricsForwarding: + mode: Forward + metricsSet: Telemetry + dns: + baseDomain: example.com + platform: + type: AWS + pullSecret: + name: secret + release: + image: quay.io/openshift-release-dev/ocp-release:4.15.11-x86_64 + secretEncryption: + aescbc: + activeKey: + name: key + type: aescbc + services: + - service: APIServer + servicePublishingStrategy: + type: Route + route: {} + - service: OAuthServer + servicePublishingStrategy: + type: Route + route: {} + - service: Konnectivity + servicePublishingStrategy: + type: Route + route: {} + - service: Ignition + servicePublishingStrategy: + type: Route + route: {} + + - name: When metricsSet is SRE it should pass + initial: | + apiVersion: hypershift.openshift.io/v1beta1 + kind: HostedCluster + spec: + monitoring: + metricsForwarding: + mode: Forward + metricsSet: SRE + dns: + baseDomain: example.com + platform: + type: AWS + pullSecret: + name: secret + release: + image: quay.io/openshift-release-dev/ocp-release:4.15.11-x86_64 + secretEncryption: + aescbc: + activeKey: + name: key + type: aescbc + services: + - service: APIServer + servicePublishingStrategy: + type: Route + route: {} + - service: OAuthServer + servicePublishingStrategy: + type: Route + route: {} + - service: Konnectivity + servicePublishingStrategy: + type: Route + route: {} + - service: Ignition + servicePublishingStrategy: + type: Route + route: {} + + - name: When metricsSet is All it should pass + initial: | + apiVersion: hypershift.openshift.io/v1beta1 + kind: HostedCluster + spec: + monitoring: + metricsForwarding: + mode: Forward + metricsSet: All + dns: + baseDomain: example.com + platform: + type: AWS + pullSecret: + name: secret + release: + image: quay.io/openshift-release-dev/ocp-release:4.15.11-x86_64 + secretEncryption: + aescbc: + activeKey: + name: key + type: aescbc + services: + - service: APIServer + servicePublishingStrategy: + type: Route + route: {} + - service: OAuthServer + servicePublishingStrategy: + type: Route + route: {} + - service: Konnectivity + servicePublishingStrategy: + type: Route + route: {} + - service: Ignition + servicePublishingStrategy: + type: Route + route: {} + + - name: When metricsSet is an invalid value it should fail + initial: | + apiVersion: hypershift.openshift.io/v1beta1 + kind: HostedCluster + spec: + monitoring: + metricsForwarding: + mode: Forward + metricsSet: InvalidValue + dns: + baseDomain: example.com + platform: + type: AWS + pullSecret: + name: secret + release: + image: quay.io/openshift-release-dev/ocp-release:4.15.11-x86_64 + secretEncryption: + aescbc: + activeKey: + name: key + type: aescbc + services: + - service: APIServer + servicePublishingStrategy: + type: Route + route: {} + - service: OAuthServer + servicePublishingStrategy: + type: Route + route: {} + - service: Konnectivity + servicePublishingStrategy: + type: Route + route: {} + - service: Ignition + servicePublishingStrategy: + type: Route + route: {} + expectedError: "spec.monitoring.metricsSet" + + - name: When mode is an invalid value it should fail + initial: | + apiVersion: hypershift.openshift.io/v1beta1 + kind: HostedCluster + spec: + monitoring: + metricsForwarding: + mode: InvalidMode + dns: + baseDomain: example.com + platform: + type: AWS + pullSecret: + name: secret + release: + image: quay.io/openshift-release-dev/ocp-release:4.15.11-x86_64 + secretEncryption: + aescbc: + activeKey: + name: key + type: aescbc + services: + - service: APIServer + servicePublishingStrategy: + type: Route + route: {} + - service: OAuthServer + servicePublishingStrategy: + type: Route + route: {} + - service: Konnectivity + servicePublishingStrategy: + type: Route + route: {} + - service: Ignition + servicePublishingStrategy: + type: Route + route: {} + expectedError: "spec.monitoring.metricsForwarding.mode" diff --git a/control-plane-operator/controllers/hostedcontrolplane/v2/endpoint_resolver/component.go b/control-plane-operator/controllers/hostedcontrolplane/v2/endpoint_resolver/component.go index 0f0efdc35ddc..940ff11f3fbf 100644 --- a/control-plane-operator/controllers/hostedcontrolplane/v2/endpoint_resolver/component.go +++ b/control-plane-operator/controllers/hostedcontrolplane/v2/endpoint_resolver/component.go @@ -27,7 +27,7 @@ func (r *endpointResolver) NeedsManagementKASAccess() bool { func NewComponent() component.ControlPlaneComponent { return component.NewDeploymentComponent(ComponentName, &endpointResolver{}). - WithPredicate(predicate). + WithPredicate(Predicate). WithManifestAdapter( "ca-cert.yaml", component.WithAdaptFunction(adaptCACertSecret), @@ -43,8 +43,7 @@ func NewComponent() component.ControlPlaneComponent { Build() } -func predicate(cpContext component.WorkloadContext) (bool, error) { +func Predicate(cpContext component.WorkloadContext) (bool, error) { _, disableMonitoring := cpContext.HCP.Annotations[hyperv1.DisableMonitoringServices] - _, enableMetricsForwarding := cpContext.HCP.Annotations[hyperv1.EnableMetricsForwarding] - return !disableMonitoring && enableMetricsForwarding, nil + return !disableMonitoring && cpContext.HCP.Spec.Monitoring.MetricsForwarding.Mode == hyperv1.MetricsForwardingModeForward, nil } diff --git a/control-plane-operator/controllers/hostedcontrolplane/v2/endpoint_resolver/component_test.go b/control-plane-operator/controllers/hostedcontrolplane/v2/endpoint_resolver/component_test.go index 3bb96360d08c..f1c721f083f0 100644 --- a/control-plane-operator/controllers/hostedcontrolplane/v2/endpoint_resolver/component_test.go +++ b/control-plane-operator/controllers/hostedcontrolplane/v2/endpoint_resolver/component_test.go @@ -18,32 +18,39 @@ func TestPredicate(t *testing.T) { tests := []struct { name string annotations map[string]string + monitoring hyperv1.MonitoringSpec expected bool }{ { - name: "When both annotations are absent, it should return false", + name: "When metrics forwarding mode is not set, it should return false", annotations: map[string]string{}, expected: false, }, { - name: "When only DisableMonitoringServices is present, it should return false", - annotations: map[string]string{ - hyperv1.DisableMonitoringServices: "true", + name: "When DisableMonitoringServices is set, it should return false even if forwarding is enabled", + annotations: map[string]string{hyperv1.DisableMonitoringServices: "true"}, + monitoring: hyperv1.MonitoringSpec{ + MetricsForwarding: hyperv1.MetricsForwardingSpec{ + Mode: hyperv1.MetricsForwardingModeForward, + }, }, expected: false, }, { - name: "When only EnableMetricsForwarding is present, it should return true", - annotations: map[string]string{ - hyperv1.EnableMetricsForwarding: "true", + name: "When metrics forwarding mode is Enabled, it should return true", + monitoring: hyperv1.MonitoringSpec{ + MetricsForwarding: hyperv1.MetricsForwardingSpec{ + Mode: hyperv1.MetricsForwardingModeForward, + }, }, expected: true, }, { - name: "When both annotations are present, it should return false", - annotations: map[string]string{ - hyperv1.DisableMonitoringServices: "true", - hyperv1.EnableMetricsForwarding: "true", + name: "When metrics forwarding mode is Disabled, it should return false", + monitoring: hyperv1.MonitoringSpec{ + MetricsForwarding: hyperv1.MetricsForwardingSpec{ + Mode: hyperv1.MetricsForwardingModeNone, + }, }, expected: false, }, @@ -58,6 +65,9 @@ func TestPredicate(t *testing.T) { ObjectMeta: metav1.ObjectMeta{ Annotations: tc.annotations, }, + Spec: hyperv1.HostedControlPlaneSpec{ + Monitoring: tc.monitoring, + }, } cpContext := component.WorkloadContext{ @@ -65,7 +75,7 @@ func TestPredicate(t *testing.T) { HCP: hcp, } - result, err := predicate(cpContext) + result, err := Predicate(cpContext) g.Expect(err).ToNot(HaveOccurred()) g.Expect(result).To(Equal(tc.expected)) }) diff --git a/control-plane-operator/controllers/hostedcontrolplane/v2/metrics_proxy/component.go b/control-plane-operator/controllers/hostedcontrolplane/v2/metrics_proxy/component.go index 832f49d327fb..0f56505f57d1 100644 --- a/control-plane-operator/controllers/hostedcontrolplane/v2/metrics_proxy/component.go +++ b/control-plane-operator/controllers/hostedcontrolplane/v2/metrics_proxy/component.go @@ -38,7 +38,7 @@ func NewComponent(defaultIngressDomain string) component.ControlPlaneComponent { return component.NewDeploymentComponent(ComponentName, mp). WithAdaptFunction(adaptDeployment). - WithPredicate(predicate). + WithPredicate(endpointresolverv2.Predicate). WithManifestAdapter( "service.yaml", ). @@ -65,9 +65,3 @@ func NewComponent(defaultIngressDomain string) component.ControlPlaneComponent { WithDependencies(endpointresolverv2.ComponentName). Build() } - -func predicate(cpContext component.WorkloadContext) (bool, error) { - _, disableMonitoring := cpContext.HCP.Annotations[hyperv1.DisableMonitoringServices] - _, enableMetricsForwarding := cpContext.HCP.Annotations[hyperv1.EnableMetricsForwarding] - return !disableMonitoring && enableMetricsForwarding, nil -} diff --git a/control-plane-operator/hostedclusterconfigoperator/controllers/resources/resources.go b/control-plane-operator/hostedclusterconfigoperator/controllers/resources/resources.go index 9d120ae69273..0977086b0e33 100644 --- a/control-plane-operator/hostedclusterconfigoperator/controllers/resources/resources.go +++ b/control-plane-operator/hostedclusterconfigoperator/controllers/resources/resources.go @@ -971,7 +971,7 @@ func (r *reconciler) reconcileMetricsForwarder(ctx context.Context, hcp *hyperv1 if _, disabled := hcp.Annotations[hyperv1.DisableMonitoringServices]; disabled { return k8sutil.DeleteAllIfNeeded(ctx, r.client, deployment, cm, servingCA, podMonitor) } - if _, enabled := hcp.Annotations[hyperv1.EnableMetricsForwarding]; !enabled { + if hcp.Spec.Monitoring.MetricsForwarding.Mode != hyperv1.MetricsForwardingModeForward { return k8sutil.DeleteAllIfNeeded(ctx, r.client, deployment, cm, servingCA, podMonitor) } diff --git a/control-plane-operator/hostedclusterconfigoperator/controllers/resources/resources_test.go b/control-plane-operator/hostedclusterconfigoperator/controllers/resources/resources_test.go index 7d2f0c06c7dd..333bdcac6aa4 100644 --- a/control-plane-operator/hostedclusterconfigoperator/controllers/resources/resources_test.go +++ b/control-plane-operator/hostedclusterconfigoperator/controllers/resources/resources_test.go @@ -3188,11 +3188,12 @@ func TestReconcileMetricsForwarder(t *testing.T) { tests := []struct { name string annotations map[string]string + monitoring hyperv1.MonitoringSpec existingObjects []client.Object expectCleanup bool }{ { - name: "When EnableMetricsForwarding is not set, it should delete existing resources", + name: "When metrics forwarding mode is not set, it should delete existing resources", annotations: map[string]string{}, existingObjects: []client.Object{ manifests.MetricsForwarderDeployment(), @@ -3205,6 +3206,11 @@ func TestReconcileMetricsForwarder(t *testing.T) { { name: "When DisableMonitoringServices is set, it should delete existing resources", annotations: map[string]string{hyperv1.DisableMonitoringServices: "true"}, + monitoring: hyperv1.MonitoringSpec{ + MetricsForwarding: hyperv1.MetricsForwardingSpec{ + Mode: hyperv1.MetricsForwardingModeForward, + }, + }, existingObjects: []client.Object{ manifests.MetricsForwarderDeployment(), manifests.MetricsForwarderConfigMap(), @@ -3214,11 +3220,26 @@ func TestReconcileMetricsForwarder(t *testing.T) { expectCleanup: true, }, { - name: "When EnableMetricsForwarding is not set and no resources exist, it should succeed", + name: "When metrics forwarding mode is not set and no resources exist, it should succeed", annotations: map[string]string{}, existingObjects: nil, expectCleanup: true, }, + { + name: "When metrics forwarding mode is Disabled, it should delete existing resources", + monitoring: hyperv1.MonitoringSpec{ + MetricsForwarding: hyperv1.MetricsForwardingSpec{ + Mode: hyperv1.MetricsForwardingModeNone, + }, + }, + existingObjects: []client.Object{ + manifests.MetricsForwarderDeployment(), + manifests.MetricsForwarderConfigMap(), + manifests.MetricsForwarderServingCA(), + manifests.MetricsForwarderPodMonitor(), + }, + expectCleanup: true, + }, } for _, tt := range tests { @@ -3237,6 +3258,9 @@ func TestReconcileMetricsForwarder(t *testing.T) { Namespace: "test-ns", Annotations: tt.annotations, }, + Spec: hyperv1.HostedControlPlaneSpec{ + Monitoring: tt.monitoring, + }, } err := r.reconcileMetricsForwarder(t.Context(), hcp, nil) diff --git a/hypershift-operator/controllers/hostedcluster/hostedcluster_controller.go b/hypershift-operator/controllers/hostedcluster/hostedcluster_controller.go index b3a6c3828d75..c215c907ba5a 100644 --- a/hypershift-operator/controllers/hostedcluster/hostedcluster_controller.go +++ b/hypershift-operator/controllers/hostedcluster/hostedcluster_controller.go @@ -1683,6 +1683,10 @@ func (r *HostedClusterReconciler) reconcileOperatorDeployments(ctx context.Conte imageProvider.ComponentImages()["token-minter"] = utilitiesImage imageProvider.ComponentImages()[podspec.AvailabilityProberImageName] = utilitiesImage + metricsSet := r.MetricsSet + if hcluster.Spec.Monitoring.MetricsSet != "" { + metricsSet = metrics.MetricsSet(hcluster.Spec.Monitoring.MetricsSet) + } cpContext := controlplanecomponent.ControlPlaneContext{ Context: ctx, Client: r.Client, @@ -1691,7 +1695,7 @@ func (r *HostedClusterReconciler) reconcileOperatorDeployments(ctx context.Conte SetDefaultSecurityContext: r.SetDefaultSecurityContext, DefaultSecurityContextUID: securityContextUID, EnableCIDebugOutput: r.EnableCIDebugOutput, - MetricsSet: r.MetricsSet, + MetricsSet: metricsSet, ReleaseImageProvider: imageProvider, OmitOwnerReference: true, } @@ -2804,6 +2808,16 @@ func reconcileHostedControlPlane(hcp *hyperv1.HostedControlPlane, hcluster *hype hcp.Spec.OperatorConfiguration = nil } + hcp.Spec.Monitoring = hcluster.Spec.Monitoring + // Backward compat: if the deprecated annotation is present and the spec mode is not explicitly set, + // enable metrics forwarding on the HCP so that downstream consumers (CPO, HCCO) use the spec field. + // An explicit Disabled mode takes precedence over the annotation. + if hcp.Spec.Monitoring.MetricsForwarding.Mode == "" { + if _, hasAnnotation := hcluster.Annotations[hyperv1.EnableMetricsForwarding]; hasAnnotation { + hcp.Spec.Monitoring.MetricsForwarding.Mode = hyperv1.MetricsForwardingModeForward + } + } + return nil } @@ -5399,7 +5413,11 @@ func (r *HostedClusterReconciler) reconcileMonitoringDashboard(ctx context.Conte // and ensures that it is synced to the hosted control plane func (r *HostedClusterReconciler) reconcileSREMetricsConfig(ctx context.Context, createOrUpdate upsert.CreateOrUpdateFN, hcp *hyperv1.HostedControlPlane) error { log := ctrl.LoggerFrom(ctx) - if r.MetricsSet != metrics.MetricsSetSRE { + effectiveMetricsSet := r.MetricsSet + if hcp.Spec.Monitoring.MetricsSet != "" { + effectiveMetricsSet = metrics.MetricsSet(hcp.Spec.Monitoring.MetricsSet) + } + if effectiveMetricsSet != metrics.MetricsSetSRE { return nil } log.Info("Reconciling SRE metrics configuration") diff --git a/hypershift-operator/controllers/hostedcluster/hostedcluster_controller_test.go b/hypershift-operator/controllers/hostedcluster/hostedcluster_controller_test.go index 1d4318f28b17..a8526fcb8628 100644 --- a/hypershift-operator/controllers/hostedcluster/hostedcluster_controller_test.go +++ b/hypershift-operator/controllers/hostedcluster/hostedcluster_controller_test.go @@ -39,6 +39,7 @@ import ( "github.com/openshift/hypershift/support/config" controlplanecomponent "github.com/openshift/hypershift/support/controlplane-component" "github.com/openshift/hypershift/support/k8sutil" + "github.com/openshift/hypershift/support/metrics" "github.com/openshift/hypershift/support/releaseinfo" "github.com/openshift/hypershift/support/releaseinfo/registryclient" "github.com/openshift/hypershift/support/releaseinfo/testutils" @@ -877,6 +878,105 @@ func TestReconcileHostedControlPlaneConfiguration(t *testing.T) { } } +func TestReconcileHostedControlPlaneMonitoring(t *testing.T) { + t.Parallel() + + tests := []struct { + name string + monitoring hyperv1.MonitoringSpec + annotations map[string]string + expectedMonitoring hyperv1.MonitoringSpec + }{ + { + name: "When monitoring spec is set with mode Enabled, it should be copied to HCP", + monitoring: hyperv1.MonitoringSpec{ + MetricsForwarding: hyperv1.MetricsForwardingSpec{ + Mode: hyperv1.MetricsForwardingModeForward, + }, + MetricsSet: hyperv1.MetricsSetSRE, + }, + expectedMonitoring: hyperv1.MonitoringSpec{ + MetricsForwarding: hyperv1.MetricsForwardingSpec{ + Mode: hyperv1.MetricsForwardingModeForward, + }, + MetricsSet: hyperv1.MetricsSetSRE, + }, + }, + { + name: "When monitoring spec is not set and annotation is present, it should enable forwarding on HCP", + annotations: map[string]string{ + hyperv1.EnableMetricsForwarding: "true", + }, + expectedMonitoring: hyperv1.MonitoringSpec{ + MetricsForwarding: hyperv1.MetricsForwardingSpec{ + Mode: hyperv1.MetricsForwardingModeForward, + }, + }, + }, + { + name: "When neither spec nor annotation is set, it should leave monitoring empty", + expectedMonitoring: hyperv1.MonitoringSpec{}, + }, + { + name: "When mode is Disabled and annotation is present, it should not override Disabled", + monitoring: hyperv1.MonitoringSpec{ + MetricsForwarding: hyperv1.MetricsForwardingSpec{ + Mode: hyperv1.MetricsForwardingModeNone, + }, + }, + annotations: map[string]string{ + hyperv1.EnableMetricsForwarding: "true", + }, + expectedMonitoring: hyperv1.MonitoringSpec{ + MetricsForwarding: hyperv1.MetricsForwardingSpec{ + Mode: hyperv1.MetricsForwardingModeNone, + }, + }, + }, + { + name: "When mode is Enabled and annotation is absent, it should keep Enabled", + monitoring: hyperv1.MonitoringSpec{ + MetricsForwarding: hyperv1.MetricsForwardingSpec{ + Mode: hyperv1.MetricsForwardingModeForward, + }, + }, + expectedMonitoring: hyperv1.MonitoringSpec{ + MetricsForwarding: hyperv1.MetricsForwardingSpec{ + Mode: hyperv1.MetricsForwardingModeForward, + }, + }, + }, + { + name: "When metricsSet is set without forwarding mode, it should be copied", + monitoring: hyperv1.MonitoringSpec{ + MetricsSet: hyperv1.MetricsSetAll, + }, + expectedMonitoring: hyperv1.MonitoringSpec{ + MetricsSet: hyperv1.MetricsSetAll, + }, + }, + } + + for _, test := range tests { + t.Run(test.name, func(t *testing.T) { + t.Parallel() + g := NewGomegaWithT(t) + + hostedCluster := &hyperv1.HostedCluster{ + ObjectMeta: metav1.ObjectMeta{ + Annotations: test.annotations, + }, + } + hostedCluster.Spec.Monitoring = test.monitoring + hostedControlPlane := &hyperv1.HostedControlPlane{} + + err := reconcileHostedControlPlane(hostedControlPlane, hostedCluster, true, true, func() (map[string]string, error) { return nil, nil }) + g.Expect(err).ToNot(HaveOccurred()) + g.Expect(hostedControlPlane.Spec.Monitoring).To(Equal(test.expectedMonitoring)) + }) + } +} + func TestReconcileHostedControlPlaneAnnotations(t *testing.T) { t.Parallel() type testCase struct { @@ -8165,3 +8265,92 @@ func TestReconcileNonBlockingBehavior(t *testing.T) { }) } } + +func TestReconcileSREMetricsConfig_EffectiveMetricsSet(t *testing.T) { + operatorNS := "hypershift" + hcpNS := "clusters-test" + + sreConfigCM := &corev1.ConfigMap{ + ObjectMeta: metav1.ObjectMeta{ + Name: "sre-metric-set", + Namespace: operatorNS, + }, + Data: map[string]string{ + "config": "{}", + }, + } + + baseHCP := &hyperv1.HostedControlPlane{ + ObjectMeta: metav1.ObjectMeta{ + Name: "test", + Namespace: hcpNS, + }, + } + + noopCreateOrUpdate := func(ctx context.Context, c crclient.Client, obj crclient.Object, f controllerutil.MutateFn) (controllerutil.OperationResult, error) { + return controllerutil.OperationResultNone, nil + } + + tests := []struct { + name string + operatorMetricSet metrics.MetricsSet + hcpMetricsSet hyperv1.MetricsSet + expectSREReconcile bool + }{ + { + name: "When hcp.Spec.Monitoring.MetricsSet is SRE it should override operator default Telemetry", + operatorMetricSet: metrics.MetricsSetTelemetry, + hcpMetricsSet: hyperv1.MetricsSetSRE, + expectSREReconcile: true, + }, + { + name: "When hcp.Spec.Monitoring.MetricsSet is empty it should use operator default SRE", + operatorMetricSet: metrics.MetricsSetSRE, + hcpMetricsSet: "", + expectSREReconcile: true, + }, + { + name: "When hcp.Spec.Monitoring.MetricsSet is empty it should use operator default Telemetry and skip SRE", + operatorMetricSet: metrics.MetricsSetTelemetry, + hcpMetricsSet: "", + expectSREReconcile: false, + }, + { + name: "When hcp.Spec.Monitoring.MetricsSet is Telemetry it should override operator SRE and skip SRE reconcile", + operatorMetricSet: metrics.MetricsSetSRE, + hcpMetricsSet: hyperv1.MetricsSetTelemetry, + expectSREReconcile: false, + }, + } + + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + g := NewWithT(t) + + hcp := baseHCP.DeepCopy() + hcp.Spec.Monitoring.MetricsSet = tt.hcpMetricsSet + + objs := []crclient.Object{} + if tt.expectSREReconcile { + objs = append(objs, sreConfigCM.DeepCopy()) + } + cli := fake.NewClientBuilder().WithScheme(api.Scheme).WithObjects(objs...).Build() + + r := &HostedClusterReconciler{ + Client: cli, + MetricsSet: tt.operatorMetricSet, + OperatorNamespace: operatorNS, + } + + ctx := ctrl.LoggerInto(t.Context(), zap.New(zap.UseDevMode(true), zap.Level(zapcore.InfoLevel))) + err := r.reconcileSREMetricsConfig(ctx, noopCreateOrUpdate, hcp) + g.Expect(err).ToNot(HaveOccurred()) + + if tt.expectSREReconcile { + g.Expect(r.SREConfigHash).ToNot(BeEmpty(), "SRE config hash should be set when SRE metrics are active") + } else { + g.Expect(r.SREConfigHash).To(BeEmpty(), "SRE config hash should not be set when SRE metrics are not active") + } + }) + } +} diff --git a/test/e2e/util/util_metrics_proxy.go b/test/e2e/util/util_metrics_proxy.go index df0ed701c875..5bc051c3969f 100644 --- a/test/e2e/util/util_metrics_proxy.go +++ b/test/e2e/util/util_metrics_proxy.go @@ -46,15 +46,12 @@ func EnsureMetricsForwarderWorking(t *testing.T, ctx context.Context, mgtClient g := NewWithT(t) hcpNamespace := manifests.HostedControlPlaneNamespace(hostedCluster.Namespace, hostedCluster.Name) - // 1. Enable metrics forwarding by adding the annotation. + // 1. Enable metrics forwarding via spec. t.Log("Enabling metrics forwarding on HostedCluster") err := UpdateObject(t, ctx, mgtClient, hostedCluster, func(obj *hyperv1.HostedCluster) { - if obj.Annotations == nil { - obj.Annotations = make(map[string]string) - } - obj.Annotations[hyperv1.EnableMetricsForwarding] = "true" + obj.Spec.Monitoring.MetricsForwarding.Mode = hyperv1.MetricsForwardingModeForward }) - g.Expect(err).NotTo(HaveOccurred(), "failed to patch HostedCluster with EnableMetricsForwarding annotation") + g.Expect(err).NotTo(HaveOccurred(), "failed to enable metrics forwarding on HostedCluster") // 2. Wait for management-side deployments. t.Log("Waiting for endpoint-resolver deployment") diff --git a/test/e2e/v2/tests/hosted_cluster_metrics_test.go b/test/e2e/v2/tests/hosted_cluster_metrics_test.go index 82eff03f0409..ddd6058864ca 100644 --- a/test/e2e/v2/tests/hosted_cluster_metrics_test.go +++ b/test/e2e/v2/tests/hosted_cluster_metrics_test.go @@ -143,8 +143,8 @@ func EnsureMetricsForwarderWorkingTest(getTestCtx internal.TestContextGetter) { Skip("metrics forwarder requires version >= 4.22") } - if hostedCluster.Annotations[hyperv1.EnableMetricsForwarding] != "true" { - Skip("metrics forwarding annotation not set on hosted cluster; skipping verification test") + if hostedCluster.Spec.Monitoring.MetricsForwarding.Mode != hyperv1.MetricsForwardingModeForward { + Skip("metrics forwarding not enabled on hosted cluster; skipping verification test") } By("Waiting for management-side metrics deployments") From eafb10b96f7bbe28766a491fa440855f0db34610 Mon Sep 17 00:00:00 2001 From: Mulham Raee Date: Tue, 16 Jun 2026 18:39:04 +0200 Subject: [PATCH 4/6] feat(api,cpo): add metricsSet to MetricsForwardingSpec Allow the forwarded metrics set (guest-side, via metrics-proxy) to be configured independently from the MC-side ServiceMonitor/PodMonitor relabel configs. When MetricsForwardingSpec.MetricsSet is not set, it falls back to MonitoringSpec.MetricsSet (then to the global METRICS_SET env var). Co-Authored-By: Claude Opus 4.6 (1M context) --- api/hypershift/v1beta1/hostedcluster_types.go | 16 +++ .../AAA_ungated.yaml | 19 +++ .../ClusterUpdateAcceptRisks.yaml | 19 +++ .../ClusterVersionOperatorConfiguration.yaml | 19 +++ .../ExternalOIDC.yaml | 19 +++ ...ernalOIDCWithUIDAndExtraClaimMappings.yaml | 19 +++ .../ExternalOIDCWithUpstreamParity.yaml | 19 +++ .../GCPPlatform.yaml | 19 +++ .../HCPEtcdBackup.yaml | 19 +++ ...perShiftOnlyDynamicResourceAllocation.yaml | 19 +++ .../ImageStreamImportMode.yaml | 19 +++ .../KMSEncryptionProvider.yaml | 19 +++ .../OpenStack.yaml | 19 +++ .../TLSAdherence.yaml | 19 +++ .../AAA_ungated.yaml | 19 +++ .../ClusterUpdateAcceptRisks.yaml | 19 +++ .../ClusterVersionOperatorConfiguration.yaml | 19 +++ .../ExternalOIDC.yaml | 19 +++ ...ernalOIDCWithUIDAndExtraClaimMappings.yaml | 19 +++ .../ExternalOIDCWithUpstreamParity.yaml | 19 +++ .../GCPPlatform.yaml | 19 +++ .../HCPEtcdBackup.yaml | 19 +++ ...perShiftOnlyDynamicResourceAllocation.yaml | 19 +++ .../ImageStreamImportMode.yaml | 19 +++ .../KMSEncryptionProvider.yaml | 19 +++ .../OpenStack.yaml | 19 +++ .../TLSAdherence.yaml | 19 +++ .../v1beta1/metricsforwardingspec.go | 11 +- ...e.hostedclusters.monitoring.testsuite.yaml | 122 ++++++++++++++++++ ...usters-Hypershift-CustomNoUpgrade.crd.yaml | 19 +++ ...hostedclusters-Hypershift-Default.crd.yaml | 19 +++ ...s-Hypershift-TechPreviewNoUpgrade.crd.yaml | 19 +++ ...planes-Hypershift-CustomNoUpgrade.crd.yaml | 19 +++ ...dcontrolplanes-Hypershift-Default.crd.yaml | 19 +++ ...s-Hypershift-TechPreviewNoUpgrade.crd.yaml | 19 +++ .../v2/metrics_proxy/deployment.go | 3 + .../v2/metrics_proxy/deployment_test.go | 95 ++++++++++++++ docs/content/reference/aggregated-docs.md | 25 ++++ docs/content/reference/api.md | 25 ++++ .../hypershift/v1beta1/hostedcluster_types.go | 16 +++ 40 files changed, 920 insertions(+), 1 deletion(-) diff --git a/api/hypershift/v1beta1/hostedcluster_types.go b/api/hypershift/v1beta1/hostedcluster_types.go index 6524c9129019..c26677a63aa8 100644 --- a/api/hypershift/v1beta1/hostedcluster_types.go +++ b/api/hypershift/v1beta1/hostedcluster_types.go @@ -959,6 +959,22 @@ type MetricsForwardingSpec struct { // // +required Mode MetricsForwardingMode `json:"mode,omitempty"` + + // metricsSet specifies which set of metrics to forward to the hosted + // cluster's monitoring stack. This controls only the metrics-proxy forwarding + // path and does not affect management-cluster-side ServiceMonitor/PodMonitor + // relabel configurations. + // When not specified, the value from monitoring.metricsSet is used, which itself + // falls back to the global METRICS_SET environment variable (default "Telemetry"). + // + // "Telemetry" forwards only the minimal set of metrics required for OpenShift Telemetry. + // "SRE" forwards the Telemetry set plus additional metrics defined in the sre-metric-set + // ConfigMap, needed for SRE dashboards and alerts. + // "All" forwards all metrics from control plane components without filtering, + // which produces significantly higher metrics volume. + // + // +optional + MetricsSet MetricsSet `json:"metricsSet,omitempty"` } // ImageContentSource specifies image mirrors that can be used by cluster nodes diff --git a/api/hypershift/v1beta1/zz_generated.featuregated-crd-manifests/hostedclusters.hypershift.openshift.io/AAA_ungated.yaml b/api/hypershift/v1beta1/zz_generated.featuregated-crd-manifests/hostedclusters.hypershift.openshift.io/AAA_ungated.yaml index 99cfe712fae9..4d544c17ddf6 100644 --- a/api/hypershift/v1beta1/zz_generated.featuregated-crd-manifests/hostedclusters.hypershift.openshift.io/AAA_ungated.yaml +++ b/api/hypershift/v1beta1/zz_generated.featuregated-crd-manifests/hostedclusters.hypershift.openshift.io/AAA_ungated.yaml @@ -2894,6 +2894,25 @@ spec: hypershift.openshift.io/enable-metrics-forwarding annotation for backward compatibility. If neither is set, metrics forwarding is disabled. properties: + metricsSet: + description: |- + metricsSet specifies which set of metrics to forward to the hosted + cluster's monitoring stack. This controls only the metrics-proxy forwarding + path and does not affect management-cluster-side ServiceMonitor/PodMonitor + relabel configurations. + When not specified, the value from monitoring.metricsSet is used, which itself + falls back to the global METRICS_SET environment variable (default "Telemetry"). + + "Telemetry" forwards only the minimal set of metrics required for OpenShift Telemetry. + "SRE" forwards the Telemetry set plus additional metrics defined in the sre-metric-set + ConfigMap, needed for SRE dashboards and alerts. + "All" forwards all metrics from control plane components without filtering, + which produces significantly higher metrics volume. + enum: + - Telemetry + - SRE + - All + type: string mode: description: |- mode controls whether metrics forwarding is active for this hosted cluster. diff --git a/api/hypershift/v1beta1/zz_generated.featuregated-crd-manifests/hostedclusters.hypershift.openshift.io/ClusterUpdateAcceptRisks.yaml b/api/hypershift/v1beta1/zz_generated.featuregated-crd-manifests/hostedclusters.hypershift.openshift.io/ClusterUpdateAcceptRisks.yaml index 75bf45dc36ff..a2d326883d96 100644 --- a/api/hypershift/v1beta1/zz_generated.featuregated-crd-manifests/hostedclusters.hypershift.openshift.io/ClusterUpdateAcceptRisks.yaml +++ b/api/hypershift/v1beta1/zz_generated.featuregated-crd-manifests/hostedclusters.hypershift.openshift.io/ClusterUpdateAcceptRisks.yaml @@ -2885,6 +2885,25 @@ spec: hypershift.openshift.io/enable-metrics-forwarding annotation for backward compatibility. If neither is set, metrics forwarding is disabled. properties: + metricsSet: + description: |- + metricsSet specifies which set of metrics to forward to the hosted + cluster's monitoring stack. This controls only the metrics-proxy forwarding + path and does not affect management-cluster-side ServiceMonitor/PodMonitor + relabel configurations. + When not specified, the value from monitoring.metricsSet is used, which itself + falls back to the global METRICS_SET environment variable (default "Telemetry"). + + "Telemetry" forwards only the minimal set of metrics required for OpenShift Telemetry. + "SRE" forwards the Telemetry set plus additional metrics defined in the sre-metric-set + ConfigMap, needed for SRE dashboards and alerts. + "All" forwards all metrics from control plane components without filtering, + which produces significantly higher metrics volume. + enum: + - Telemetry + - SRE + - All + type: string mode: description: |- mode controls whether metrics forwarding is active for this hosted cluster. diff --git a/api/hypershift/v1beta1/zz_generated.featuregated-crd-manifests/hostedclusters.hypershift.openshift.io/ClusterVersionOperatorConfiguration.yaml b/api/hypershift/v1beta1/zz_generated.featuregated-crd-manifests/hostedclusters.hypershift.openshift.io/ClusterVersionOperatorConfiguration.yaml index 3394f1c1cacf..1bf220461eef 100644 --- a/api/hypershift/v1beta1/zz_generated.featuregated-crd-manifests/hostedclusters.hypershift.openshift.io/ClusterVersionOperatorConfiguration.yaml +++ b/api/hypershift/v1beta1/zz_generated.featuregated-crd-manifests/hostedclusters.hypershift.openshift.io/ClusterVersionOperatorConfiguration.yaml @@ -2885,6 +2885,25 @@ spec: hypershift.openshift.io/enable-metrics-forwarding annotation for backward compatibility. If neither is set, metrics forwarding is disabled. properties: + metricsSet: + description: |- + metricsSet specifies which set of metrics to forward to the hosted + cluster's monitoring stack. This controls only the metrics-proxy forwarding + path and does not affect management-cluster-side ServiceMonitor/PodMonitor + relabel configurations. + When not specified, the value from monitoring.metricsSet is used, which itself + falls back to the global METRICS_SET environment variable (default "Telemetry"). + + "Telemetry" forwards only the minimal set of metrics required for OpenShift Telemetry. + "SRE" forwards the Telemetry set plus additional metrics defined in the sre-metric-set + ConfigMap, needed for SRE dashboards and alerts. + "All" forwards all metrics from control plane components without filtering, + which produces significantly higher metrics volume. + enum: + - Telemetry + - SRE + - All + type: string mode: description: |- mode controls whether metrics forwarding is active for this hosted cluster. diff --git a/api/hypershift/v1beta1/zz_generated.featuregated-crd-manifests/hostedclusters.hypershift.openshift.io/ExternalOIDC.yaml b/api/hypershift/v1beta1/zz_generated.featuregated-crd-manifests/hostedclusters.hypershift.openshift.io/ExternalOIDC.yaml index 2f0e19e50a6f..bde5919d071b 100644 --- a/api/hypershift/v1beta1/zz_generated.featuregated-crd-manifests/hostedclusters.hypershift.openshift.io/ExternalOIDC.yaml +++ b/api/hypershift/v1beta1/zz_generated.featuregated-crd-manifests/hostedclusters.hypershift.openshift.io/ExternalOIDC.yaml @@ -3217,6 +3217,25 @@ spec: hypershift.openshift.io/enable-metrics-forwarding annotation for backward compatibility. If neither is set, metrics forwarding is disabled. properties: + metricsSet: + description: |- + metricsSet specifies which set of metrics to forward to the hosted + cluster's monitoring stack. This controls only the metrics-proxy forwarding + path and does not affect management-cluster-side ServiceMonitor/PodMonitor + relabel configurations. + When not specified, the value from monitoring.metricsSet is used, which itself + falls back to the global METRICS_SET environment variable (default "Telemetry"). + + "Telemetry" forwards only the minimal set of metrics required for OpenShift Telemetry. + "SRE" forwards the Telemetry set plus additional metrics defined in the sre-metric-set + ConfigMap, needed for SRE dashboards and alerts. + "All" forwards all metrics from control plane components without filtering, + which produces significantly higher metrics volume. + enum: + - Telemetry + - SRE + - All + type: string mode: description: |- mode controls whether metrics forwarding is active for this hosted cluster. diff --git a/api/hypershift/v1beta1/zz_generated.featuregated-crd-manifests/hostedclusters.hypershift.openshift.io/ExternalOIDCWithUIDAndExtraClaimMappings.yaml b/api/hypershift/v1beta1/zz_generated.featuregated-crd-manifests/hostedclusters.hypershift.openshift.io/ExternalOIDCWithUIDAndExtraClaimMappings.yaml index 2406038135ff..30e55779e97b 100644 --- a/api/hypershift/v1beta1/zz_generated.featuregated-crd-manifests/hostedclusters.hypershift.openshift.io/ExternalOIDCWithUIDAndExtraClaimMappings.yaml +++ b/api/hypershift/v1beta1/zz_generated.featuregated-crd-manifests/hostedclusters.hypershift.openshift.io/ExternalOIDCWithUIDAndExtraClaimMappings.yaml @@ -3357,6 +3357,25 @@ spec: hypershift.openshift.io/enable-metrics-forwarding annotation for backward compatibility. If neither is set, metrics forwarding is disabled. properties: + metricsSet: + description: |- + metricsSet specifies which set of metrics to forward to the hosted + cluster's monitoring stack. This controls only the metrics-proxy forwarding + path and does not affect management-cluster-side ServiceMonitor/PodMonitor + relabel configurations. + When not specified, the value from monitoring.metricsSet is used, which itself + falls back to the global METRICS_SET environment variable (default "Telemetry"). + + "Telemetry" forwards only the minimal set of metrics required for OpenShift Telemetry. + "SRE" forwards the Telemetry set plus additional metrics defined in the sre-metric-set + ConfigMap, needed for SRE dashboards and alerts. + "All" forwards all metrics from control plane components without filtering, + which produces significantly higher metrics volume. + enum: + - Telemetry + - SRE + - All + type: string mode: description: |- mode controls whether metrics forwarding is active for this hosted cluster. diff --git a/api/hypershift/v1beta1/zz_generated.featuregated-crd-manifests/hostedclusters.hypershift.openshift.io/ExternalOIDCWithUpstreamParity.yaml b/api/hypershift/v1beta1/zz_generated.featuregated-crd-manifests/hostedclusters.hypershift.openshift.io/ExternalOIDCWithUpstreamParity.yaml index fc5256fe09f5..8cbe6f554d78 100644 --- a/api/hypershift/v1beta1/zz_generated.featuregated-crd-manifests/hostedclusters.hypershift.openshift.io/ExternalOIDCWithUpstreamParity.yaml +++ b/api/hypershift/v1beta1/zz_generated.featuregated-crd-manifests/hostedclusters.hypershift.openshift.io/ExternalOIDCWithUpstreamParity.yaml @@ -3348,6 +3348,25 @@ spec: hypershift.openshift.io/enable-metrics-forwarding annotation for backward compatibility. If neither is set, metrics forwarding is disabled. properties: + metricsSet: + description: |- + metricsSet specifies which set of metrics to forward to the hosted + cluster's monitoring stack. This controls only the metrics-proxy forwarding + path and does not affect management-cluster-side ServiceMonitor/PodMonitor + relabel configurations. + When not specified, the value from monitoring.metricsSet is used, which itself + falls back to the global METRICS_SET environment variable (default "Telemetry"). + + "Telemetry" forwards only the minimal set of metrics required for OpenShift Telemetry. + "SRE" forwards the Telemetry set plus additional metrics defined in the sre-metric-set + ConfigMap, needed for SRE dashboards and alerts. + "All" forwards all metrics from control plane components without filtering, + which produces significantly higher metrics volume. + enum: + - Telemetry + - SRE + - All + type: string mode: description: |- mode controls whether metrics forwarding is active for this hosted cluster. diff --git a/api/hypershift/v1beta1/zz_generated.featuregated-crd-manifests/hostedclusters.hypershift.openshift.io/GCPPlatform.yaml b/api/hypershift/v1beta1/zz_generated.featuregated-crd-manifests/hostedclusters.hypershift.openshift.io/GCPPlatform.yaml index 7ab4ba1a1d17..0122e9e30468 100644 --- a/api/hypershift/v1beta1/zz_generated.featuregated-crd-manifests/hostedclusters.hypershift.openshift.io/GCPPlatform.yaml +++ b/api/hypershift/v1beta1/zz_generated.featuregated-crd-manifests/hostedclusters.hypershift.openshift.io/GCPPlatform.yaml @@ -2885,6 +2885,25 @@ spec: hypershift.openshift.io/enable-metrics-forwarding annotation for backward compatibility. If neither is set, metrics forwarding is disabled. properties: + metricsSet: + description: |- + metricsSet specifies which set of metrics to forward to the hosted + cluster's monitoring stack. This controls only the metrics-proxy forwarding + path and does not affect management-cluster-side ServiceMonitor/PodMonitor + relabel configurations. + When not specified, the value from monitoring.metricsSet is used, which itself + falls back to the global METRICS_SET environment variable (default "Telemetry"). + + "Telemetry" forwards only the minimal set of metrics required for OpenShift Telemetry. + "SRE" forwards the Telemetry set plus additional metrics defined in the sre-metric-set + ConfigMap, needed for SRE dashboards and alerts. + "All" forwards all metrics from control plane components without filtering, + which produces significantly higher metrics volume. + enum: + - Telemetry + - SRE + - All + type: string mode: description: |- mode controls whether metrics forwarding is active for this hosted cluster. diff --git a/api/hypershift/v1beta1/zz_generated.featuregated-crd-manifests/hostedclusters.hypershift.openshift.io/HCPEtcdBackup.yaml b/api/hypershift/v1beta1/zz_generated.featuregated-crd-manifests/hostedclusters.hypershift.openshift.io/HCPEtcdBackup.yaml index 03723228e71d..264b4d5d1089 100644 --- a/api/hypershift/v1beta1/zz_generated.featuregated-crd-manifests/hostedclusters.hypershift.openshift.io/HCPEtcdBackup.yaml +++ b/api/hypershift/v1beta1/zz_generated.featuregated-crd-manifests/hostedclusters.hypershift.openshift.io/HCPEtcdBackup.yaml @@ -2950,6 +2950,25 @@ spec: hypershift.openshift.io/enable-metrics-forwarding annotation for backward compatibility. If neither is set, metrics forwarding is disabled. properties: + metricsSet: + description: |- + metricsSet specifies which set of metrics to forward to the hosted + cluster's monitoring stack. This controls only the metrics-proxy forwarding + path and does not affect management-cluster-side ServiceMonitor/PodMonitor + relabel configurations. + When not specified, the value from monitoring.metricsSet is used, which itself + falls back to the global METRICS_SET environment variable (default "Telemetry"). + + "Telemetry" forwards only the minimal set of metrics required for OpenShift Telemetry. + "SRE" forwards the Telemetry set plus additional metrics defined in the sre-metric-set + ConfigMap, needed for SRE dashboards and alerts. + "All" forwards all metrics from control plane components without filtering, + which produces significantly higher metrics volume. + enum: + - Telemetry + - SRE + - All + type: string mode: description: |- mode controls whether metrics forwarding is active for this hosted cluster. diff --git a/api/hypershift/v1beta1/zz_generated.featuregated-crd-manifests/hostedclusters.hypershift.openshift.io/HyperShiftOnlyDynamicResourceAllocation.yaml b/api/hypershift/v1beta1/zz_generated.featuregated-crd-manifests/hostedclusters.hypershift.openshift.io/HyperShiftOnlyDynamicResourceAllocation.yaml index cd11289a80e5..dd8b23bde0c0 100644 --- a/api/hypershift/v1beta1/zz_generated.featuregated-crd-manifests/hostedclusters.hypershift.openshift.io/HyperShiftOnlyDynamicResourceAllocation.yaml +++ b/api/hypershift/v1beta1/zz_generated.featuregated-crd-manifests/hostedclusters.hypershift.openshift.io/HyperShiftOnlyDynamicResourceAllocation.yaml @@ -2907,6 +2907,25 @@ spec: hypershift.openshift.io/enable-metrics-forwarding annotation for backward compatibility. If neither is set, metrics forwarding is disabled. properties: + metricsSet: + description: |- + metricsSet specifies which set of metrics to forward to the hosted + cluster's monitoring stack. This controls only the metrics-proxy forwarding + path and does not affect management-cluster-side ServiceMonitor/PodMonitor + relabel configurations. + When not specified, the value from monitoring.metricsSet is used, which itself + falls back to the global METRICS_SET environment variable (default "Telemetry"). + + "Telemetry" forwards only the minimal set of metrics required for OpenShift Telemetry. + "SRE" forwards the Telemetry set plus additional metrics defined in the sre-metric-set + ConfigMap, needed for SRE dashboards and alerts. + "All" forwards all metrics from control plane components without filtering, + which produces significantly higher metrics volume. + enum: + - Telemetry + - SRE + - All + type: string mode: description: |- mode controls whether metrics forwarding is active for this hosted cluster. diff --git a/api/hypershift/v1beta1/zz_generated.featuregated-crd-manifests/hostedclusters.hypershift.openshift.io/ImageStreamImportMode.yaml b/api/hypershift/v1beta1/zz_generated.featuregated-crd-manifests/hostedclusters.hypershift.openshift.io/ImageStreamImportMode.yaml index 61138ad6f4a4..ede268058ec0 100644 --- a/api/hypershift/v1beta1/zz_generated.featuregated-crd-manifests/hostedclusters.hypershift.openshift.io/ImageStreamImportMode.yaml +++ b/api/hypershift/v1beta1/zz_generated.featuregated-crd-manifests/hostedclusters.hypershift.openshift.io/ImageStreamImportMode.yaml @@ -2903,6 +2903,25 @@ spec: hypershift.openshift.io/enable-metrics-forwarding annotation for backward compatibility. If neither is set, metrics forwarding is disabled. properties: + metricsSet: + description: |- + metricsSet specifies which set of metrics to forward to the hosted + cluster's monitoring stack. This controls only the metrics-proxy forwarding + path and does not affect management-cluster-side ServiceMonitor/PodMonitor + relabel configurations. + When not specified, the value from monitoring.metricsSet is used, which itself + falls back to the global METRICS_SET environment variable (default "Telemetry"). + + "Telemetry" forwards only the minimal set of metrics required for OpenShift Telemetry. + "SRE" forwards the Telemetry set plus additional metrics defined in the sre-metric-set + ConfigMap, needed for SRE dashboards and alerts. + "All" forwards all metrics from control plane components without filtering, + which produces significantly higher metrics volume. + enum: + - Telemetry + - SRE + - All + type: string mode: description: |- mode controls whether metrics forwarding is active for this hosted cluster. diff --git a/api/hypershift/v1beta1/zz_generated.featuregated-crd-manifests/hostedclusters.hypershift.openshift.io/KMSEncryptionProvider.yaml b/api/hypershift/v1beta1/zz_generated.featuregated-crd-manifests/hostedclusters.hypershift.openshift.io/KMSEncryptionProvider.yaml index 4e6f9e23be51..630bb3ee5156 100644 --- a/api/hypershift/v1beta1/zz_generated.featuregated-crd-manifests/hostedclusters.hypershift.openshift.io/KMSEncryptionProvider.yaml +++ b/api/hypershift/v1beta1/zz_generated.featuregated-crd-manifests/hostedclusters.hypershift.openshift.io/KMSEncryptionProvider.yaml @@ -2961,6 +2961,25 @@ spec: hypershift.openshift.io/enable-metrics-forwarding annotation for backward compatibility. If neither is set, metrics forwarding is disabled. properties: + metricsSet: + description: |- + metricsSet specifies which set of metrics to forward to the hosted + cluster's monitoring stack. This controls only the metrics-proxy forwarding + path and does not affect management-cluster-side ServiceMonitor/PodMonitor + relabel configurations. + When not specified, the value from monitoring.metricsSet is used, which itself + falls back to the global METRICS_SET environment variable (default "Telemetry"). + + "Telemetry" forwards only the minimal set of metrics required for OpenShift Telemetry. + "SRE" forwards the Telemetry set plus additional metrics defined in the sre-metric-set + ConfigMap, needed for SRE dashboards and alerts. + "All" forwards all metrics from control plane components without filtering, + which produces significantly higher metrics volume. + enum: + - Telemetry + - SRE + - All + type: string mode: description: |- mode controls whether metrics forwarding is active for this hosted cluster. diff --git a/api/hypershift/v1beta1/zz_generated.featuregated-crd-manifests/hostedclusters.hypershift.openshift.io/OpenStack.yaml b/api/hypershift/v1beta1/zz_generated.featuregated-crd-manifests/hostedclusters.hypershift.openshift.io/OpenStack.yaml index 062f1453a234..a2e929616593 100644 --- a/api/hypershift/v1beta1/zz_generated.featuregated-crd-manifests/hostedclusters.hypershift.openshift.io/OpenStack.yaml +++ b/api/hypershift/v1beta1/zz_generated.featuregated-crd-manifests/hostedclusters.hypershift.openshift.io/OpenStack.yaml @@ -2885,6 +2885,25 @@ spec: hypershift.openshift.io/enable-metrics-forwarding annotation for backward compatibility. If neither is set, metrics forwarding is disabled. properties: + metricsSet: + description: |- + metricsSet specifies which set of metrics to forward to the hosted + cluster's monitoring stack. This controls only the metrics-proxy forwarding + path and does not affect management-cluster-side ServiceMonitor/PodMonitor + relabel configurations. + When not specified, the value from monitoring.metricsSet is used, which itself + falls back to the global METRICS_SET environment variable (default "Telemetry"). + + "Telemetry" forwards only the minimal set of metrics required for OpenShift Telemetry. + "SRE" forwards the Telemetry set plus additional metrics defined in the sre-metric-set + ConfigMap, needed for SRE dashboards and alerts. + "All" forwards all metrics from control plane components without filtering, + which produces significantly higher metrics volume. + enum: + - Telemetry + - SRE + - All + type: string mode: description: |- mode controls whether metrics forwarding is active for this hosted cluster. diff --git a/api/hypershift/v1beta1/zz_generated.featuregated-crd-manifests/hostedclusters.hypershift.openshift.io/TLSAdherence.yaml b/api/hypershift/v1beta1/zz_generated.featuregated-crd-manifests/hostedclusters.hypershift.openshift.io/TLSAdherence.yaml index ee7e71dd2f96..f06c4d1801ce 100644 --- a/api/hypershift/v1beta1/zz_generated.featuregated-crd-manifests/hostedclusters.hypershift.openshift.io/TLSAdherence.yaml +++ b/api/hypershift/v1beta1/zz_generated.featuregated-crd-manifests/hostedclusters.hypershift.openshift.io/TLSAdherence.yaml @@ -2925,6 +2925,25 @@ spec: hypershift.openshift.io/enable-metrics-forwarding annotation for backward compatibility. If neither is set, metrics forwarding is disabled. properties: + metricsSet: + description: |- + metricsSet specifies which set of metrics to forward to the hosted + cluster's monitoring stack. This controls only the metrics-proxy forwarding + path and does not affect management-cluster-side ServiceMonitor/PodMonitor + relabel configurations. + When not specified, the value from monitoring.metricsSet is used, which itself + falls back to the global METRICS_SET environment variable (default "Telemetry"). + + "Telemetry" forwards only the minimal set of metrics required for OpenShift Telemetry. + "SRE" forwards the Telemetry set plus additional metrics defined in the sre-metric-set + ConfigMap, needed for SRE dashboards and alerts. + "All" forwards all metrics from control plane components without filtering, + which produces significantly higher metrics volume. + enum: + - Telemetry + - SRE + - All + type: string mode: description: |- mode controls whether metrics forwarding is active for this hosted cluster. diff --git a/api/hypershift/v1beta1/zz_generated.featuregated-crd-manifests/hostedcontrolplanes.hypershift.openshift.io/AAA_ungated.yaml b/api/hypershift/v1beta1/zz_generated.featuregated-crd-manifests/hostedcontrolplanes.hypershift.openshift.io/AAA_ungated.yaml index 964c8665065b..8e1182fd319b 100644 --- a/api/hypershift/v1beta1/zz_generated.featuregated-crd-manifests/hostedcontrolplanes.hypershift.openshift.io/AAA_ungated.yaml +++ b/api/hypershift/v1beta1/zz_generated.featuregated-crd-manifests/hostedcontrolplanes.hypershift.openshift.io/AAA_ungated.yaml @@ -2794,6 +2794,25 @@ spec: hypershift.openshift.io/enable-metrics-forwarding annotation for backward compatibility. If neither is set, metrics forwarding is disabled. properties: + metricsSet: + description: |- + metricsSet specifies which set of metrics to forward to the hosted + cluster's monitoring stack. This controls only the metrics-proxy forwarding + path and does not affect management-cluster-side ServiceMonitor/PodMonitor + relabel configurations. + When not specified, the value from monitoring.metricsSet is used, which itself + falls back to the global METRICS_SET environment variable (default "Telemetry"). + + "Telemetry" forwards only the minimal set of metrics required for OpenShift Telemetry. + "SRE" forwards the Telemetry set plus additional metrics defined in the sre-metric-set + ConfigMap, needed for SRE dashboards and alerts. + "All" forwards all metrics from control plane components without filtering, + which produces significantly higher metrics volume. + enum: + - Telemetry + - SRE + - All + type: string mode: description: |- mode controls whether metrics forwarding is active for this hosted cluster. diff --git a/api/hypershift/v1beta1/zz_generated.featuregated-crd-manifests/hostedcontrolplanes.hypershift.openshift.io/ClusterUpdateAcceptRisks.yaml b/api/hypershift/v1beta1/zz_generated.featuregated-crd-manifests/hostedcontrolplanes.hypershift.openshift.io/ClusterUpdateAcceptRisks.yaml index 10f467f7fd9c..ffa3ddad4d86 100644 --- a/api/hypershift/v1beta1/zz_generated.featuregated-crd-manifests/hostedcontrolplanes.hypershift.openshift.io/ClusterUpdateAcceptRisks.yaml +++ b/api/hypershift/v1beta1/zz_generated.featuregated-crd-manifests/hostedcontrolplanes.hypershift.openshift.io/ClusterUpdateAcceptRisks.yaml @@ -2785,6 +2785,25 @@ spec: hypershift.openshift.io/enable-metrics-forwarding annotation for backward compatibility. If neither is set, metrics forwarding is disabled. properties: + metricsSet: + description: |- + metricsSet specifies which set of metrics to forward to the hosted + cluster's monitoring stack. This controls only the metrics-proxy forwarding + path and does not affect management-cluster-side ServiceMonitor/PodMonitor + relabel configurations. + When not specified, the value from monitoring.metricsSet is used, which itself + falls back to the global METRICS_SET environment variable (default "Telemetry"). + + "Telemetry" forwards only the minimal set of metrics required for OpenShift Telemetry. + "SRE" forwards the Telemetry set plus additional metrics defined in the sre-metric-set + ConfigMap, needed for SRE dashboards and alerts. + "All" forwards all metrics from control plane components without filtering, + which produces significantly higher metrics volume. + enum: + - Telemetry + - SRE + - All + type: string mode: description: |- mode controls whether metrics forwarding is active for this hosted cluster. diff --git a/api/hypershift/v1beta1/zz_generated.featuregated-crd-manifests/hostedcontrolplanes.hypershift.openshift.io/ClusterVersionOperatorConfiguration.yaml b/api/hypershift/v1beta1/zz_generated.featuregated-crd-manifests/hostedcontrolplanes.hypershift.openshift.io/ClusterVersionOperatorConfiguration.yaml index 82179855b362..8e53c82c8c10 100644 --- a/api/hypershift/v1beta1/zz_generated.featuregated-crd-manifests/hostedcontrolplanes.hypershift.openshift.io/ClusterVersionOperatorConfiguration.yaml +++ b/api/hypershift/v1beta1/zz_generated.featuregated-crd-manifests/hostedcontrolplanes.hypershift.openshift.io/ClusterVersionOperatorConfiguration.yaml @@ -2785,6 +2785,25 @@ spec: hypershift.openshift.io/enable-metrics-forwarding annotation for backward compatibility. If neither is set, metrics forwarding is disabled. properties: + metricsSet: + description: |- + metricsSet specifies which set of metrics to forward to the hosted + cluster's monitoring stack. This controls only the metrics-proxy forwarding + path and does not affect management-cluster-side ServiceMonitor/PodMonitor + relabel configurations. + When not specified, the value from monitoring.metricsSet is used, which itself + falls back to the global METRICS_SET environment variable (default "Telemetry"). + + "Telemetry" forwards only the minimal set of metrics required for OpenShift Telemetry. + "SRE" forwards the Telemetry set plus additional metrics defined in the sre-metric-set + ConfigMap, needed for SRE dashboards and alerts. + "All" forwards all metrics from control plane components without filtering, + which produces significantly higher metrics volume. + enum: + - Telemetry + - SRE + - All + type: string mode: description: |- mode controls whether metrics forwarding is active for this hosted cluster. diff --git a/api/hypershift/v1beta1/zz_generated.featuregated-crd-manifests/hostedcontrolplanes.hypershift.openshift.io/ExternalOIDC.yaml b/api/hypershift/v1beta1/zz_generated.featuregated-crd-manifests/hostedcontrolplanes.hypershift.openshift.io/ExternalOIDC.yaml index b183508c7f5d..84b57ce38140 100644 --- a/api/hypershift/v1beta1/zz_generated.featuregated-crd-manifests/hostedcontrolplanes.hypershift.openshift.io/ExternalOIDC.yaml +++ b/api/hypershift/v1beta1/zz_generated.featuregated-crd-manifests/hostedcontrolplanes.hypershift.openshift.io/ExternalOIDC.yaml @@ -3117,6 +3117,25 @@ spec: hypershift.openshift.io/enable-metrics-forwarding annotation for backward compatibility. If neither is set, metrics forwarding is disabled. properties: + metricsSet: + description: |- + metricsSet specifies which set of metrics to forward to the hosted + cluster's monitoring stack. This controls only the metrics-proxy forwarding + path and does not affect management-cluster-side ServiceMonitor/PodMonitor + relabel configurations. + When not specified, the value from monitoring.metricsSet is used, which itself + falls back to the global METRICS_SET environment variable (default "Telemetry"). + + "Telemetry" forwards only the minimal set of metrics required for OpenShift Telemetry. + "SRE" forwards the Telemetry set plus additional metrics defined in the sre-metric-set + ConfigMap, needed for SRE dashboards and alerts. + "All" forwards all metrics from control plane components without filtering, + which produces significantly higher metrics volume. + enum: + - Telemetry + - SRE + - All + type: string mode: description: |- mode controls whether metrics forwarding is active for this hosted cluster. diff --git a/api/hypershift/v1beta1/zz_generated.featuregated-crd-manifests/hostedcontrolplanes.hypershift.openshift.io/ExternalOIDCWithUIDAndExtraClaimMappings.yaml b/api/hypershift/v1beta1/zz_generated.featuregated-crd-manifests/hostedcontrolplanes.hypershift.openshift.io/ExternalOIDCWithUIDAndExtraClaimMappings.yaml index bf5e25518e03..dbdbe0895029 100644 --- a/api/hypershift/v1beta1/zz_generated.featuregated-crd-manifests/hostedcontrolplanes.hypershift.openshift.io/ExternalOIDCWithUIDAndExtraClaimMappings.yaml +++ b/api/hypershift/v1beta1/zz_generated.featuregated-crd-manifests/hostedcontrolplanes.hypershift.openshift.io/ExternalOIDCWithUIDAndExtraClaimMappings.yaml @@ -3257,6 +3257,25 @@ spec: hypershift.openshift.io/enable-metrics-forwarding annotation for backward compatibility. If neither is set, metrics forwarding is disabled. properties: + metricsSet: + description: |- + metricsSet specifies which set of metrics to forward to the hosted + cluster's monitoring stack. This controls only the metrics-proxy forwarding + path and does not affect management-cluster-side ServiceMonitor/PodMonitor + relabel configurations. + When not specified, the value from monitoring.metricsSet is used, which itself + falls back to the global METRICS_SET environment variable (default "Telemetry"). + + "Telemetry" forwards only the minimal set of metrics required for OpenShift Telemetry. + "SRE" forwards the Telemetry set plus additional metrics defined in the sre-metric-set + ConfigMap, needed for SRE dashboards and alerts. + "All" forwards all metrics from control plane components without filtering, + which produces significantly higher metrics volume. + enum: + - Telemetry + - SRE + - All + type: string mode: description: |- mode controls whether metrics forwarding is active for this hosted cluster. diff --git a/api/hypershift/v1beta1/zz_generated.featuregated-crd-manifests/hostedcontrolplanes.hypershift.openshift.io/ExternalOIDCWithUpstreamParity.yaml b/api/hypershift/v1beta1/zz_generated.featuregated-crd-manifests/hostedcontrolplanes.hypershift.openshift.io/ExternalOIDCWithUpstreamParity.yaml index 77e7e2636cf1..2a7bb80ceb42 100644 --- a/api/hypershift/v1beta1/zz_generated.featuregated-crd-manifests/hostedcontrolplanes.hypershift.openshift.io/ExternalOIDCWithUpstreamParity.yaml +++ b/api/hypershift/v1beta1/zz_generated.featuregated-crd-manifests/hostedcontrolplanes.hypershift.openshift.io/ExternalOIDCWithUpstreamParity.yaml @@ -3248,6 +3248,25 @@ spec: hypershift.openshift.io/enable-metrics-forwarding annotation for backward compatibility. If neither is set, metrics forwarding is disabled. properties: + metricsSet: + description: |- + metricsSet specifies which set of metrics to forward to the hosted + cluster's monitoring stack. This controls only the metrics-proxy forwarding + path and does not affect management-cluster-side ServiceMonitor/PodMonitor + relabel configurations. + When not specified, the value from monitoring.metricsSet is used, which itself + falls back to the global METRICS_SET environment variable (default "Telemetry"). + + "Telemetry" forwards only the minimal set of metrics required for OpenShift Telemetry. + "SRE" forwards the Telemetry set plus additional metrics defined in the sre-metric-set + ConfigMap, needed for SRE dashboards and alerts. + "All" forwards all metrics from control plane components without filtering, + which produces significantly higher metrics volume. + enum: + - Telemetry + - SRE + - All + type: string mode: description: |- mode controls whether metrics forwarding is active for this hosted cluster. diff --git a/api/hypershift/v1beta1/zz_generated.featuregated-crd-manifests/hostedcontrolplanes.hypershift.openshift.io/GCPPlatform.yaml b/api/hypershift/v1beta1/zz_generated.featuregated-crd-manifests/hostedcontrolplanes.hypershift.openshift.io/GCPPlatform.yaml index 62f36f3a753f..ed48982b0ac2 100644 --- a/api/hypershift/v1beta1/zz_generated.featuregated-crd-manifests/hostedcontrolplanes.hypershift.openshift.io/GCPPlatform.yaml +++ b/api/hypershift/v1beta1/zz_generated.featuregated-crd-manifests/hostedcontrolplanes.hypershift.openshift.io/GCPPlatform.yaml @@ -2785,6 +2785,25 @@ spec: hypershift.openshift.io/enable-metrics-forwarding annotation for backward compatibility. If neither is set, metrics forwarding is disabled. properties: + metricsSet: + description: |- + metricsSet specifies which set of metrics to forward to the hosted + cluster's monitoring stack. This controls only the metrics-proxy forwarding + path and does not affect management-cluster-side ServiceMonitor/PodMonitor + relabel configurations. + When not specified, the value from monitoring.metricsSet is used, which itself + falls back to the global METRICS_SET environment variable (default "Telemetry"). + + "Telemetry" forwards only the minimal set of metrics required for OpenShift Telemetry. + "SRE" forwards the Telemetry set plus additional metrics defined in the sre-metric-set + ConfigMap, needed for SRE dashboards and alerts. + "All" forwards all metrics from control plane components without filtering, + which produces significantly higher metrics volume. + enum: + - Telemetry + - SRE + - All + type: string mode: description: |- mode controls whether metrics forwarding is active for this hosted cluster. diff --git a/api/hypershift/v1beta1/zz_generated.featuregated-crd-manifests/hostedcontrolplanes.hypershift.openshift.io/HCPEtcdBackup.yaml b/api/hypershift/v1beta1/zz_generated.featuregated-crd-manifests/hostedcontrolplanes.hypershift.openshift.io/HCPEtcdBackup.yaml index 3fc6830451e8..db7218933ac8 100644 --- a/api/hypershift/v1beta1/zz_generated.featuregated-crd-manifests/hostedcontrolplanes.hypershift.openshift.io/HCPEtcdBackup.yaml +++ b/api/hypershift/v1beta1/zz_generated.featuregated-crd-manifests/hostedcontrolplanes.hypershift.openshift.io/HCPEtcdBackup.yaml @@ -2850,6 +2850,25 @@ spec: hypershift.openshift.io/enable-metrics-forwarding annotation for backward compatibility. If neither is set, metrics forwarding is disabled. properties: + metricsSet: + description: |- + metricsSet specifies which set of metrics to forward to the hosted + cluster's monitoring stack. This controls only the metrics-proxy forwarding + path and does not affect management-cluster-side ServiceMonitor/PodMonitor + relabel configurations. + When not specified, the value from monitoring.metricsSet is used, which itself + falls back to the global METRICS_SET environment variable (default "Telemetry"). + + "Telemetry" forwards only the minimal set of metrics required for OpenShift Telemetry. + "SRE" forwards the Telemetry set plus additional metrics defined in the sre-metric-set + ConfigMap, needed for SRE dashboards and alerts. + "All" forwards all metrics from control plane components without filtering, + which produces significantly higher metrics volume. + enum: + - Telemetry + - SRE + - All + type: string mode: description: |- mode controls whether metrics forwarding is active for this hosted cluster. diff --git a/api/hypershift/v1beta1/zz_generated.featuregated-crd-manifests/hostedcontrolplanes.hypershift.openshift.io/HyperShiftOnlyDynamicResourceAllocation.yaml b/api/hypershift/v1beta1/zz_generated.featuregated-crd-manifests/hostedcontrolplanes.hypershift.openshift.io/HyperShiftOnlyDynamicResourceAllocation.yaml index 2284146766ca..007370476513 100644 --- a/api/hypershift/v1beta1/zz_generated.featuregated-crd-manifests/hostedcontrolplanes.hypershift.openshift.io/HyperShiftOnlyDynamicResourceAllocation.yaml +++ b/api/hypershift/v1beta1/zz_generated.featuregated-crd-manifests/hostedcontrolplanes.hypershift.openshift.io/HyperShiftOnlyDynamicResourceAllocation.yaml @@ -2807,6 +2807,25 @@ spec: hypershift.openshift.io/enable-metrics-forwarding annotation for backward compatibility. If neither is set, metrics forwarding is disabled. properties: + metricsSet: + description: |- + metricsSet specifies which set of metrics to forward to the hosted + cluster's monitoring stack. This controls only the metrics-proxy forwarding + path and does not affect management-cluster-side ServiceMonitor/PodMonitor + relabel configurations. + When not specified, the value from monitoring.metricsSet is used, which itself + falls back to the global METRICS_SET environment variable (default "Telemetry"). + + "Telemetry" forwards only the minimal set of metrics required for OpenShift Telemetry. + "SRE" forwards the Telemetry set plus additional metrics defined in the sre-metric-set + ConfigMap, needed for SRE dashboards and alerts. + "All" forwards all metrics from control plane components without filtering, + which produces significantly higher metrics volume. + enum: + - Telemetry + - SRE + - All + type: string mode: description: |- mode controls whether metrics forwarding is active for this hosted cluster. diff --git a/api/hypershift/v1beta1/zz_generated.featuregated-crd-manifests/hostedcontrolplanes.hypershift.openshift.io/ImageStreamImportMode.yaml b/api/hypershift/v1beta1/zz_generated.featuregated-crd-manifests/hostedcontrolplanes.hypershift.openshift.io/ImageStreamImportMode.yaml index b8e43647e4a3..465a38bbfcaa 100644 --- a/api/hypershift/v1beta1/zz_generated.featuregated-crd-manifests/hostedcontrolplanes.hypershift.openshift.io/ImageStreamImportMode.yaml +++ b/api/hypershift/v1beta1/zz_generated.featuregated-crd-manifests/hostedcontrolplanes.hypershift.openshift.io/ImageStreamImportMode.yaml @@ -2803,6 +2803,25 @@ spec: hypershift.openshift.io/enable-metrics-forwarding annotation for backward compatibility. If neither is set, metrics forwarding is disabled. properties: + metricsSet: + description: |- + metricsSet specifies which set of metrics to forward to the hosted + cluster's monitoring stack. This controls only the metrics-proxy forwarding + path and does not affect management-cluster-side ServiceMonitor/PodMonitor + relabel configurations. + When not specified, the value from monitoring.metricsSet is used, which itself + falls back to the global METRICS_SET environment variable (default "Telemetry"). + + "Telemetry" forwards only the minimal set of metrics required for OpenShift Telemetry. + "SRE" forwards the Telemetry set plus additional metrics defined in the sre-metric-set + ConfigMap, needed for SRE dashboards and alerts. + "All" forwards all metrics from control plane components without filtering, + which produces significantly higher metrics volume. + enum: + - Telemetry + - SRE + - All + type: string mode: description: |- mode controls whether metrics forwarding is active for this hosted cluster. diff --git a/api/hypershift/v1beta1/zz_generated.featuregated-crd-manifests/hostedcontrolplanes.hypershift.openshift.io/KMSEncryptionProvider.yaml b/api/hypershift/v1beta1/zz_generated.featuregated-crd-manifests/hostedcontrolplanes.hypershift.openshift.io/KMSEncryptionProvider.yaml index 7711978bccb7..d9d3d7604c59 100644 --- a/api/hypershift/v1beta1/zz_generated.featuregated-crd-manifests/hostedcontrolplanes.hypershift.openshift.io/KMSEncryptionProvider.yaml +++ b/api/hypershift/v1beta1/zz_generated.featuregated-crd-manifests/hostedcontrolplanes.hypershift.openshift.io/KMSEncryptionProvider.yaml @@ -2861,6 +2861,25 @@ spec: hypershift.openshift.io/enable-metrics-forwarding annotation for backward compatibility. If neither is set, metrics forwarding is disabled. properties: + metricsSet: + description: |- + metricsSet specifies which set of metrics to forward to the hosted + cluster's monitoring stack. This controls only the metrics-proxy forwarding + path and does not affect management-cluster-side ServiceMonitor/PodMonitor + relabel configurations. + When not specified, the value from monitoring.metricsSet is used, which itself + falls back to the global METRICS_SET environment variable (default "Telemetry"). + + "Telemetry" forwards only the minimal set of metrics required for OpenShift Telemetry. + "SRE" forwards the Telemetry set plus additional metrics defined in the sre-metric-set + ConfigMap, needed for SRE dashboards and alerts. + "All" forwards all metrics from control plane components without filtering, + which produces significantly higher metrics volume. + enum: + - Telemetry + - SRE + - All + type: string mode: description: |- mode controls whether metrics forwarding is active for this hosted cluster. diff --git a/api/hypershift/v1beta1/zz_generated.featuregated-crd-manifests/hostedcontrolplanes.hypershift.openshift.io/OpenStack.yaml b/api/hypershift/v1beta1/zz_generated.featuregated-crd-manifests/hostedcontrolplanes.hypershift.openshift.io/OpenStack.yaml index 0a25883e120f..b18955c36417 100644 --- a/api/hypershift/v1beta1/zz_generated.featuregated-crd-manifests/hostedcontrolplanes.hypershift.openshift.io/OpenStack.yaml +++ b/api/hypershift/v1beta1/zz_generated.featuregated-crd-manifests/hostedcontrolplanes.hypershift.openshift.io/OpenStack.yaml @@ -2785,6 +2785,25 @@ spec: hypershift.openshift.io/enable-metrics-forwarding annotation for backward compatibility. If neither is set, metrics forwarding is disabled. properties: + metricsSet: + description: |- + metricsSet specifies which set of metrics to forward to the hosted + cluster's monitoring stack. This controls only the metrics-proxy forwarding + path and does not affect management-cluster-side ServiceMonitor/PodMonitor + relabel configurations. + When not specified, the value from monitoring.metricsSet is used, which itself + falls back to the global METRICS_SET environment variable (default "Telemetry"). + + "Telemetry" forwards only the minimal set of metrics required for OpenShift Telemetry. + "SRE" forwards the Telemetry set plus additional metrics defined in the sre-metric-set + ConfigMap, needed for SRE dashboards and alerts. + "All" forwards all metrics from control plane components without filtering, + which produces significantly higher metrics volume. + enum: + - Telemetry + - SRE + - All + type: string mode: description: |- mode controls whether metrics forwarding is active for this hosted cluster. diff --git a/api/hypershift/v1beta1/zz_generated.featuregated-crd-manifests/hostedcontrolplanes.hypershift.openshift.io/TLSAdherence.yaml b/api/hypershift/v1beta1/zz_generated.featuregated-crd-manifests/hostedcontrolplanes.hypershift.openshift.io/TLSAdherence.yaml index a8ea56299e7f..36dfa0e9f0af 100644 --- a/api/hypershift/v1beta1/zz_generated.featuregated-crd-manifests/hostedcontrolplanes.hypershift.openshift.io/TLSAdherence.yaml +++ b/api/hypershift/v1beta1/zz_generated.featuregated-crd-manifests/hostedcontrolplanes.hypershift.openshift.io/TLSAdherence.yaml @@ -2825,6 +2825,25 @@ spec: hypershift.openshift.io/enable-metrics-forwarding annotation for backward compatibility. If neither is set, metrics forwarding is disabled. properties: + metricsSet: + description: |- + metricsSet specifies which set of metrics to forward to the hosted + cluster's monitoring stack. This controls only the metrics-proxy forwarding + path and does not affect management-cluster-side ServiceMonitor/PodMonitor + relabel configurations. + When not specified, the value from monitoring.metricsSet is used, which itself + falls back to the global METRICS_SET environment variable (default "Telemetry"). + + "Telemetry" forwards only the minimal set of metrics required for OpenShift Telemetry. + "SRE" forwards the Telemetry set plus additional metrics defined in the sre-metric-set + ConfigMap, needed for SRE dashboards and alerts. + "All" forwards all metrics from control plane components without filtering, + which produces significantly higher metrics volume. + enum: + - Telemetry + - SRE + - All + type: string mode: description: |- mode controls whether metrics forwarding is active for this hosted cluster. diff --git a/client/applyconfiguration/hypershift/v1beta1/metricsforwardingspec.go b/client/applyconfiguration/hypershift/v1beta1/metricsforwardingspec.go index 5cce10720800..9d3d57109691 100644 --- a/client/applyconfiguration/hypershift/v1beta1/metricsforwardingspec.go +++ b/client/applyconfiguration/hypershift/v1beta1/metricsforwardingspec.go @@ -24,7 +24,8 @@ import ( // MetricsForwardingSpecApplyConfiguration represents a declarative configuration of the MetricsForwardingSpec type for use // with apply. type MetricsForwardingSpecApplyConfiguration struct { - Mode *hypershiftv1beta1.MetricsForwardingMode `json:"mode,omitempty"` + Mode *hypershiftv1beta1.MetricsForwardingMode `json:"mode,omitempty"` + MetricsSet *hypershiftv1beta1.MetricsSet `json:"metricsSet,omitempty"` } // MetricsForwardingSpecApplyConfiguration constructs a declarative configuration of the MetricsForwardingSpec type for use with @@ -40,3 +41,11 @@ func (b *MetricsForwardingSpecApplyConfiguration) WithMode(value hypershiftv1bet b.Mode = &value return b } + +// WithMetricsSet sets the MetricsSet field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the MetricsSet field is set to the value of the last call. +func (b *MetricsForwardingSpecApplyConfiguration) WithMetricsSet(value hypershiftv1beta1.MetricsSet) *MetricsForwardingSpecApplyConfiguration { + b.MetricsSet = &value + return b +} diff --git a/cmd/install/assets/crds/hypershift-operator/tests/hostedclusters.hypershift.openshift.io/stable.hostedclusters.monitoring.testsuite.yaml b/cmd/install/assets/crds/hypershift-operator/tests/hostedclusters.hypershift.openshift.io/stable.hostedclusters.monitoring.testsuite.yaml index 3b7a2ab73bb9..ccdd069d6845 100644 --- a/cmd/install/assets/crds/hypershift-operator/tests/hostedclusters.hypershift.openshift.io/stable.hostedclusters.monitoring.testsuite.yaml +++ b/cmd/install/assets/crds/hypershift-operator/tests/hostedclusters.hypershift.openshift.io/stable.hostedclusters.monitoring.testsuite.yaml @@ -318,3 +318,125 @@ tests: type: Route route: {} expectedError: "spec.monitoring.metricsForwarding.mode" + + - name: When metricsForwarding has metricsSet SRE it should pass + initial: | + apiVersion: hypershift.openshift.io/v1beta1 + kind: HostedCluster + spec: + monitoring: + metricsForwarding: + mode: Forward + metricsSet: SRE + dns: + baseDomain: example.com + platform: + type: AWS + pullSecret: + name: secret + release: + image: quay.io/openshift-release-dev/ocp-release:4.15.11-x86_64 + secretEncryption: + aescbc: + activeKey: + name: key + type: aescbc + services: + - service: APIServer + servicePublishingStrategy: + type: Route + route: {} + - service: OAuthServer + servicePublishingStrategy: + type: Route + route: {} + - service: Konnectivity + servicePublishingStrategy: + type: Route + route: {} + - service: Ignition + servicePublishingStrategy: + type: Route + route: {} + + - name: When metricsForwarding metricsSet differs from monitoring metricsSet it should pass + initial: | + apiVersion: hypershift.openshift.io/v1beta1 + kind: HostedCluster + spec: + monitoring: + metricsForwarding: + mode: Forward + metricsSet: All + metricsSet: Telemetry + dns: + baseDomain: example.com + platform: + type: AWS + pullSecret: + name: secret + release: + image: quay.io/openshift-release-dev/ocp-release:4.15.11-x86_64 + secretEncryption: + aescbc: + activeKey: + name: key + type: aescbc + services: + - service: APIServer + servicePublishingStrategy: + type: Route + route: {} + - service: OAuthServer + servicePublishingStrategy: + type: Route + route: {} + - service: Konnectivity + servicePublishingStrategy: + type: Route + route: {} + - service: Ignition + servicePublishingStrategy: + type: Route + route: {} + + - name: When metricsForwarding has an invalid metricsSet it should fail + initial: | + apiVersion: hypershift.openshift.io/v1beta1 + kind: HostedCluster + spec: + monitoring: + metricsForwarding: + mode: Forward + metricsSet: InvalidValue + dns: + baseDomain: example.com + platform: + type: AWS + pullSecret: + name: secret + release: + image: quay.io/openshift-release-dev/ocp-release:4.15.11-x86_64 + secretEncryption: + aescbc: + activeKey: + name: key + type: aescbc + services: + - service: APIServer + servicePublishingStrategy: + type: Route + route: {} + - service: OAuthServer + servicePublishingStrategy: + type: Route + route: {} + - service: Konnectivity + servicePublishingStrategy: + type: Route + route: {} + - service: Ignition + servicePublishingStrategy: + type: Route + route: {} + expectedError: "spec.monitoring.metricsForwarding.metricsSet" diff --git a/cmd/install/assets/crds/hypershift-operator/zz_generated.crd-manifests/hostedclusters-Hypershift-CustomNoUpgrade.crd.yaml b/cmd/install/assets/crds/hypershift-operator/zz_generated.crd-manifests/hostedclusters-Hypershift-CustomNoUpgrade.crd.yaml index 5a0b5070557d..4d0f243131b7 100644 --- a/cmd/install/assets/crds/hypershift-operator/zz_generated.crd-manifests/hostedclusters-Hypershift-CustomNoUpgrade.crd.yaml +++ b/cmd/install/assets/crds/hypershift-operator/zz_generated.crd-manifests/hostedclusters-Hypershift-CustomNoUpgrade.crd.yaml @@ -3716,6 +3716,25 @@ spec: hypershift.openshift.io/enable-metrics-forwarding annotation for backward compatibility. If neither is set, metrics forwarding is disabled. properties: + metricsSet: + description: |- + metricsSet specifies which set of metrics to forward to the hosted + cluster's monitoring stack. This controls only the metrics-proxy forwarding + path and does not affect management-cluster-side ServiceMonitor/PodMonitor + relabel configurations. + When not specified, the value from monitoring.metricsSet is used, which itself + falls back to the global METRICS_SET environment variable (default "Telemetry"). + + "Telemetry" forwards only the minimal set of metrics required for OpenShift Telemetry. + "SRE" forwards the Telemetry set plus additional metrics defined in the sre-metric-set + ConfigMap, needed for SRE dashboards and alerts. + "All" forwards all metrics from control plane components without filtering, + which produces significantly higher metrics volume. + enum: + - Telemetry + - SRE + - All + type: string mode: description: |- mode controls whether metrics forwarding is active for this hosted cluster. diff --git a/cmd/install/assets/crds/hypershift-operator/zz_generated.crd-manifests/hostedclusters-Hypershift-Default.crd.yaml b/cmd/install/assets/crds/hypershift-operator/zz_generated.crd-manifests/hostedclusters-Hypershift-Default.crd.yaml index 51d196212970..2cf2896f4677 100644 --- a/cmd/install/assets/crds/hypershift-operator/zz_generated.crd-manifests/hostedclusters-Hypershift-Default.crd.yaml +++ b/cmd/install/assets/crds/hypershift-operator/zz_generated.crd-manifests/hostedclusters-Hypershift-Default.crd.yaml @@ -3386,6 +3386,25 @@ spec: hypershift.openshift.io/enable-metrics-forwarding annotation for backward compatibility. If neither is set, metrics forwarding is disabled. properties: + metricsSet: + description: |- + metricsSet specifies which set of metrics to forward to the hosted + cluster's monitoring stack. This controls only the metrics-proxy forwarding + path and does not affect management-cluster-side ServiceMonitor/PodMonitor + relabel configurations. + When not specified, the value from monitoring.metricsSet is used, which itself + falls back to the global METRICS_SET environment variable (default "Telemetry"). + + "Telemetry" forwards only the minimal set of metrics required for OpenShift Telemetry. + "SRE" forwards the Telemetry set plus additional metrics defined in the sre-metric-set + ConfigMap, needed for SRE dashboards and alerts. + "All" forwards all metrics from control plane components without filtering, + which produces significantly higher metrics volume. + enum: + - Telemetry + - SRE + - All + type: string mode: description: |- mode controls whether metrics forwarding is active for this hosted cluster. diff --git a/cmd/install/assets/crds/hypershift-operator/zz_generated.crd-manifests/hostedclusters-Hypershift-TechPreviewNoUpgrade.crd.yaml b/cmd/install/assets/crds/hypershift-operator/zz_generated.crd-manifests/hostedclusters-Hypershift-TechPreviewNoUpgrade.crd.yaml index 73f48a75ea10..14b73f26b7c3 100644 --- a/cmd/install/assets/crds/hypershift-operator/zz_generated.crd-manifests/hostedclusters-Hypershift-TechPreviewNoUpgrade.crd.yaml +++ b/cmd/install/assets/crds/hypershift-operator/zz_generated.crd-manifests/hostedclusters-Hypershift-TechPreviewNoUpgrade.crd.yaml @@ -3587,6 +3587,25 @@ spec: hypershift.openshift.io/enable-metrics-forwarding annotation for backward compatibility. If neither is set, metrics forwarding is disabled. properties: + metricsSet: + description: |- + metricsSet specifies which set of metrics to forward to the hosted + cluster's monitoring stack. This controls only the metrics-proxy forwarding + path and does not affect management-cluster-side ServiceMonitor/PodMonitor + relabel configurations. + When not specified, the value from monitoring.metricsSet is used, which itself + falls back to the global METRICS_SET environment variable (default "Telemetry"). + + "Telemetry" forwards only the minimal set of metrics required for OpenShift Telemetry. + "SRE" forwards the Telemetry set plus additional metrics defined in the sre-metric-set + ConfigMap, needed for SRE dashboards and alerts. + "All" forwards all metrics from control plane components without filtering, + which produces significantly higher metrics volume. + enum: + - Telemetry + - SRE + - All + type: string mode: description: |- mode controls whether metrics forwarding is active for this hosted cluster. diff --git a/cmd/install/assets/crds/hypershift-operator/zz_generated.crd-manifests/hostedcontrolplanes-Hypershift-CustomNoUpgrade.crd.yaml b/cmd/install/assets/crds/hypershift-operator/zz_generated.crd-manifests/hostedcontrolplanes-Hypershift-CustomNoUpgrade.crd.yaml index c2c2269ccc13..8bb34c854a5f 100644 --- a/cmd/install/assets/crds/hypershift-operator/zz_generated.crd-manifests/hostedcontrolplanes-Hypershift-CustomNoUpgrade.crd.yaml +++ b/cmd/install/assets/crds/hypershift-operator/zz_generated.crd-manifests/hostedcontrolplanes-Hypershift-CustomNoUpgrade.crd.yaml @@ -3616,6 +3616,25 @@ spec: hypershift.openshift.io/enable-metrics-forwarding annotation for backward compatibility. If neither is set, metrics forwarding is disabled. properties: + metricsSet: + description: |- + metricsSet specifies which set of metrics to forward to the hosted + cluster's monitoring stack. This controls only the metrics-proxy forwarding + path and does not affect management-cluster-side ServiceMonitor/PodMonitor + relabel configurations. + When not specified, the value from monitoring.metricsSet is used, which itself + falls back to the global METRICS_SET environment variable (default "Telemetry"). + + "Telemetry" forwards only the minimal set of metrics required for OpenShift Telemetry. + "SRE" forwards the Telemetry set plus additional metrics defined in the sre-metric-set + ConfigMap, needed for SRE dashboards and alerts. + "All" forwards all metrics from control plane components without filtering, + which produces significantly higher metrics volume. + enum: + - Telemetry + - SRE + - All + type: string mode: description: |- mode controls whether metrics forwarding is active for this hosted cluster. diff --git a/cmd/install/assets/crds/hypershift-operator/zz_generated.crd-manifests/hostedcontrolplanes-Hypershift-Default.crd.yaml b/cmd/install/assets/crds/hypershift-operator/zz_generated.crd-manifests/hostedcontrolplanes-Hypershift-Default.crd.yaml index 6e7c663c9c99..c167f5f107ff 100644 --- a/cmd/install/assets/crds/hypershift-operator/zz_generated.crd-manifests/hostedcontrolplanes-Hypershift-Default.crd.yaml +++ b/cmd/install/assets/crds/hypershift-operator/zz_generated.crd-manifests/hostedcontrolplanes-Hypershift-Default.crd.yaml @@ -3286,6 +3286,25 @@ spec: hypershift.openshift.io/enable-metrics-forwarding annotation for backward compatibility. If neither is set, metrics forwarding is disabled. properties: + metricsSet: + description: |- + metricsSet specifies which set of metrics to forward to the hosted + cluster's monitoring stack. This controls only the metrics-proxy forwarding + path and does not affect management-cluster-side ServiceMonitor/PodMonitor + relabel configurations. + When not specified, the value from monitoring.metricsSet is used, which itself + falls back to the global METRICS_SET environment variable (default "Telemetry"). + + "Telemetry" forwards only the minimal set of metrics required for OpenShift Telemetry. + "SRE" forwards the Telemetry set plus additional metrics defined in the sre-metric-set + ConfigMap, needed for SRE dashboards and alerts. + "All" forwards all metrics from control plane components without filtering, + which produces significantly higher metrics volume. + enum: + - Telemetry + - SRE + - All + type: string mode: description: |- mode controls whether metrics forwarding is active for this hosted cluster. diff --git a/cmd/install/assets/crds/hypershift-operator/zz_generated.crd-manifests/hostedcontrolplanes-Hypershift-TechPreviewNoUpgrade.crd.yaml b/cmd/install/assets/crds/hypershift-operator/zz_generated.crd-manifests/hostedcontrolplanes-Hypershift-TechPreviewNoUpgrade.crd.yaml index a3112d08641f..d441186c3403 100644 --- a/cmd/install/assets/crds/hypershift-operator/zz_generated.crd-manifests/hostedcontrolplanes-Hypershift-TechPreviewNoUpgrade.crd.yaml +++ b/cmd/install/assets/crds/hypershift-operator/zz_generated.crd-manifests/hostedcontrolplanes-Hypershift-TechPreviewNoUpgrade.crd.yaml @@ -3487,6 +3487,25 @@ spec: hypershift.openshift.io/enable-metrics-forwarding annotation for backward compatibility. If neither is set, metrics forwarding is disabled. properties: + metricsSet: + description: |- + metricsSet specifies which set of metrics to forward to the hosted + cluster's monitoring stack. This controls only the metrics-proxy forwarding + path and does not affect management-cluster-side ServiceMonitor/PodMonitor + relabel configurations. + When not specified, the value from monitoring.metricsSet is used, which itself + falls back to the global METRICS_SET environment variable (default "Telemetry"). + + "Telemetry" forwards only the minimal set of metrics required for OpenShift Telemetry. + "SRE" forwards the Telemetry set plus additional metrics defined in the sre-metric-set + ConfigMap, needed for SRE dashboards and alerts. + "All" forwards all metrics from control plane components without filtering, + which produces significantly higher metrics volume. + enum: + - Telemetry + - SRE + - All + type: string mode: description: |- mode controls whether metrics forwarding is active for this hosted cluster. diff --git a/control-plane-operator/controllers/hostedcontrolplane/v2/metrics_proxy/deployment.go b/control-plane-operator/controllers/hostedcontrolplane/v2/metrics_proxy/deployment.go index 5b368e4db42f..8a295ec1cde0 100644 --- a/control-plane-operator/controllers/hostedcontrolplane/v2/metrics_proxy/deployment.go +++ b/control-plane-operator/controllers/hostedcontrolplane/v2/metrics_proxy/deployment.go @@ -20,6 +20,9 @@ import ( func adaptDeployment(cpContext component.WorkloadContext, deployment *appsv1.Deployment) error { metricsSet := cpContext.MetricsSet + if fwdSet := cpContext.HCP.Spec.Monitoring.MetricsForwarding.MetricsSet; fwdSet != "" { + metricsSet = metrics.MetricsSet(fwdSet) + } if metricsSet == "" { metricsSet = metrics.MetricsSetAll } diff --git a/control-plane-operator/controllers/hostedcontrolplane/v2/metrics_proxy/deployment_test.go b/control-plane-operator/controllers/hostedcontrolplane/v2/metrics_proxy/deployment_test.go index c1ddb5fcbe40..14959578dfa1 100644 --- a/control-plane-operator/controllers/hostedcontrolplane/v2/metrics_proxy/deployment_test.go +++ b/control-plane-operator/controllers/hostedcontrolplane/v2/metrics_proxy/deployment_test.go @@ -4,9 +4,13 @@ import ( "context" "testing" + . "github.com/onsi/gomega" + hyperv1 "github.com/openshift/hypershift/api/hypershift/v1beta1" component "github.com/openshift/hypershift/support/controlplane-component" + "github.com/openshift/hypershift/support/metrics" + appsv1 "k8s.io/api/apps/v1" corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/runtime" @@ -484,3 +488,94 @@ func TestCertVolumeOptionalFlag(t *testing.T) { } }) } + +func TestAdaptDeployment_MetricsSetOverride(t *testing.T) { + t.Parallel() + + namespace := "clusters-test" + scheme := runtime.NewScheme() + _ = corev1.AddToScheme(scheme) + _ = prometheusoperatorv1.AddToScheme(scheme) + + baseDeployment := func() *appsv1.Deployment { + return &appsv1.Deployment{ + Spec: appsv1.DeploymentSpec{ + Template: corev1.PodTemplateSpec{ + Spec: corev1.PodSpec{ + Containers: []corev1.Container{ + {Name: ComponentName}, + }, + }, + }, + }, + } + } + + metricsSetArg := func(dep *appsv1.Deployment) string { + for _, c := range dep.Spec.Template.Spec.Containers { + if c.Name == ComponentName { + for i, arg := range c.Args { + if arg == "--metrics-set" && i+1 < len(c.Args) { + return c.Args[i+1] + } + } + } + } + return "" + } + + tests := []struct { + name string + contextMetricsSet metrics.MetricsSet + forwardingSet hyperv1.MetricsSet + expectedMetricsSet string + }{ + { + name: "When MetricsForwarding.MetricsSet is set it should override cpContext.MetricsSet", + contextMetricsSet: metrics.MetricsSetTelemetry, + forwardingSet: hyperv1.MetricsSetAll, + expectedMetricsSet: string(metrics.MetricsSetAll), + }, + { + name: "When MetricsForwarding.MetricsSet is empty it should use cpContext.MetricsSet", + contextMetricsSet: metrics.MetricsSetSRE, + forwardingSet: "", + expectedMetricsSet: string(metrics.MetricsSetSRE), + }, + { + name: "When both MetricsForwarding.MetricsSet and cpContext.MetricsSet are empty it should default to All", + contextMetricsSet: "", + forwardingSet: "", + expectedMetricsSet: string(metrics.MetricsSetAll), + }, + } + + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + t.Parallel() + g := NewWithT(t) + + fakeClient := fake.NewClientBuilder().WithScheme(scheme).Build() + cpContext := component.WorkloadContext{ + Context: context.Background(), + Client: fakeClient, + MetricsSet: tt.contextMetricsSet, + HCP: &hyperv1.HostedControlPlane{ + ObjectMeta: metav1.ObjectMeta{Namespace: namespace}, + Spec: hyperv1.HostedControlPlaneSpec{ + Monitoring: hyperv1.MonitoringSpec{ + MetricsForwarding: hyperv1.MetricsForwardingSpec{ + MetricsSet: tt.forwardingSet, + }, + }, + }, + }, + } + + dep := baseDeployment() + err := adaptDeployment(cpContext, dep) + g.Expect(err).ToNot(HaveOccurred()) + g.Expect(metricsSetArg(dep)).To(Equal(tt.expectedMetricsSet)) + }) + } +} diff --git a/docs/content/reference/aggregated-docs.md b/docs/content/reference/aggregated-docs.md index 34defd482599..b7d4960aa1e5 100644 --- a/docs/content/reference/aggregated-docs.md +++ b/docs/content/reference/aggregated-docs.md @@ -49530,11 +49530,36 @@ control plane, and a metrics-forwarder is deployed in the hosted cluster. When set to “None”, metrics forwarding is inactive.

+ + +metricsSet
+ + +MetricsSet + + + + +(Optional) +

metricsSet specifies which set of metrics to forward to the hosted +cluster’s monitoring stack. This controls only the metrics-proxy forwarding +path and does not affect management-cluster-side ServiceMonitor/PodMonitor +relabel configurations. +When not specified, the value from monitoring.metricsSet is used, which itself +falls back to the global METRICS_SET environment variable (default “Telemetry”).

+

“Telemetry” forwards only the minimal set of metrics required for OpenShift Telemetry. +“SRE” forwards the Telemetry set plus additional metrics defined in the sre-metric-set +ConfigMap, needed for SRE dashboards and alerts. +“All” forwards all metrics from control plane components without filtering, +which produces significantly higher metrics volume.

+ + ###MetricsSet { #hypershift.openshift.io/v1beta1.MetricsSet }

(Appears on: +MetricsForwardingSpec, MonitoringSpec)

diff --git a/docs/content/reference/api.md b/docs/content/reference/api.md index 1cce087a89ce..77767ebbe62c 100644 --- a/docs/content/reference/api.md +++ b/docs/content/reference/api.md @@ -13057,11 +13057,36 @@ control plane, and a metrics-forwarder is deployed in the hosted cluster. When set to “None”, metrics forwarding is inactive.

+ + +metricsSet
+ + +MetricsSet + + + + +(Optional) +

metricsSet specifies which set of metrics to forward to the hosted +cluster’s monitoring stack. This controls only the metrics-proxy forwarding +path and does not affect management-cluster-side ServiceMonitor/PodMonitor +relabel configurations. +When not specified, the value from monitoring.metricsSet is used, which itself +falls back to the global METRICS_SET environment variable (default “Telemetry”).

+

“Telemetry” forwards only the minimal set of metrics required for OpenShift Telemetry. +“SRE” forwards the Telemetry set plus additional metrics defined in the sre-metric-set +ConfigMap, needed for SRE dashboards and alerts. +“All” forwards all metrics from control plane components without filtering, +which produces significantly higher metrics volume.

+ + ###MetricsSet { #hypershift.openshift.io/v1beta1.MetricsSet }

(Appears on: +MetricsForwardingSpec, MonitoringSpec)

diff --git a/vendor/github.com/openshift/hypershift/api/hypershift/v1beta1/hostedcluster_types.go b/vendor/github.com/openshift/hypershift/api/hypershift/v1beta1/hostedcluster_types.go index 6524c9129019..c26677a63aa8 100644 --- a/vendor/github.com/openshift/hypershift/api/hypershift/v1beta1/hostedcluster_types.go +++ b/vendor/github.com/openshift/hypershift/api/hypershift/v1beta1/hostedcluster_types.go @@ -959,6 +959,22 @@ type MetricsForwardingSpec struct { // // +required Mode MetricsForwardingMode `json:"mode,omitempty"` + + // metricsSet specifies which set of metrics to forward to the hosted + // cluster's monitoring stack. This controls only the metrics-proxy forwarding + // path and does not affect management-cluster-side ServiceMonitor/PodMonitor + // relabel configurations. + // When not specified, the value from monitoring.metricsSet is used, which itself + // falls back to the global METRICS_SET environment variable (default "Telemetry"). + // + // "Telemetry" forwards only the minimal set of metrics required for OpenShift Telemetry. + // "SRE" forwards the Telemetry set plus additional metrics defined in the sre-metric-set + // ConfigMap, needed for SRE dashboards and alerts. + // "All" forwards all metrics from control plane components without filtering, + // which produces significantly higher metrics volume. + // + // +optional + MetricsSet MetricsSet `json:"metricsSet,omitempty"` } // ImageContentSource specifies image mirrors that can be used by cluster nodes From ef521750206804f770400c45915f13caadb96df6 Mon Sep 17 00:00:00 2001 From: Mulham Raee Date: Thu, 18 Jun 2026 15:45:45 +0200 Subject: [PATCH 5/6] fix(ho,cpo): address review feedback on metrics forwarding API - Broaden SRE ConfigMap watch to enqueue HostedClusters with per-cluster metricsSet SRE override, not just when operator global is SRE - Extract effectiveMetricsSet() helper to deduplicate override resolution - Fix comment to say "None" instead of "Disabled" matching the enum - Fix test names to use Forward/None instead of Enabled/Disabled - Add positive test for Mode=Forward verifying resources are preserved - Add envtest for required mode field on MetricsForwardingSpec - Add godoc to exported Predicate function - Add TestMetricsSetConstantsInSync asserting hyperv1/metrics type parity Co-Authored-By: Claude Opus 4.6 (1M context) --- ...e.hostedclusters.monitoring.testsuite.yaml | 40 +++++++++++++++++++ .../v2/endpoint_resolver/component.go | 1 + .../v2/endpoint_resolver/component_test.go | 4 +- .../v2/metrics_proxy/deployment_test.go | 9 +++++ .../controllers/resources/resources_test.go | 32 ++++++++++++++- .../hostedcluster/hostedcluster_controller.go | 30 +++++++------- .../hostedcluster/reconcile_legacy.go | 4 +- 7 files changed, 102 insertions(+), 18 deletions(-) diff --git a/cmd/install/assets/crds/hypershift-operator/tests/hostedclusters.hypershift.openshift.io/stable.hostedclusters.monitoring.testsuite.yaml b/cmd/install/assets/crds/hypershift-operator/tests/hostedclusters.hypershift.openshift.io/stable.hostedclusters.monitoring.testsuite.yaml index ccdd069d6845..46cd922423f6 100644 --- a/cmd/install/assets/crds/hypershift-operator/tests/hostedclusters.hypershift.openshift.io/stable.hostedclusters.monitoring.testsuite.yaml +++ b/cmd/install/assets/crds/hypershift-operator/tests/hostedclusters.hypershift.openshift.io/stable.hostedclusters.monitoring.testsuite.yaml @@ -440,3 +440,43 @@ tests: type: Route route: {} expectedError: "spec.monitoring.metricsForwarding.metricsSet" + + - name: When metricsForwarding is present without required mode it should fail + initial: | + apiVersion: hypershift.openshift.io/v1beta1 + kind: HostedCluster + spec: + monitoring: + metricsForwarding: + metricsSet: SRE + dns: + baseDomain: example.com + platform: + type: AWS + pullSecret: + name: secret + release: + image: quay.io/openshift-release-dev/ocp-release:4.15.11-x86_64 + secretEncryption: + aescbc: + activeKey: + name: key + type: aescbc + services: + - service: APIServer + servicePublishingStrategy: + type: Route + route: {} + - service: OAuthServer + servicePublishingStrategy: + type: Route + route: {} + - service: Konnectivity + servicePublishingStrategy: + type: Route + route: {} + - service: Ignition + servicePublishingStrategy: + type: Route + route: {} + expectedError: "spec.monitoring.metricsForwarding.mode" diff --git a/control-plane-operator/controllers/hostedcontrolplane/v2/endpoint_resolver/component.go b/control-plane-operator/controllers/hostedcontrolplane/v2/endpoint_resolver/component.go index 940ff11f3fbf..f5fbfc96d08f 100644 --- a/control-plane-operator/controllers/hostedcontrolplane/v2/endpoint_resolver/component.go +++ b/control-plane-operator/controllers/hostedcontrolplane/v2/endpoint_resolver/component.go @@ -43,6 +43,7 @@ func NewComponent() component.ControlPlaneComponent { Build() } +// Predicate returns true when metrics forwarding components should be deployed. func Predicate(cpContext component.WorkloadContext) (bool, error) { _, disableMonitoring := cpContext.HCP.Annotations[hyperv1.DisableMonitoringServices] return !disableMonitoring && cpContext.HCP.Spec.Monitoring.MetricsForwarding.Mode == hyperv1.MetricsForwardingModeForward, nil diff --git a/control-plane-operator/controllers/hostedcontrolplane/v2/endpoint_resolver/component_test.go b/control-plane-operator/controllers/hostedcontrolplane/v2/endpoint_resolver/component_test.go index f1c721f083f0..ff7ded818893 100644 --- a/control-plane-operator/controllers/hostedcontrolplane/v2/endpoint_resolver/component_test.go +++ b/control-plane-operator/controllers/hostedcontrolplane/v2/endpoint_resolver/component_test.go @@ -37,7 +37,7 @@ func TestPredicate(t *testing.T) { expected: false, }, { - name: "When metrics forwarding mode is Enabled, it should return true", + name: "When metrics forwarding mode is Forward, it should return true", monitoring: hyperv1.MonitoringSpec{ MetricsForwarding: hyperv1.MetricsForwardingSpec{ Mode: hyperv1.MetricsForwardingModeForward, @@ -46,7 +46,7 @@ func TestPredicate(t *testing.T) { expected: true, }, { - name: "When metrics forwarding mode is Disabled, it should return false", + name: "When metrics forwarding mode is None, it should return false", monitoring: hyperv1.MonitoringSpec{ MetricsForwarding: hyperv1.MetricsForwardingSpec{ Mode: hyperv1.MetricsForwardingModeNone, diff --git a/control-plane-operator/controllers/hostedcontrolplane/v2/metrics_proxy/deployment_test.go b/control-plane-operator/controllers/hostedcontrolplane/v2/metrics_proxy/deployment_test.go index 14959578dfa1..b50b37dcdad0 100644 --- a/control-plane-operator/controllers/hostedcontrolplane/v2/metrics_proxy/deployment_test.go +++ b/control-plane-operator/controllers/hostedcontrolplane/v2/metrics_proxy/deployment_test.go @@ -475,6 +475,15 @@ func TestCollectSecretOrConfigMapRef(t *testing.T) { }) } +func TestMetricsSetConstantsInSync(t *testing.T) { + t.Parallel() + g := NewWithT(t) + + g.Expect(string(hyperv1.MetricsSetTelemetry)).To(Equal(string(metrics.MetricsSetTelemetry))) + g.Expect(string(hyperv1.MetricsSetSRE)).To(Equal(string(metrics.MetricsSetSRE))) + g.Expect(string(hyperv1.MetricsSetAll)).To(Equal(string(metrics.MetricsSetAll))) +} + // Verify certRef is correctly identified for the ptr.To helper. func TestCertVolumeOptionalFlag(t *testing.T) { t.Parallel() diff --git a/control-plane-operator/hostedclusterconfigoperator/controllers/resources/resources_test.go b/control-plane-operator/hostedclusterconfigoperator/controllers/resources/resources_test.go index 333bdcac6aa4..cb3e319fa3e5 100644 --- a/control-plane-operator/hostedclusterconfigoperator/controllers/resources/resources_test.go +++ b/control-plane-operator/hostedclusterconfigoperator/controllers/resources/resources_test.go @@ -3226,7 +3226,7 @@ func TestReconcileMetricsForwarder(t *testing.T) { expectCleanup: true, }, { - name: "When metrics forwarding mode is Disabled, it should delete existing resources", + name: "When metrics forwarding mode is None, it should delete existing resources", monitoring: hyperv1.MonitoringSpec{ MetricsForwarding: hyperv1.MetricsForwardingSpec{ Mode: hyperv1.MetricsForwardingModeNone, @@ -3240,6 +3240,21 @@ func TestReconcileMetricsForwarder(t *testing.T) { }, expectCleanup: true, }, + { + name: "When metrics forwarding mode is Forward, it should not delete resources", + monitoring: hyperv1.MonitoringSpec{ + MetricsForwarding: hyperv1.MetricsForwardingSpec{ + Mode: hyperv1.MetricsForwardingModeForward, + }, + }, + existingObjects: []client.Object{ + manifests.MetricsForwarderDeployment(), + manifests.MetricsForwarderConfigMap(), + manifests.MetricsForwarderServingCA(), + manifests.MetricsForwarderPodMonitor(), + }, + expectCleanup: false, + }, } for _, tt := range tests { @@ -3247,8 +3262,11 @@ func TestReconcileMetricsForwarder(t *testing.T) { g := NewGomegaWithT(t) guestClient := fake.NewClientBuilder().WithScheme(api.Scheme).WithObjects(tt.existingObjects...).Build() + cpClient := fake.NewClientBuilder().WithScheme(api.Scheme).Build() r := &reconciler{ client: guestClient, + cpClient: cpClient, + hcpNamespace: "test-ns", CreateOrUpdateProvider: &simpleCreateOrUpdater{}, } @@ -3278,6 +3296,18 @@ func TestReconcileMetricsForwarder(t *testing.T) { podMonitor := manifests.MetricsForwarderPodMonitor() g.Expect(apierrors.IsNotFound(guestClient.Get(t.Context(), client.ObjectKeyFromObject(podMonitor), podMonitor))).To(BeTrue(), "pod monitor should be deleted") + } else { + deployment := manifests.MetricsForwarderDeployment() + g.Expect(guestClient.Get(t.Context(), client.ObjectKeyFromObject(deployment), deployment)).To(Succeed(), "deployment should be preserved") + + cm := manifests.MetricsForwarderConfigMap() + g.Expect(guestClient.Get(t.Context(), client.ObjectKeyFromObject(cm), cm)).To(Succeed(), "configmap should be preserved") + + servingCA := manifests.MetricsForwarderServingCA() + g.Expect(guestClient.Get(t.Context(), client.ObjectKeyFromObject(servingCA), servingCA)).To(Succeed(), "serving CA should be preserved") + + podMonitor := manifests.MetricsForwarderPodMonitor() + g.Expect(guestClient.Get(t.Context(), client.ObjectKeyFromObject(podMonitor), podMonitor)).To(Succeed(), "pod monitor should be preserved") } }) } diff --git a/hypershift-operator/controllers/hostedcluster/hostedcluster_controller.go b/hypershift-operator/controllers/hostedcluster/hostedcluster_controller.go index c215c907ba5a..3bdf460465a4 100644 --- a/hypershift-operator/controllers/hostedcluster/hostedcluster_controller.go +++ b/hypershift-operator/controllers/hostedcluster/hostedcluster_controller.go @@ -1683,10 +1683,7 @@ func (r *HostedClusterReconciler) reconcileOperatorDeployments(ctx context.Conte imageProvider.ComponentImages()["token-minter"] = utilitiesImage imageProvider.ComponentImages()[podspec.AvailabilityProberImageName] = utilitiesImage - metricsSet := r.MetricsSet - if hcluster.Spec.Monitoring.MetricsSet != "" { - metricsSet = metrics.MetricsSet(hcluster.Spec.Monitoring.MetricsSet) - } + metricsSet := r.effectiveMetricsSet(hcluster.Spec.Monitoring) cpContext := controlplanecomponent.ControlPlaneContext{ Context: ctx, Client: r.Client, @@ -2811,7 +2808,7 @@ func reconcileHostedControlPlane(hcp *hyperv1.HostedControlPlane, hcluster *hype hcp.Spec.Monitoring = hcluster.Spec.Monitoring // Backward compat: if the deprecated annotation is present and the spec mode is not explicitly set, // enable metrics forwarding on the HCP so that downstream consumers (CPO, HCCO) use the spec field. - // An explicit Disabled mode takes precedence over the annotation. + // An explicit None mode takes precedence over the annotation. if hcp.Spec.Monitoring.MetricsForwarding.Mode == "" { if _, hasAnnotation := hcluster.Annotations[hyperv1.EnableMetricsForwarding]; hasAnnotation { hcp.Spec.Monitoring.MetricsForwarding.Mode = hyperv1.MetricsForwardingModeForward @@ -3853,16 +3850,18 @@ func enqueueHostedClustersFunc(metricsSet metrics.MetricsSet, operatorNamespace switch typedObj := obj.(type) { case *corev1.ConfigMap: - if metricsSet == metrics.MetricsSetSRE && typedObj.Name == metrics.SREConfigurationConfigMapName && typedObj.Namespace == operatorNamespace { - // A change has occurred to the SRE metrics set configuration. We should requeue all HostedClusters + if typedObj.Name == metrics.SREConfigurationConfigMapName && typedObj.Namespace == operatorNamespace { hcList := &hyperv1.HostedClusterList{} if err := c.List(ctx, hcList); err != nil { - // An error occurred, report it. log.Error(err, "failed to list hosted clusters while processing SRE config event") } requests := make([]reconcile.Request, 0, len(hcList.Items)) for _, hc := range hcList.Items { - requests = append(requests, reconcile.Request{NamespacedName: types.NamespacedName{Name: hc.Name, Namespace: hc.Namespace}}) + if metricsSet == metrics.MetricsSetSRE || + hc.Spec.Monitoring.MetricsSet == hyperv1.MetricsSetSRE || + hc.Spec.Monitoring.MetricsForwarding.MetricsSet == hyperv1.MetricsSetSRE { + requests = append(requests, reconcile.Request{NamespacedName: types.NamespacedName{Name: hc.Name, Namespace: hc.Namespace}}) + } } return requests } @@ -5409,15 +5408,18 @@ func (r *HostedClusterReconciler) reconcileMonitoringDashboard(ctx context.Conte return nil } +func (r *HostedClusterReconciler) effectiveMetricsSet(monitoring hyperv1.MonitoringSpec) metrics.MetricsSet { + if monitoring.MetricsSet != "" { + return metrics.MetricsSet(monitoring.MetricsSet) + } + return r.MetricsSet +} + // reconcileSREMetricsConfig loads the SRE metrics configuration (avoids parsing if the content is the same) // and ensures that it is synced to the hosted control plane func (r *HostedClusterReconciler) reconcileSREMetricsConfig(ctx context.Context, createOrUpdate upsert.CreateOrUpdateFN, hcp *hyperv1.HostedControlPlane) error { log := ctrl.LoggerFrom(ctx) - effectiveMetricsSet := r.MetricsSet - if hcp.Spec.Monitoring.MetricsSet != "" { - effectiveMetricsSet = metrics.MetricsSet(hcp.Spec.Monitoring.MetricsSet) - } - if effectiveMetricsSet != metrics.MetricsSetSRE { + if r.effectiveMetricsSet(hcp.Spec.Monitoring) != metrics.MetricsSetSRE { return nil } log.Info("Reconciling SRE metrics configuration") diff --git a/hypershift-operator/controllers/hostedcluster/reconcile_legacy.go b/hypershift-operator/controllers/hostedcluster/reconcile_legacy.go index 784c37038335..a9b056fa692e 100644 --- a/hypershift-operator/controllers/hostedcluster/reconcile_legacy.go +++ b/hypershift-operator/controllers/hostedcluster/reconcile_legacy.go @@ -1676,6 +1676,8 @@ func (r *HostedClusterReconciler) reconcileLegacy(ctx context.Context, req ctrl. return ctrl.Result{}, fmt.Errorf("failed to parse SecurityContext UID: %w", err) } } + + metricsSet := r.effectiveMetricsSet(hcluster.Spec.Monitoring) cpContext := controlplanecomponent.ControlPlaneContext{ Context: ctx, Client: r.Client, @@ -1684,7 +1686,7 @@ func (r *HostedClusterReconciler) reconcileLegacy(ctx context.Context, req ctrl. SetDefaultSecurityContext: r.SetDefaultSecurityContext, DefaultSecurityContextUID: securityContextUID, EnableCIDebugOutput: r.EnableCIDebugOutput, - MetricsSet: r.MetricsSet, + MetricsSet: metricsSet, ReleaseImageProvider: imageProvider, OmitOwnerReference: true, } From 170c140fa5fc016db3a38c7550ce07ba9d32bcaf Mon Sep 17 00:00:00 2001 From: Mulham Raee Date: Wed, 24 Jun 2026 12:45:12 +0200 Subject: [PATCH 6/6] fix(ho): mirror metrics forwarding spec to annotation for N-1 CPO compat Older CPOs (4.22) only read the EnableMetricsForwarding annotation, not the new spec.monitoring.metricsForwarding field. When the HO sets the spec on the HCP without also setting the annotation, a 4.22 CPO never deploys metrics forwarding components, breaking 4.22 e2e tests and real-world N-1 version skew scenarios. Co-Authored-By: Claude Opus 4.6 (1M context) --- .../hostedcluster/hostedcluster_controller.go | 12 +++++++++ .../hostedcluster_controller_test.go | 26 +++++++++++++------ 2 files changed, 30 insertions(+), 8 deletions(-) diff --git a/hypershift-operator/controllers/hostedcluster/hostedcluster_controller.go b/hypershift-operator/controllers/hostedcluster/hostedcluster_controller.go index 3bdf460465a4..a5a1e3c45e64 100644 --- a/hypershift-operator/controllers/hostedcluster/hostedcluster_controller.go +++ b/hypershift-operator/controllers/hostedcluster/hostedcluster_controller.go @@ -2815,6 +2815,18 @@ func reconcileHostedControlPlane(hcp *hyperv1.HostedControlPlane, hcluster *hype } } + // N-1 compat: older CPOs (4.22) only read the annotation, not the spec field. + // Mirror the spec mode to the annotation so they can still deploy metrics forwarding. + switch hcp.Spec.Monitoring.MetricsForwarding.Mode { + case hyperv1.MetricsForwardingModeForward: + if hcp.Annotations == nil { + hcp.Annotations = map[string]string{} + } + hcp.Annotations[hyperv1.EnableMetricsForwarding] = "true" + case hyperv1.MetricsForwardingModeNone: + delete(hcp.Annotations, hyperv1.EnableMetricsForwarding) + } + return nil } diff --git a/hypershift-operator/controllers/hostedcluster/hostedcluster_controller_test.go b/hypershift-operator/controllers/hostedcluster/hostedcluster_controller_test.go index a8526fcb8628..436ed7629241 100644 --- a/hypershift-operator/controllers/hostedcluster/hostedcluster_controller_test.go +++ b/hypershift-operator/controllers/hostedcluster/hostedcluster_controller_test.go @@ -882,13 +882,14 @@ func TestReconcileHostedControlPlaneMonitoring(t *testing.T) { t.Parallel() tests := []struct { - name string - monitoring hyperv1.MonitoringSpec - annotations map[string]string - expectedMonitoring hyperv1.MonitoringSpec + name string + monitoring hyperv1.MonitoringSpec + annotations map[string]string + expectedMonitoring hyperv1.MonitoringSpec + expectAnnotationOnHCP bool }{ { - name: "When monitoring spec is set with mode Enabled, it should be copied to HCP", + name: "When monitoring spec is set with mode Forward, it should be copied to HCP and set annotation for N-1 compat", monitoring: hyperv1.MonitoringSpec{ MetricsForwarding: hyperv1.MetricsForwardingSpec{ Mode: hyperv1.MetricsForwardingModeForward, @@ -901,9 +902,10 @@ func TestReconcileHostedControlPlaneMonitoring(t *testing.T) { }, MetricsSet: hyperv1.MetricsSetSRE, }, + expectAnnotationOnHCP: true, }, { - name: "When monitoring spec is not set and annotation is present, it should enable forwarding on HCP", + name: "When monitoring spec is not set and annotation is present, it should enable forwarding on HCP and keep annotation", annotations: map[string]string{ hyperv1.EnableMetricsForwarding: "true", }, @@ -912,13 +914,14 @@ func TestReconcileHostedControlPlaneMonitoring(t *testing.T) { Mode: hyperv1.MetricsForwardingModeForward, }, }, + expectAnnotationOnHCP: true, }, { name: "When neither spec nor annotation is set, it should leave monitoring empty", expectedMonitoring: hyperv1.MonitoringSpec{}, }, { - name: "When mode is Disabled and annotation is present, it should not override Disabled", + name: "When mode is None and annotation is present, it should not override None and should remove annotation", monitoring: hyperv1.MonitoringSpec{ MetricsForwarding: hyperv1.MetricsForwardingSpec{ Mode: hyperv1.MetricsForwardingModeNone, @@ -932,9 +935,10 @@ func TestReconcileHostedControlPlaneMonitoring(t *testing.T) { Mode: hyperv1.MetricsForwardingModeNone, }, }, + expectAnnotationOnHCP: false, }, { - name: "When mode is Enabled and annotation is absent, it should keep Enabled", + name: "When mode is Forward and annotation is absent, it should keep Forward and set annotation for N-1 compat", monitoring: hyperv1.MonitoringSpec{ MetricsForwarding: hyperv1.MetricsForwardingSpec{ Mode: hyperv1.MetricsForwardingModeForward, @@ -945,6 +949,7 @@ func TestReconcileHostedControlPlaneMonitoring(t *testing.T) { Mode: hyperv1.MetricsForwardingModeForward, }, }, + expectAnnotationOnHCP: true, }, { name: "When metricsSet is set without forwarding mode, it should be copied", @@ -973,6 +978,11 @@ func TestReconcileHostedControlPlaneMonitoring(t *testing.T) { err := reconcileHostedControlPlane(hostedControlPlane, hostedCluster, true, true, func() (map[string]string, error) { return nil, nil }) g.Expect(err).ToNot(HaveOccurred()) g.Expect(hostedControlPlane.Spec.Monitoring).To(Equal(test.expectedMonitoring)) + if test.expectAnnotationOnHCP { + g.Expect(hostedControlPlane.Annotations).To(HaveKeyWithValue(hyperv1.EnableMetricsForwarding, "true")) + } else { + g.Expect(hostedControlPlane.Annotations).ToNot(HaveKey(hyperv1.EnableMetricsForwarding)) + } }) } }