From a9e0bddce744c63fc4bdac73998ad5b2afb023a1 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 cb618ee4b09a..760ffb8f4a91 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 ce0ecaf81ee5..c334bbf6353a 100644 --- a/api/hypershift/v1beta1/hostedcluster_types.go +++ b/api/hypershift/v1beta1/hostedcluster_types.go @@ -273,6 +273,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 @@ -835,6 +837,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. @@ -871,6 +882,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 3c57726de447bfcf16f2254150e9cc16b89006a3 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 ++++ .../AutoNodeKarpenter.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 ++++ .../AAA_ungated.yaml | 45 ++++ .../AutoNodeKarpenter.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 ++++ .../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 3c1718831a7c..527a3b9a28ff 100644 --- a/api/hypershift/v1beta1/zz_generated.deepcopy.go +++ b/api/hypershift/v1beta1/zz_generated.deepcopy.go @@ -2454,6 +2454,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. @@ -2627,6 +2628,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)) @@ -3486,6 +3488,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 6a43dd36a5b8..1ea4f6adce71 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 @@ -2736,6 +2736,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/AutoNodeKarpenter.yaml b/api/hypershift/v1beta1/zz_generated.featuregated-crd-manifests/hostedclusters.hypershift.openshift.io/AutoNodeKarpenter.yaml index dba29960a1b8..6e08313664cb 100644 --- a/api/hypershift/v1beta1/zz_generated.featuregated-crd-manifests/hostedclusters.hypershift.openshift.io/AutoNodeKarpenter.yaml +++ b/api/hypershift/v1beta1/zz_generated.featuregated-crd-manifests/hostedclusters.hypershift.openshift.io/AutoNodeKarpenter.yaml @@ -2863,6 +2863,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 ae33d6d3e07d..72fe44d3fc1f 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 @@ -2727,6 +2727,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 c20cf7ab2b3e..388ca2c0c1cf 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 @@ -2727,6 +2727,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 7e35088d6ff8..d533b42ac7aa 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 @@ -3060,6 +3060,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 9693ed970d74..51ccfa2a262d 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 @@ -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/ExternalOIDCWithUpstreamParity.yaml b/api/hypershift/v1beta1/zz_generated.featuregated-crd-manifests/hostedclusters.hypershift.openshift.io/ExternalOIDCWithUpstreamParity.yaml index ad2f5eb3c432..d1b76d0692bd 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 @@ -3181,6 +3181,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 e925ed7ee0a9..d44f1852b24f 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 @@ -2727,6 +2727,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 8c514b6f9470..859caad63511 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 @@ -2792,6 +2792,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 0d88e73b6802..175712502d9c 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 @@ -2749,6 +2749,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 03bf685635d1..0d952599e4d6 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 @@ -2745,6 +2745,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 cc37823e4884..e17d0e3aaf52 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 @@ -2803,6 +2803,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 078863df10ed..e7fcf3957961 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 @@ -2727,6 +2727,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 a761964daf44..2fabdca50fa5 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 @@ -2636,6 +2636,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/AutoNodeKarpenter.yaml b/api/hypershift/v1beta1/zz_generated.featuregated-crd-manifests/hostedcontrolplanes.hypershift.openshift.io/AutoNodeKarpenter.yaml index eaec5504e031..b41ea276a2c7 100644 --- a/api/hypershift/v1beta1/zz_generated.featuregated-crd-manifests/hostedcontrolplanes.hypershift.openshift.io/AutoNodeKarpenter.yaml +++ b/api/hypershift/v1beta1/zz_generated.featuregated-crd-manifests/hostedcontrolplanes.hypershift.openshift.io/AutoNodeKarpenter.yaml @@ -2765,6 +2765,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 29801153bfd3..c366997e3840 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 @@ -2627,6 +2627,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 babd4ac02c0b..dc52a48e5adf 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 @@ -2627,6 +2627,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 c01534ee08f4..ad2d474f2938 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 @@ -2960,6 +2960,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 e5deab3ce474..8a82b84abc18 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 @@ -3100,6 +3100,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 28f733262692..a60987e43a92 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 @@ -3081,6 +3081,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 c91707459fdc..8d8a7dacd80b 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 @@ -2627,6 +2627,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 8edd8df4ca2a..4e53ce7e33b0 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 @@ -2692,6 +2692,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 c86527fffe00..abc27ac0e4f9 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 @@ -2649,6 +2649,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 ce0bd35a480b..67cfd3feb72c 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 @@ -2645,6 +2645,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 5b233d53ff9f..eeb648414e8b 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 @@ -2703,6 +2703,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 da3ccbc41d00..ec10613c6bb8 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 @@ -2627,6 +2627,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 169082f81c34..f993c1da5034 100644 --- a/client/applyconfiguration/utils.go +++ b/client/applyconfiguration/utils.go @@ -319,6 +319,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 8f4696f02dfa..d476edd587bf 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 @@ -3645,6 +3645,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 1e7000c992ea..5b34e722572a 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 @@ -3229,6 +3229,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 449e067ff34f..a3cc42bf4186 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 @@ -3556,6 +3556,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 1d428efff530..a823ed1af011 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 @@ -3547,6 +3547,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 27ccd2cd2da2..147c54ee2d20 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 @@ -3129,6 +3129,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 9b19e7197c89..7fc6a7b5aefe 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 @@ -3458,6 +3458,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 755af3f57307..efaad6207663 100644 --- a/docs/content/reference/aggregated-docs.md +++ b/docs/content/reference/aggregated-docs.md @@ -31455,6 +31455,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.

+ + @@ -39977,6 +39995,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 } @@ -40560,6 +40596,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
@@ -43174,6 +43226,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 08dba9d9804e..55ed3dcfbf17 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.

+ + @@ -9526,6 +9544,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 } @@ -10109,6 +10145,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
@@ -12723,6 +12775,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 cb618ee4b09a..760ffb8f4a91 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 ce0ecaf81ee5..c334bbf6353a 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 @@ -273,6 +273,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 @@ -835,6 +837,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. @@ -871,6 +882,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 3c1718831a7c..527a3b9a28ff 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 @@ -2454,6 +2454,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. @@ -2627,6 +2628,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)) @@ -3486,6 +3488,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 7a7f2972e614dfa03134fe589e02e358688ce39b Mon Sep 17 00:00:00 2001 From: Mulham Raee Date: Tue, 30 Jun 2026 14:53:08 +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 (cherry picked from commit ea1eb172ac1b285415ab568f30142b6f2ea204a4) (backport: excluded test/e2e/ changes, resolved conflicts for release-4.22) 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 | 190 +++++++++++ 8 files changed, 583 insertions(+), 28 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 c459be228fb5..f2cd6b777e27 100644 --- a/control-plane-operator/hostedclusterconfigoperator/controllers/resources/resources.go +++ b/control-plane-operator/hostedclusterconfigoperator/controllers/resources/resources.go @@ -916,7 +916,7 @@ func (r *reconciler) reconcileMetricsForwarder(ctx context.Context, hcp *hyperv1 if _, disabled := hcp.Annotations[hyperv1.DisableMonitoringServices]; disabled { return util.DeleteAllIfNeeded(ctx, r.client, deployment, cm, servingCA, podMonitor) } - if _, enabled := hcp.Annotations[hyperv1.EnableMetricsForwarding]; !enabled { + if hcp.Spec.Monitoring.MetricsForwarding.Mode != hyperv1.MetricsForwardingModeForward { return util.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 1bf13ff11914..9d9928b4322f 100644 --- a/control-plane-operator/hostedclusterconfigoperator/controllers/resources/resources_test.go +++ b/control-plane-operator/hostedclusterconfigoperator/controllers/resources/resources_test.go @@ -3000,11 +3000,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(), @@ -3017,6 +3018,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(), @@ -3026,11 +3032,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 { @@ -3049,6 +3070,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 803d803df0a9..8a02173c0db1 100644 --- a/hypershift-operator/controllers/hostedcluster/hostedcluster_controller.go +++ b/hypershift-operator/controllers/hostedcluster/hostedcluster_controller.go @@ -2007,6 +2007,10 @@ func (r *HostedClusterReconciler) reconcile(ctx context.Context, req ctrl.Reques return ctrl.Result{}, fmt.Errorf("failed to parse SecurityContext UID: %w", err) } } + metricsSet := r.MetricsSet + if hcluster.Spec.Monitoring.MetricsSet != "" { + metricsSet = metrics.MetricsSet(hcluster.Spec.Monitoring.MetricsSet) + } cpContext := controlplanecomponent.ControlPlaneContext{ Context: ctx, Client: r.Client, @@ -2015,7 +2019,7 @@ func (r *HostedClusterReconciler) reconcile(ctx context.Context, req ctrl.Reques SetDefaultSecurityContext: r.SetDefaultSecurityContext, DefaultSecurityContextUID: securityContextUID, EnableCIDebugOutput: r.EnableCIDebugOutput, - MetricsSet: r.MetricsSet, + MetricsSet: metricsSet, ReleaseImageProvider: imageProvider, OmitOwnerReference: true, } @@ -2534,6 +2538,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 } @@ -5044,7 +5058,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 1a594e950d00..dc95d5d1a5c1 100644 --- a/hypershift-operator/controllers/hostedcluster/hostedcluster_controller_test.go +++ b/hypershift-operator/controllers/hostedcluster/hostedcluster_controller_test.go @@ -35,6 +35,7 @@ import ( fakecapabilities "github.com/openshift/hypershift/support/capabilities/fake" "github.com/openshift/hypershift/support/config" controlplanecomponent "github.com/openshift/hypershift/support/controlplane-component" + "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" @@ -65,6 +66,7 @@ import ( ctrl "sigs.k8s.io/controller-runtime" crclient "sigs.k8s.io/controller-runtime/pkg/client" "sigs.k8s.io/controller-runtime/pkg/client/fake" + "sigs.k8s.io/controller-runtime/pkg/controller/controllerutil" "sigs.k8s.io/controller-runtime/pkg/log/zap" "sigs.k8s.io/controller-runtime/pkg/reconcile" @@ -603,6 +605,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) { type testCase struct { name string @@ -6529,3 +6630,92 @@ func TestComputeEndpointServiceCondition(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") + } + }) + } +} From 2e011ddd7798c76d91dee7de3d1d46c754ac5146 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 +++ .../AutoNodeKarpenter.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 +++ .../AAA_ungated.yaml | 19 +++ .../AutoNodeKarpenter.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 +++ .../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 c334bbf6353a..adcd239e7fcc 100644 --- a/api/hypershift/v1beta1/hostedcluster_types.go +++ b/api/hypershift/v1beta1/hostedcluster_types.go @@ -955,6 +955,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 1ea4f6adce71..874de534f244 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 @@ -2753,6 +2753,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/AutoNodeKarpenter.yaml b/api/hypershift/v1beta1/zz_generated.featuregated-crd-manifests/hostedclusters.hypershift.openshift.io/AutoNodeKarpenter.yaml index 6e08313664cb..ee4af5617e10 100644 --- a/api/hypershift/v1beta1/zz_generated.featuregated-crd-manifests/hostedclusters.hypershift.openshift.io/AutoNodeKarpenter.yaml +++ b/api/hypershift/v1beta1/zz_generated.featuregated-crd-manifests/hostedclusters.hypershift.openshift.io/AutoNodeKarpenter.yaml @@ -2880,6 +2880,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 72fe44d3fc1f..de291cd0af5d 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 @@ -2744,6 +2744,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 388ca2c0c1cf..e8a3e16c756e 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 @@ -2744,6 +2744,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 d533b42ac7aa..650537ba9f3a 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 @@ -3077,6 +3077,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 51ccfa2a262d..e8f2e5f2cfe2 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 @@ -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/ExternalOIDCWithUpstreamParity.yaml b/api/hypershift/v1beta1/zz_generated.featuregated-crd-manifests/hostedclusters.hypershift.openshift.io/ExternalOIDCWithUpstreamParity.yaml index d1b76d0692bd..44d081ddfb47 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 @@ -3198,6 +3198,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 d44f1852b24f..0af24fb301bb 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 @@ -2744,6 +2744,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 859caad63511..c9e4c42a5898 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 @@ -2809,6 +2809,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 175712502d9c..01f5dad09ddf 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 @@ -2766,6 +2766,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 0d952599e4d6..278c1fb7a8b5 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 @@ -2762,6 +2762,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 e17d0e3aaf52..331d1c005af2 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 @@ -2820,6 +2820,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 e7fcf3957961..28caf9174c98 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 @@ -2744,6 +2744,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 2fabdca50fa5..a1146cde1871 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 @@ -2651,6 +2651,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/AutoNodeKarpenter.yaml b/api/hypershift/v1beta1/zz_generated.featuregated-crd-manifests/hostedcontrolplanes.hypershift.openshift.io/AutoNodeKarpenter.yaml index b41ea276a2c7..284529501c24 100644 --- a/api/hypershift/v1beta1/zz_generated.featuregated-crd-manifests/hostedcontrolplanes.hypershift.openshift.io/AutoNodeKarpenter.yaml +++ b/api/hypershift/v1beta1/zz_generated.featuregated-crd-manifests/hostedcontrolplanes.hypershift.openshift.io/AutoNodeKarpenter.yaml @@ -2780,6 +2780,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 c366997e3840..e2022647e02a 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 @@ -2642,6 +2642,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 dc52a48e5adf..2d93812e7654 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 @@ -2642,6 +2642,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 ad2d474f2938..0f92e3d1d09b 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 @@ -2975,6 +2975,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 8a82b84abc18..3a87ce86a48a 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 @@ -3115,6 +3115,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 a60987e43a92..d35d77598aef 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 @@ -3096,6 +3096,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 8d8a7dacd80b..c136e8c2da07 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 @@ -2642,6 +2642,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 4e53ce7e33b0..f3f73ea9a958 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 @@ -2707,6 +2707,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 abc27ac0e4f9..bfecd9ff0c6b 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 @@ -2664,6 +2664,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 67cfd3feb72c..ea8b6595b0aa 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 @@ -2660,6 +2660,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 eeb648414e8b..85c1f567aa5c 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 @@ -2718,6 +2718,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 ec10613c6bb8..68a54e5b23eb 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 @@ -2642,6 +2642,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 d476edd587bf..67fc43c41fb1 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 @@ -3662,6 +3662,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 5b34e722572a..ba5bf75cc9ce 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 @@ -3246,6 +3246,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 a3cc42bf4186..2a300f2006fb 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 @@ -3573,6 +3573,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 a823ed1af011..3a8e4ecbb028 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 @@ -3562,6 +3562,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 147c54ee2d20..6c9151fc81c6 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 @@ -3144,6 +3144,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 7fc6a7b5aefe..5ebd109915f7 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 @@ -3473,6 +3473,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 ab24e150ee2f..6adb0ff3ffb2 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 237aa259d1c5..09bc053eb2f2 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" @@ -622,3 +626,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 efaad6207663..b015fe33377f 100644 --- a/docs/content/reference/aggregated-docs.md +++ b/docs/content/reference/aggregated-docs.md @@ -43281,11 +43281,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 55ed3dcfbf17..3b5fa61f375b 100644 --- a/docs/content/reference/api.md +++ b/docs/content/reference/api.md @@ -12830,11 +12830,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 c334bbf6353a..adcd239e7fcc 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 @@ -955,6 +955,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 3af7c1eaa3b5eed14a47c1adfa20c7e6aceb8107 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 +++++++------- 6 files changed, 99 insertions(+), 17 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 09bc053eb2f2..cb707d442c3a 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 @@ -613,6 +613,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 9d9928b4322f..20830c15fd08 100644 --- a/control-plane-operator/hostedclusterconfigoperator/controllers/resources/resources_test.go +++ b/control-plane-operator/hostedclusterconfigoperator/controllers/resources/resources_test.go @@ -3038,7 +3038,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, @@ -3052,6 +3052,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 { @@ -3059,8 +3074,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{}, } @@ -3090,6 +3108,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 8a02173c0db1..318a009c9506 100644 --- a/hypershift-operator/controllers/hostedcluster/hostedcluster_controller.go +++ b/hypershift-operator/controllers/hostedcluster/hostedcluster_controller.go @@ -2007,10 +2007,7 @@ func (r *HostedClusterReconciler) reconcile(ctx context.Context, req ctrl.Reques return ctrl.Result{}, fmt.Errorf("failed to parse SecurityContext UID: %w", err) } } - 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, @@ -2541,7 +2538,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 @@ -3551,16 +3548,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 } @@ -5054,15 +5053,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") From 0a764122f49748907f1c4d74f9f4657572353d63 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 318a009c9506..a55c37ffcb96 100644 --- a/hypershift-operator/controllers/hostedcluster/hostedcluster_controller.go +++ b/hypershift-operator/controllers/hostedcluster/hostedcluster_controller.go @@ -2545,6 +2545,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 dc95d5d1a5c1..27878c702132 100644 --- a/hypershift-operator/controllers/hostedcluster/hostedcluster_controller_test.go +++ b/hypershift-operator/controllers/hostedcluster/hostedcluster_controller_test.go @@ -609,13 +609,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, @@ -628,9 +629,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", }, @@ -639,13 +641,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, @@ -659,9 +662,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, @@ -672,6 +676,7 @@ func TestReconcileHostedControlPlaneMonitoring(t *testing.T) { Mode: hyperv1.MetricsForwardingModeForward, }, }, + expectAnnotationOnHCP: true, }, { name: "When metricsSet is set without forwarding mode, it should be copied", @@ -700,6 +705,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)) + } }) } }