diff --git a/api/hypershift/v1beta1/hosted_controlplane.go b/api/hypershift/v1beta1/hosted_controlplane.go index 8486514f0a1..5e64ed314e6 100644 --- a/api/hypershift/v1beta1/hosted_controlplane.go +++ b/api/hypershift/v1beta1/hosted_controlplane.go @@ -187,6 +187,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 74b50f24ad3..f6580bd7ded 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 @@ -833,6 +835,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. @@ -869,6 +880,69 @@ func (olm *OLMCatalogPlacement) Type() string { return "OLMCatalogPlacement" } +// MetricsForwardingMode controls whether metrics forwarding is active for a hosted cluster. +// +// +kubebuilder:validation:Enum=Enabled;Disabled +type MetricsForwardingMode string + +const ( + // MetricsForwardingModeEnabled indicates metrics forwarding is active. + MetricsForwardingModeEnabled MetricsForwardingMode = "Enabled" + + // MetricsForwardingModeDisabled indicates metrics forwarding is inactive. + MetricsForwardingModeDisabled MetricsForwardingMode = "Disabled" +) + +// MetricsSet specifies the set of metrics to collect and forward from hosted clusters. +// +// +kubebuilder:validation:Enum=Telemetry;SRE;All +type MetricsSet string + +const ( + // MetricsSetTelemetry forwards only essential telemetry metrics. + MetricsSetTelemetry MetricsSet = "Telemetry" + + // MetricsSetSRE forwards metrics defined in the sre-metric-set ConfigMap. + MetricsSetSRE MetricsSet = "SRE" + + // MetricsSetAll forwards all metrics without filtering. + 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. + // + // +optional + MetricsForwarding MetricsForwardingSpec `json:"metricsForwarding,omitzero"` + + // metricsSet specifies which set of metrics to collect and forward. + // Valid values are "Telemetry", "SRE", and "All". + // 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". + // + // +optional + MetricsSet MetricsSet `json:"metricsSet,omitempty"` +} + +// MetricsForwardingSpec configures metrics forwarding for the hosted cluster. +// At least one field must be specified when this struct is present. +// +// +kubebuilder:validation:MinProperties=1 +type MetricsForwardingSpec struct { + // mode controls whether metrics forwarding is active for this hosted cluster. + // When set to "Enabled", metrics-proxy and endpoint-resolver are deployed in the + // control plane, and a metrics-forwarder is deployed in the hosted cluster. + // When set to "Disabled" or omitted, metrics forwarding is inactive. + // + // +optional + 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/api/hypershift/v1beta1/zz_generated.deepcopy.go b/api/hypershift/v1beta1/zz_generated.deepcopy.go index a3d882374d2..bbc905abf08 100644 --- a/api/hypershift/v1beta1/zz_generated.deepcopy.go +++ b/api/hypershift/v1beta1/zz_generated.deepcopy.go @@ -2390,6 +2390,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. @@ -2562,6 +2563,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)) @@ -3412,6 +3414,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 e5e928dc898..9e0f55b87f1 100644 --- a/api/hypershift/v1beta1/zz_generated.featuregated-crd-manifests/hostedclusters.hypershift.openshift.io/AAA_ungated.yaml +++ b/api/hypershift/v1beta1/zz_generated.featuregated-crd-manifests/hostedclusters.hypershift.openshift.io/AAA_ungated.yaml @@ -2877,6 +2877,44 @@ 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. + minProperties: 1 + properties: + mode: + description: |- + mode controls whether metrics forwarding is active for this hosted cluster. + When set to "Enabled", metrics-proxy and endpoint-resolver are deployed in the + control plane, and a metrics-forwarder is deployed in the hosted cluster. + When set to "Disabled" or omitted, metrics forwarding is inactive. + enum: + - Enabled + - Disabled + type: string + type: object + metricsSet: + description: |- + metricsSet specifies which set of metrics to collect and forward. + Valid values are "Telemetry", "SRE", and "All". + 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". + 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 40083476fa4..f1661090078 100644 --- a/api/hypershift/v1beta1/zz_generated.featuregated-crd-manifests/hostedclusters.hypershift.openshift.io/ClusterUpdateAcceptRisks.yaml +++ b/api/hypershift/v1beta1/zz_generated.featuregated-crd-manifests/hostedclusters.hypershift.openshift.io/ClusterUpdateAcceptRisks.yaml @@ -2868,6 +2868,44 @@ 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. + minProperties: 1 + properties: + mode: + description: |- + mode controls whether metrics forwarding is active for this hosted cluster. + When set to "Enabled", metrics-proxy and endpoint-resolver are deployed in the + control plane, and a metrics-forwarder is deployed in the hosted cluster. + When set to "Disabled" or omitted, metrics forwarding is inactive. + enum: + - Enabled + - Disabled + type: string + type: object + metricsSet: + description: |- + metricsSet specifies which set of metrics to collect and forward. + Valid values are "Telemetry", "SRE", and "All". + 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". + 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 955788dbad9..d949a66ff71 100644 --- a/api/hypershift/v1beta1/zz_generated.featuregated-crd-manifests/hostedclusters.hypershift.openshift.io/ClusterVersionOperatorConfiguration.yaml +++ b/api/hypershift/v1beta1/zz_generated.featuregated-crd-manifests/hostedclusters.hypershift.openshift.io/ClusterVersionOperatorConfiguration.yaml @@ -2868,6 +2868,44 @@ 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. + minProperties: 1 + properties: + mode: + description: |- + mode controls whether metrics forwarding is active for this hosted cluster. + When set to "Enabled", metrics-proxy and endpoint-resolver are deployed in the + control plane, and a metrics-forwarder is deployed in the hosted cluster. + When set to "Disabled" or omitted, metrics forwarding is inactive. + enum: + - Enabled + - Disabled + type: string + type: object + metricsSet: + description: |- + metricsSet specifies which set of metrics to collect and forward. + Valid values are "Telemetry", "SRE", and "All". + 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". + 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 fe08c90b5c2..d4b487e697f 100644 --- a/api/hypershift/v1beta1/zz_generated.featuregated-crd-manifests/hostedclusters.hypershift.openshift.io/ExternalOIDC.yaml +++ b/api/hypershift/v1beta1/zz_generated.featuregated-crd-manifests/hostedclusters.hypershift.openshift.io/ExternalOIDC.yaml @@ -3200,6 +3200,44 @@ 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. + minProperties: 1 + properties: + mode: + description: |- + mode controls whether metrics forwarding is active for this hosted cluster. + When set to "Enabled", metrics-proxy and endpoint-resolver are deployed in the + control plane, and a metrics-forwarder is deployed in the hosted cluster. + When set to "Disabled" or omitted, metrics forwarding is inactive. + enum: + - Enabled + - Disabled + type: string + type: object + metricsSet: + description: |- + metricsSet specifies which set of metrics to collect and forward. + Valid values are "Telemetry", "SRE", and "All". + 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". + 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 6afcef0d203..bc170104c4b 100644 --- a/api/hypershift/v1beta1/zz_generated.featuregated-crd-manifests/hostedclusters.hypershift.openshift.io/ExternalOIDCWithUIDAndExtraClaimMappings.yaml +++ b/api/hypershift/v1beta1/zz_generated.featuregated-crd-manifests/hostedclusters.hypershift.openshift.io/ExternalOIDCWithUIDAndExtraClaimMappings.yaml @@ -3340,6 +3340,44 @@ 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. + minProperties: 1 + properties: + mode: + description: |- + mode controls whether metrics forwarding is active for this hosted cluster. + When set to "Enabled", metrics-proxy and endpoint-resolver are deployed in the + control plane, and a metrics-forwarder is deployed in the hosted cluster. + When set to "Disabled" or omitted, metrics forwarding is inactive. + enum: + - Enabled + - Disabled + type: string + type: object + metricsSet: + description: |- + metricsSet specifies which set of metrics to collect and forward. + Valid values are "Telemetry", "SRE", and "All". + 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". + 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 9faf2cdb0f5..bb0e101cd85 100644 --- a/api/hypershift/v1beta1/zz_generated.featuregated-crd-manifests/hostedclusters.hypershift.openshift.io/ExternalOIDCWithUpstreamParity.yaml +++ b/api/hypershift/v1beta1/zz_generated.featuregated-crd-manifests/hostedclusters.hypershift.openshift.io/ExternalOIDCWithUpstreamParity.yaml @@ -3331,6 +3331,44 @@ 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. + minProperties: 1 + properties: + mode: + description: |- + mode controls whether metrics forwarding is active for this hosted cluster. + When set to "Enabled", metrics-proxy and endpoint-resolver are deployed in the + control plane, and a metrics-forwarder is deployed in the hosted cluster. + When set to "Disabled" or omitted, metrics forwarding is inactive. + enum: + - Enabled + - Disabled + type: string + type: object + metricsSet: + description: |- + metricsSet specifies which set of metrics to collect and forward. + Valid values are "Telemetry", "SRE", and "All". + 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". + 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 990cee3aae3..15e59b97a79 100644 --- a/api/hypershift/v1beta1/zz_generated.featuregated-crd-manifests/hostedclusters.hypershift.openshift.io/GCPPlatform.yaml +++ b/api/hypershift/v1beta1/zz_generated.featuregated-crd-manifests/hostedclusters.hypershift.openshift.io/GCPPlatform.yaml @@ -2868,6 +2868,44 @@ 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. + minProperties: 1 + properties: + mode: + description: |- + mode controls whether metrics forwarding is active for this hosted cluster. + When set to "Enabled", metrics-proxy and endpoint-resolver are deployed in the + control plane, and a metrics-forwarder is deployed in the hosted cluster. + When set to "Disabled" or omitted, metrics forwarding is inactive. + enum: + - Enabled + - Disabled + type: string + type: object + metricsSet: + description: |- + metricsSet specifies which set of metrics to collect and forward. + Valid values are "Telemetry", "SRE", and "All". + 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". + 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 abe0886f01f..1fd36987fb9 100644 --- a/api/hypershift/v1beta1/zz_generated.featuregated-crd-manifests/hostedclusters.hypershift.openshift.io/HCPEtcdBackup.yaml +++ b/api/hypershift/v1beta1/zz_generated.featuregated-crd-manifests/hostedclusters.hypershift.openshift.io/HCPEtcdBackup.yaml @@ -2933,6 +2933,44 @@ 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. + minProperties: 1 + properties: + mode: + description: |- + mode controls whether metrics forwarding is active for this hosted cluster. + When set to "Enabled", metrics-proxy and endpoint-resolver are deployed in the + control plane, and a metrics-forwarder is deployed in the hosted cluster. + When set to "Disabled" or omitted, metrics forwarding is inactive. + enum: + - Enabled + - Disabled + type: string + type: object + metricsSet: + description: |- + metricsSet specifies which set of metrics to collect and forward. + Valid values are "Telemetry", "SRE", and "All". + 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". + 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 76cee1f00bd..27b051092a6 100644 --- a/api/hypershift/v1beta1/zz_generated.featuregated-crd-manifests/hostedclusters.hypershift.openshift.io/HyperShiftOnlyDynamicResourceAllocation.yaml +++ b/api/hypershift/v1beta1/zz_generated.featuregated-crd-manifests/hostedclusters.hypershift.openshift.io/HyperShiftOnlyDynamicResourceAllocation.yaml @@ -2890,6 +2890,44 @@ 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. + minProperties: 1 + properties: + mode: + description: |- + mode controls whether metrics forwarding is active for this hosted cluster. + When set to "Enabled", metrics-proxy and endpoint-resolver are deployed in the + control plane, and a metrics-forwarder is deployed in the hosted cluster. + When set to "Disabled" or omitted, metrics forwarding is inactive. + enum: + - Enabled + - Disabled + type: string + type: object + metricsSet: + description: |- + metricsSet specifies which set of metrics to collect and forward. + Valid values are "Telemetry", "SRE", and "All". + 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". + 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 bf1e2c27397..798428464eb 100644 --- a/api/hypershift/v1beta1/zz_generated.featuregated-crd-manifests/hostedclusters.hypershift.openshift.io/ImageStreamImportMode.yaml +++ b/api/hypershift/v1beta1/zz_generated.featuregated-crd-manifests/hostedclusters.hypershift.openshift.io/ImageStreamImportMode.yaml @@ -2886,6 +2886,44 @@ 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. + minProperties: 1 + properties: + mode: + description: |- + mode controls whether metrics forwarding is active for this hosted cluster. + When set to "Enabled", metrics-proxy and endpoint-resolver are deployed in the + control plane, and a metrics-forwarder is deployed in the hosted cluster. + When set to "Disabled" or omitted, metrics forwarding is inactive. + enum: + - Enabled + - Disabled + type: string + type: object + metricsSet: + description: |- + metricsSet specifies which set of metrics to collect and forward. + Valid values are "Telemetry", "SRE", and "All". + 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". + 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 a1263ec4683..e8de83a980e 100644 --- a/api/hypershift/v1beta1/zz_generated.featuregated-crd-manifests/hostedclusters.hypershift.openshift.io/KMSEncryptionProvider.yaml +++ b/api/hypershift/v1beta1/zz_generated.featuregated-crd-manifests/hostedclusters.hypershift.openshift.io/KMSEncryptionProvider.yaml @@ -2944,6 +2944,44 @@ 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. + minProperties: 1 + properties: + mode: + description: |- + mode controls whether metrics forwarding is active for this hosted cluster. + When set to "Enabled", metrics-proxy and endpoint-resolver are deployed in the + control plane, and a metrics-forwarder is deployed in the hosted cluster. + When set to "Disabled" or omitted, metrics forwarding is inactive. + enum: + - Enabled + - Disabled + type: string + type: object + metricsSet: + description: |- + metricsSet specifies which set of metrics to collect and forward. + Valid values are "Telemetry", "SRE", and "All". + 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". + 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 93eee39d119..c3fca1c8dab 100644 --- a/api/hypershift/v1beta1/zz_generated.featuregated-crd-manifests/hostedclusters.hypershift.openshift.io/OpenStack.yaml +++ b/api/hypershift/v1beta1/zz_generated.featuregated-crd-manifests/hostedclusters.hypershift.openshift.io/OpenStack.yaml @@ -2868,6 +2868,44 @@ 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. + minProperties: 1 + properties: + mode: + description: |- + mode controls whether metrics forwarding is active for this hosted cluster. + When set to "Enabled", metrics-proxy and endpoint-resolver are deployed in the + control plane, and a metrics-forwarder is deployed in the hosted cluster. + When set to "Disabled" or omitted, metrics forwarding is inactive. + enum: + - Enabled + - Disabled + type: string + type: object + metricsSet: + description: |- + metricsSet specifies which set of metrics to collect and forward. + Valid values are "Telemetry", "SRE", and "All". + 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". + enum: + - Telemetry + - SRE + - All + type: string + type: object networking: default: clusterNetwork: diff --git a/api/hypershift/v1beta1/zz_generated.featuregated-crd-manifests/hostedclusters.hypershift.openshift.io/TLSAdherence.yaml b/api/hypershift/v1beta1/zz_generated.featuregated-crd-manifests/hostedclusters.hypershift.openshift.io/TLSAdherence.yaml index 377f44044e1..e5fca99a3f1 100644 --- a/api/hypershift/v1beta1/zz_generated.featuregated-crd-manifests/hostedclusters.hypershift.openshift.io/TLSAdherence.yaml +++ b/api/hypershift/v1beta1/zz_generated.featuregated-crd-manifests/hostedclusters.hypershift.openshift.io/TLSAdherence.yaml @@ -2908,6 +2908,44 @@ 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. + minProperties: 1 + properties: + mode: + description: |- + mode controls whether metrics forwarding is active for this hosted cluster. + When set to "Enabled", metrics-proxy and endpoint-resolver are deployed in the + control plane, and a metrics-forwarder is deployed in the hosted cluster. + When set to "Disabled" or omitted, metrics forwarding is inactive. + enum: + - Enabled + - Disabled + type: string + type: object + metricsSet: + description: |- + metricsSet specifies which set of metrics to collect and forward. + Valid values are "Telemetry", "SRE", and "All". + 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". + 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 1d833e21ca6..d030a257043 100644 --- a/api/hypershift/v1beta1/zz_generated.featuregated-crd-manifests/hostedcontrolplanes.hypershift.openshift.io/AAA_ungated.yaml +++ b/api/hypershift/v1beta1/zz_generated.featuregated-crd-manifests/hostedcontrolplanes.hypershift.openshift.io/AAA_ungated.yaml @@ -2779,6 +2779,42 @@ 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. + minProperties: 1 + properties: + mode: + description: |- + mode controls whether metrics forwarding is active for this hosted cluster. + When set to "Enabled", metrics-proxy and endpoint-resolver are deployed in the + control plane, and a metrics-forwarder is deployed in the hosted cluster. + When set to "Disabled" or omitted, metrics forwarding is inactive. + enum: + - Enabled + - Disabled + type: string + type: object + metricsSet: + description: |- + metricsSet specifies which set of metrics to collect and forward. + Valid values are "Telemetry", "SRE", and "All". + 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". + 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 8194e7799d5..5667d436c02 100644 --- a/api/hypershift/v1beta1/zz_generated.featuregated-crd-manifests/hostedcontrolplanes.hypershift.openshift.io/ClusterUpdateAcceptRisks.yaml +++ b/api/hypershift/v1beta1/zz_generated.featuregated-crd-manifests/hostedcontrolplanes.hypershift.openshift.io/ClusterUpdateAcceptRisks.yaml @@ -2770,6 +2770,42 @@ 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. + minProperties: 1 + properties: + mode: + description: |- + mode controls whether metrics forwarding is active for this hosted cluster. + When set to "Enabled", metrics-proxy and endpoint-resolver are deployed in the + control plane, and a metrics-forwarder is deployed in the hosted cluster. + When set to "Disabled" or omitted, metrics forwarding is inactive. + enum: + - Enabled + - Disabled + type: string + type: object + metricsSet: + description: |- + metricsSet specifies which set of metrics to collect and forward. + Valid values are "Telemetry", "SRE", and "All". + 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". + 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 ee97b0bf9ea..c5f10ba422f 100644 --- a/api/hypershift/v1beta1/zz_generated.featuregated-crd-manifests/hostedcontrolplanes.hypershift.openshift.io/ClusterVersionOperatorConfiguration.yaml +++ b/api/hypershift/v1beta1/zz_generated.featuregated-crd-manifests/hostedcontrolplanes.hypershift.openshift.io/ClusterVersionOperatorConfiguration.yaml @@ -2770,6 +2770,42 @@ 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. + minProperties: 1 + properties: + mode: + description: |- + mode controls whether metrics forwarding is active for this hosted cluster. + When set to "Enabled", metrics-proxy and endpoint-resolver are deployed in the + control plane, and a metrics-forwarder is deployed in the hosted cluster. + When set to "Disabled" or omitted, metrics forwarding is inactive. + enum: + - Enabled + - Disabled + type: string + type: object + metricsSet: + description: |- + metricsSet specifies which set of metrics to collect and forward. + Valid values are "Telemetry", "SRE", and "All". + 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". + 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 03882677840..b7fe886b2a9 100644 --- a/api/hypershift/v1beta1/zz_generated.featuregated-crd-manifests/hostedcontrolplanes.hypershift.openshift.io/ExternalOIDC.yaml +++ b/api/hypershift/v1beta1/zz_generated.featuregated-crd-manifests/hostedcontrolplanes.hypershift.openshift.io/ExternalOIDC.yaml @@ -3102,6 +3102,42 @@ 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. + minProperties: 1 + properties: + mode: + description: |- + mode controls whether metrics forwarding is active for this hosted cluster. + When set to "Enabled", metrics-proxy and endpoint-resolver are deployed in the + control plane, and a metrics-forwarder is deployed in the hosted cluster. + When set to "Disabled" or omitted, metrics forwarding is inactive. + enum: + - Enabled + - Disabled + type: string + type: object + metricsSet: + description: |- + metricsSet specifies which set of metrics to collect and forward. + Valid values are "Telemetry", "SRE", and "All". + 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". + 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 31cb9e39a95..497b953f06e 100644 --- a/api/hypershift/v1beta1/zz_generated.featuregated-crd-manifests/hostedcontrolplanes.hypershift.openshift.io/ExternalOIDCWithUIDAndExtraClaimMappings.yaml +++ b/api/hypershift/v1beta1/zz_generated.featuregated-crd-manifests/hostedcontrolplanes.hypershift.openshift.io/ExternalOIDCWithUIDAndExtraClaimMappings.yaml @@ -3242,6 +3242,42 @@ 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. + minProperties: 1 + properties: + mode: + description: |- + mode controls whether metrics forwarding is active for this hosted cluster. + When set to "Enabled", metrics-proxy and endpoint-resolver are deployed in the + control plane, and a metrics-forwarder is deployed in the hosted cluster. + When set to "Disabled" or omitted, metrics forwarding is inactive. + enum: + - Enabled + - Disabled + type: string + type: object + metricsSet: + description: |- + metricsSet specifies which set of metrics to collect and forward. + Valid values are "Telemetry", "SRE", and "All". + 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". + 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 dac1ead4844..7e296989b21 100644 --- a/api/hypershift/v1beta1/zz_generated.featuregated-crd-manifests/hostedcontrolplanes.hypershift.openshift.io/ExternalOIDCWithUpstreamParity.yaml +++ b/api/hypershift/v1beta1/zz_generated.featuregated-crd-manifests/hostedcontrolplanes.hypershift.openshift.io/ExternalOIDCWithUpstreamParity.yaml @@ -3233,6 +3233,42 @@ 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. + minProperties: 1 + properties: + mode: + description: |- + mode controls whether metrics forwarding is active for this hosted cluster. + When set to "Enabled", metrics-proxy and endpoint-resolver are deployed in the + control plane, and a metrics-forwarder is deployed in the hosted cluster. + When set to "Disabled" or omitted, metrics forwarding is inactive. + enum: + - Enabled + - Disabled + type: string + type: object + metricsSet: + description: |- + metricsSet specifies which set of metrics to collect and forward. + Valid values are "Telemetry", "SRE", and "All". + 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". + 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 a862e1dc02f..1da992b4ab7 100644 --- a/api/hypershift/v1beta1/zz_generated.featuregated-crd-manifests/hostedcontrolplanes.hypershift.openshift.io/GCPPlatform.yaml +++ b/api/hypershift/v1beta1/zz_generated.featuregated-crd-manifests/hostedcontrolplanes.hypershift.openshift.io/GCPPlatform.yaml @@ -2770,6 +2770,42 @@ 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. + minProperties: 1 + properties: + mode: + description: |- + mode controls whether metrics forwarding is active for this hosted cluster. + When set to "Enabled", metrics-proxy and endpoint-resolver are deployed in the + control plane, and a metrics-forwarder is deployed in the hosted cluster. + When set to "Disabled" or omitted, metrics forwarding is inactive. + enum: + - Enabled + - Disabled + type: string + type: object + metricsSet: + description: |- + metricsSet specifies which set of metrics to collect and forward. + Valid values are "Telemetry", "SRE", and "All". + 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". + 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 f8dc77d0c2e..671a16f2efb 100644 --- a/api/hypershift/v1beta1/zz_generated.featuregated-crd-manifests/hostedcontrolplanes.hypershift.openshift.io/HCPEtcdBackup.yaml +++ b/api/hypershift/v1beta1/zz_generated.featuregated-crd-manifests/hostedcontrolplanes.hypershift.openshift.io/HCPEtcdBackup.yaml @@ -2835,6 +2835,42 @@ 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. + minProperties: 1 + properties: + mode: + description: |- + mode controls whether metrics forwarding is active for this hosted cluster. + When set to "Enabled", metrics-proxy and endpoint-resolver are deployed in the + control plane, and a metrics-forwarder is deployed in the hosted cluster. + When set to "Disabled" or omitted, metrics forwarding is inactive. + enum: + - Enabled + - Disabled + type: string + type: object + metricsSet: + description: |- + metricsSet specifies which set of metrics to collect and forward. + Valid values are "Telemetry", "SRE", and "All". + 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". + 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 667923bb2e9..f43c6ec947e 100644 --- a/api/hypershift/v1beta1/zz_generated.featuregated-crd-manifests/hostedcontrolplanes.hypershift.openshift.io/HyperShiftOnlyDynamicResourceAllocation.yaml +++ b/api/hypershift/v1beta1/zz_generated.featuregated-crd-manifests/hostedcontrolplanes.hypershift.openshift.io/HyperShiftOnlyDynamicResourceAllocation.yaml @@ -2792,6 +2792,42 @@ 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. + minProperties: 1 + properties: + mode: + description: |- + mode controls whether metrics forwarding is active for this hosted cluster. + When set to "Enabled", metrics-proxy and endpoint-resolver are deployed in the + control plane, and a metrics-forwarder is deployed in the hosted cluster. + When set to "Disabled" or omitted, metrics forwarding is inactive. + enum: + - Enabled + - Disabled + type: string + type: object + metricsSet: + description: |- + metricsSet specifies which set of metrics to collect and forward. + Valid values are "Telemetry", "SRE", and "All". + 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". + 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 55a2555f888..d20a2ff3833 100644 --- a/api/hypershift/v1beta1/zz_generated.featuregated-crd-manifests/hostedcontrolplanes.hypershift.openshift.io/ImageStreamImportMode.yaml +++ b/api/hypershift/v1beta1/zz_generated.featuregated-crd-manifests/hostedcontrolplanes.hypershift.openshift.io/ImageStreamImportMode.yaml @@ -2788,6 +2788,42 @@ 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. + minProperties: 1 + properties: + mode: + description: |- + mode controls whether metrics forwarding is active for this hosted cluster. + When set to "Enabled", metrics-proxy and endpoint-resolver are deployed in the + control plane, and a metrics-forwarder is deployed in the hosted cluster. + When set to "Disabled" or omitted, metrics forwarding is inactive. + enum: + - Enabled + - Disabled + type: string + type: object + metricsSet: + description: |- + metricsSet specifies which set of metrics to collect and forward. + Valid values are "Telemetry", "SRE", and "All". + 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". + 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 4dcb4e6c362..32989294d2e 100644 --- a/api/hypershift/v1beta1/zz_generated.featuregated-crd-manifests/hostedcontrolplanes.hypershift.openshift.io/KMSEncryptionProvider.yaml +++ b/api/hypershift/v1beta1/zz_generated.featuregated-crd-manifests/hostedcontrolplanes.hypershift.openshift.io/KMSEncryptionProvider.yaml @@ -2846,6 +2846,42 @@ 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. + minProperties: 1 + properties: + mode: + description: |- + mode controls whether metrics forwarding is active for this hosted cluster. + When set to "Enabled", metrics-proxy and endpoint-resolver are deployed in the + control plane, and a metrics-forwarder is deployed in the hosted cluster. + When set to "Disabled" or omitted, metrics forwarding is inactive. + enum: + - Enabled + - Disabled + type: string + type: object + metricsSet: + description: |- + metricsSet specifies which set of metrics to collect and forward. + Valid values are "Telemetry", "SRE", and "All". + 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". + 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 da6e7167b43..759b4bb12a1 100644 --- a/api/hypershift/v1beta1/zz_generated.featuregated-crd-manifests/hostedcontrolplanes.hypershift.openshift.io/OpenStack.yaml +++ b/api/hypershift/v1beta1/zz_generated.featuregated-crd-manifests/hostedcontrolplanes.hypershift.openshift.io/OpenStack.yaml @@ -2770,6 +2770,42 @@ 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. + minProperties: 1 + properties: + mode: + description: |- + mode controls whether metrics forwarding is active for this hosted cluster. + When set to "Enabled", metrics-proxy and endpoint-resolver are deployed in the + control plane, and a metrics-forwarder is deployed in the hosted cluster. + When set to "Disabled" or omitted, metrics forwarding is inactive. + enum: + - Enabled + - Disabled + type: string + type: object + metricsSet: + description: |- + metricsSet specifies which set of metrics to collect and forward. + Valid values are "Telemetry", "SRE", and "All". + 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". + enum: + - Telemetry + - SRE + - All + type: string + type: object networking: description: |- networking specifies network configuration for the cluster. diff --git a/api/hypershift/v1beta1/zz_generated.featuregated-crd-manifests/hostedcontrolplanes.hypershift.openshift.io/TLSAdherence.yaml b/api/hypershift/v1beta1/zz_generated.featuregated-crd-manifests/hostedcontrolplanes.hypershift.openshift.io/TLSAdherence.yaml index 75d60b7d459..a132b21d53e 100644 --- a/api/hypershift/v1beta1/zz_generated.featuregated-crd-manifests/hostedcontrolplanes.hypershift.openshift.io/TLSAdherence.yaml +++ b/api/hypershift/v1beta1/zz_generated.featuregated-crd-manifests/hostedcontrolplanes.hypershift.openshift.io/TLSAdherence.yaml @@ -2810,6 +2810,42 @@ 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. + minProperties: 1 + properties: + mode: + description: |- + mode controls whether metrics forwarding is active for this hosted cluster. + When set to "Enabled", metrics-proxy and endpoint-resolver are deployed in the + control plane, and a metrics-forwarder is deployed in the hosted cluster. + When set to "Disabled" or omitted, metrics forwarding is inactive. + enum: + - Enabled + - Disabled + type: string + type: object + metricsSet: + description: |- + metricsSet specifies which set of metrics to collect and forward. + Valid values are "Telemetry", "SRE", and "All". + 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". + 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 4f13f8c3693..62eaf684971 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 e1387bb9f9f..07dd37ef521 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 00000000000..5cce1072080 --- /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 00000000000..9aa62943f4a --- /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 6c7a8f85bb0..312f1b58096 100644 --- a/client/applyconfiguration/utils.go +++ b/client/applyconfiguration/utils.go @@ -311,6 +311,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/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 00000000000..2cc993c1862 --- /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 Enabled it should pass + initial: | + apiVersion: hypershift.openshift.io/v1beta1 + kind: HostedCluster + spec: + monitoring: + metricsForwarding: + mode: Enabled + 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 Disabled it should pass + initial: | + apiVersion: hypershift.openshift.io/v1beta1 + kind: HostedCluster + spec: + monitoring: + metricsForwarding: + mode: Disabled + 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: Enabled + 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: Enabled + 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: Enabled + 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: Enabled + 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/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 742c4609575..887b4483a39 100644 --- a/cmd/install/assets/crds/hypershift-operator/zz_generated.crd-manifests/hostedclusters-Hypershift-CustomNoUpgrade.crd.yaml +++ b/cmd/install/assets/crds/hypershift-operator/zz_generated.crd-manifests/hostedclusters-Hypershift-CustomNoUpgrade.crd.yaml @@ -3699,6 +3699,44 @@ 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. + minProperties: 1 + properties: + mode: + description: |- + mode controls whether metrics forwarding is active for this hosted cluster. + When set to "Enabled", metrics-proxy and endpoint-resolver are deployed in the + control plane, and a metrics-forwarder is deployed in the hosted cluster. + When set to "Disabled" or omitted, metrics forwarding is inactive. + enum: + - Enabled + - Disabled + type: string + type: object + metricsSet: + description: |- + metricsSet specifies which set of metrics to collect and forward. + Valid values are "Telemetry", "SRE", and "All". + 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". + 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 b70562b4dbf..5f4bbf5176f 100644 --- a/cmd/install/assets/crds/hypershift-operator/zz_generated.crd-manifests/hostedclusters-Hypershift-Default.crd.yaml +++ b/cmd/install/assets/crds/hypershift-operator/zz_generated.crd-manifests/hostedclusters-Hypershift-Default.crd.yaml @@ -3369,6 +3369,44 @@ 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. + minProperties: 1 + properties: + mode: + description: |- + mode controls whether metrics forwarding is active for this hosted cluster. + When set to "Enabled", metrics-proxy and endpoint-resolver are deployed in the + control plane, and a metrics-forwarder is deployed in the hosted cluster. + When set to "Disabled" or omitted, metrics forwarding is inactive. + enum: + - Enabled + - Disabled + type: string + type: object + metricsSet: + description: |- + metricsSet specifies which set of metrics to collect and forward. + Valid values are "Telemetry", "SRE", and "All". + 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". + 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 c56f7d18bce..912dfd89788 100644 --- a/cmd/install/assets/crds/hypershift-operator/zz_generated.crd-manifests/hostedclusters-Hypershift-TechPreviewNoUpgrade.crd.yaml +++ b/cmd/install/assets/crds/hypershift-operator/zz_generated.crd-manifests/hostedclusters-Hypershift-TechPreviewNoUpgrade.crd.yaml @@ -3570,6 +3570,44 @@ 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. + minProperties: 1 + properties: + mode: + description: |- + mode controls whether metrics forwarding is active for this hosted cluster. + When set to "Enabled", metrics-proxy and endpoint-resolver are deployed in the + control plane, and a metrics-forwarder is deployed in the hosted cluster. + When set to "Disabled" or omitted, metrics forwarding is inactive. + enum: + - Enabled + - Disabled + type: string + type: object + metricsSet: + description: |- + metricsSet specifies which set of metrics to collect and forward. + Valid values are "Telemetry", "SRE", and "All". + 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". + 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 8fed73ad00d..188b9cbfa41 100644 --- a/cmd/install/assets/crds/hypershift-operator/zz_generated.crd-manifests/hostedcontrolplanes-Hypershift-CustomNoUpgrade.crd.yaml +++ b/cmd/install/assets/crds/hypershift-operator/zz_generated.crd-manifests/hostedcontrolplanes-Hypershift-CustomNoUpgrade.crd.yaml @@ -3601,6 +3601,42 @@ 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. + minProperties: 1 + properties: + mode: + description: |- + mode controls whether metrics forwarding is active for this hosted cluster. + When set to "Enabled", metrics-proxy and endpoint-resolver are deployed in the + control plane, and a metrics-forwarder is deployed in the hosted cluster. + When set to "Disabled" or omitted, metrics forwarding is inactive. + enum: + - Enabled + - Disabled + type: string + type: object + metricsSet: + description: |- + metricsSet specifies which set of metrics to collect and forward. + Valid values are "Telemetry", "SRE", and "All". + 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". + 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 ac2928451c8..ae6fa792f3a 100644 --- a/cmd/install/assets/crds/hypershift-operator/zz_generated.crd-manifests/hostedcontrolplanes-Hypershift-Default.crd.yaml +++ b/cmd/install/assets/crds/hypershift-operator/zz_generated.crd-manifests/hostedcontrolplanes-Hypershift-Default.crd.yaml @@ -3271,6 +3271,42 @@ 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. + minProperties: 1 + properties: + mode: + description: |- + mode controls whether metrics forwarding is active for this hosted cluster. + When set to "Enabled", metrics-proxy and endpoint-resolver are deployed in the + control plane, and a metrics-forwarder is deployed in the hosted cluster. + When set to "Disabled" or omitted, metrics forwarding is inactive. + enum: + - Enabled + - Disabled + type: string + type: object + metricsSet: + description: |- + metricsSet specifies which set of metrics to collect and forward. + Valid values are "Telemetry", "SRE", and "All". + 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". + 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 a2f47dbfdca..7d447300400 100644 --- a/cmd/install/assets/crds/hypershift-operator/zz_generated.crd-manifests/hostedcontrolplanes-Hypershift-TechPreviewNoUpgrade.crd.yaml +++ b/cmd/install/assets/crds/hypershift-operator/zz_generated.crd-manifests/hostedcontrolplanes-Hypershift-TechPreviewNoUpgrade.crd.yaml @@ -3472,6 +3472,42 @@ 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. + minProperties: 1 + properties: + mode: + description: |- + mode controls whether metrics forwarding is active for this hosted cluster. + When set to "Enabled", metrics-proxy and endpoint-resolver are deployed in the + control plane, and a metrics-forwarder is deployed in the hosted cluster. + When set to "Disabled" or omitted, metrics forwarding is inactive. + enum: + - Enabled + - Disabled + type: string + type: object + metricsSet: + description: |- + metricsSet specifies which set of metrics to collect and forward. + Valid values are "Telemetry", "SRE", and "All". + 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". + enum: + - Telemetry + - SRE + - All + type: string + type: object networking: description: |- networking specifies network configuration for the cluster. diff --git a/control-plane-operator/controllers/hostedcontrolplane/hostedcontrolplane_controller.go b/control-plane-operator/controllers/hostedcontrolplane/hostedcontrolplane_controller.go index 9337ae39d11..42054938f19 100644 --- a/control-plane-operator/controllers/hostedcontrolplane/hostedcontrolplane_controller.go +++ b/control-plane-operator/controllers/hostedcontrolplane/hostedcontrolplane_controller.go @@ -1191,7 +1191,12 @@ func (r *HostedControlPlaneReconciler) reconcileCPOV2(ctx context.Context, hcp * } } - if err := r.reconcileSREMetricsConfig(ctx, hcp.Namespace); err != nil { + effectiveMetricsSet := r.MetricsSet + if hcp.Spec.Monitoring.MetricsSet != "" { + effectiveMetricsSet = metrics.MetricsSet(hcp.Spec.Monitoring.MetricsSet) + } + + if err := r.reconcileSREMetricsConfig(ctx, hcp.Namespace, effectiveMetricsSet); err != nil { return fmt.Errorf("failed to reconcile metrics config: %w", err) } @@ -1251,7 +1256,7 @@ func (r *HostedControlPlaneReconciler) reconcileCPOV2(ctx context.Context, hcp * UserReleaseImageProvider: userReleaseImageProvider, SetDefaultSecurityContext: r.SetDefaultSecurityContext, DefaultSecurityContextUID: r.DefaultSecurityContextUID, - MetricsSet: r.MetricsSet, + MetricsSet: effectiveMetricsSet, EnableCIDebugOutput: r.EnableCIDebugOutput, ImageMetadataProvider: r.ImageMetadataProvider, NativeSidecarContainersEnabled: r.ManagementClusterCapabilities.Has(capabilities.CapabilityNativeSidecarContainers), @@ -3147,9 +3152,9 @@ func (r *HostedControlPlaneReconciler) GetGuestClusterClient(ctx context.Context // reconcileSREMetricsConfig ensures that if using the SRE metrics set that the loaded configuration // is the latest from the ConfigMap. -func (r *HostedControlPlaneReconciler) reconcileSREMetricsConfig(ctx context.Context, cpNamespace string) error { +func (r *HostedControlPlaneReconciler) reconcileSREMetricsConfig(ctx context.Context, cpNamespace string, effectiveMetricsSet metrics.MetricsSet) error { log := ctrl.LoggerFrom(ctx) - if r.MetricsSet != metrics.MetricsSetSRE { + if effectiveMetricsSet != metrics.MetricsSetSRE { return nil } log.Info("Reconciling SRE metrics configuration") 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 0f0efdc35dd..7ad7538d4bb 100644 --- a/control-plane-operator/controllers/hostedcontrolplane/v2/endpoint_resolver/component.go +++ b/control-plane-operator/controllers/hostedcontrolplane/v2/endpoint_resolver/component.go @@ -45,6 +45,5 @@ func NewComponent() component.ControlPlaneComponent { 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.MetricsForwardingModeEnabled, 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 3bb96360d08..4d38620d0c8 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.MetricsForwardingModeEnabled, + }, }, 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.MetricsForwardingModeEnabled, + }, }, 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.MetricsForwardingModeDisabled, + }, }, 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{ 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 832f49d327f..67ee5c1c570 100644 --- a/control-plane-operator/controllers/hostedcontrolplane/v2/metrics_proxy/component.go +++ b/control-plane-operator/controllers/hostedcontrolplane/v2/metrics_proxy/component.go @@ -68,6 +68,5 @@ func NewComponent(defaultIngressDomain string) component.ControlPlaneComponent { 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.MetricsForwardingModeEnabled, nil } diff --git a/control-plane-operator/hostedclusterconfigoperator/controllers/resources/resources.go b/control-plane-operator/hostedclusterconfigoperator/controllers/resources/resources.go index d9a9e1394da..7983511b539 100644 --- a/control-plane-operator/hostedclusterconfigoperator/controllers/resources/resources.go +++ b/control-plane-operator/hostedclusterconfigoperator/controllers/resources/resources.go @@ -971,7 +971,7 @@ func (r *reconciler) reconcileMetricsForwarder(ctx context.Context, hcp *hyperv1 if _, disabled := hcp.Annotations[hyperv1.DisableMonitoringServices]; disabled { return k8sutil.DeleteAllIfNeeded(ctx, r.client, deployment, cm, servingCA, podMonitor) } - if _, enabled := hcp.Annotations[hyperv1.EnableMetricsForwarding]; !enabled { + if hcp.Spec.Monitoring.MetricsForwarding.Mode != hyperv1.MetricsForwardingModeEnabled { return k8sutil.DeleteAllIfNeeded(ctx, r.client, deployment, cm, servingCA, podMonitor) } diff --git a/control-plane-operator/hostedclusterconfigoperator/controllers/resources/resources_test.go b/control-plane-operator/hostedclusterconfigoperator/controllers/resources/resources_test.go index 7017deac878..da4ce67c439 100644 --- a/control-plane-operator/hostedclusterconfigoperator/controllers/resources/resources_test.go +++ b/control-plane-operator/hostedclusterconfigoperator/controllers/resources/resources_test.go @@ -3073,11 +3073,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(), @@ -3090,6 +3091,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.MetricsForwardingModeEnabled, + }, + }, existingObjects: []client.Object{ manifests.MetricsForwarderDeployment(), manifests.MetricsForwarderConfigMap(), @@ -3099,11 +3105,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.MetricsForwardingModeDisabled, + }, + }, + existingObjects: []client.Object{ + manifests.MetricsForwarderDeployment(), + manifests.MetricsForwarderConfigMap(), + manifests.MetricsForwarderServingCA(), + manifests.MetricsForwarderPodMonitor(), + }, + expectCleanup: true, + }, } for _, tt := range tests { @@ -3122,6 +3143,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/docs/content/reference/aggregated-docs.md b/docs/content/reference/aggregated-docs.md index e1e9658ac27..a7c18316069 100644 --- a/docs/content/reference/aggregated-docs.md +++ b/docs/content/reference/aggregated-docs.md @@ -36689,6 +36689,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.

+ + @@ -44998,6 +45016,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 } @@ -45567,6 +45603,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
@@ -48166,6 +48218,143 @@ 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

"Disabled"

MetricsForwardingModeDisabled indicates metrics forwarding is inactive.

+

"Enabled"

MetricsForwardingModeEnabled indicates metrics forwarding is active.

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

+(Appears on: +MonitoringSpec) +

+

+

MetricsForwardingSpec configures metrics forwarding for the hosted cluster. +At least one field must be specified when this struct is present.

+

+ + + + + + + + + + + + + +
FieldDescription
+mode
+ + +MetricsForwardingMode + + +
+(Optional) +

mode controls whether metrics forwarding is active for this hosted cluster. +When set to “Enabled”, metrics-proxy and endpoint-resolver are deployed in the +control plane, and a metrics-forwarder is deployed in the hosted cluster. +When set to “Disabled” or omitted, 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 forwards all metrics without filtering.

+

"SRE"

MetricsSetSRE forwards metrics defined in the sre-metric-set ConfigMap.

+

"Telemetry"

MetricsSetTelemetry forwards only essential telemetry metrics.

+
+###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.

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

metricsSet specifies which set of metrics to collect and forward. +Valid values are “Telemetry”, “SRE”, and “All”. +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”.

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

(Appears on: diff --git a/docs/content/reference/api.md b/docs/content/reference/api.md index 828e8531ff1..d96422f232e 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.

+ + @@ -9313,6 +9331,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 } @@ -9882,6 +9918,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
@@ -12481,6 +12533,143 @@ 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

"Disabled"

MetricsForwardingModeDisabled indicates metrics forwarding is inactive.

+

"Enabled"

MetricsForwardingModeEnabled indicates metrics forwarding is active.

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

+(Appears on: +MonitoringSpec) +

+

+

MetricsForwardingSpec configures metrics forwarding for the hosted cluster. +At least one field must be specified when this struct is present.

+

+ + + + + + + + + + + + + +
FieldDescription
+mode
+ + +MetricsForwardingMode + + +
+(Optional) +

mode controls whether metrics forwarding is active for this hosted cluster. +When set to “Enabled”, metrics-proxy and endpoint-resolver are deployed in the +control plane, and a metrics-forwarder is deployed in the hosted cluster. +When set to “Disabled” or omitted, 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 forwards all metrics without filtering.

+

"SRE"

MetricsSetSRE forwards metrics defined in the sre-metric-set ConfigMap.

+

"Telemetry"

MetricsSetTelemetry forwards only essential telemetry metrics.

+
+###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.

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

metricsSet specifies which set of metrics to collect and forward. +Valid values are “Telemetry”, “SRE”, and “All”. +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”.

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

(Appears on: diff --git a/hypershift-operator/controllers/hostedcluster/hostedcluster_controller.go b/hypershift-operator/controllers/hostedcluster/hostedcluster_controller.go index 095522e7bd2..1fb59a8c4a2 100644 --- a/hypershift-operator/controllers/hostedcluster/hostedcluster_controller.go +++ b/hypershift-operator/controllers/hostedcluster/hostedcluster_controller.go @@ -2543,6 +2543,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.MetricsForwardingModeEnabled + } + } + return nil } @@ -5152,7 +5162,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 668ffd25206..bc6e1e0d95a 100644 --- a/hypershift-operator/controllers/hostedcluster/hostedcluster_controller_test.go +++ b/hypershift-operator/controllers/hostedcluster/hostedcluster_controller_test.go @@ -861,6 +861,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.MetricsForwardingModeEnabled, + }, + MetricsSet: hyperv1.MetricsSetSRE, + }, + expectedMonitoring: hyperv1.MonitoringSpec{ + MetricsForwarding: hyperv1.MetricsForwardingSpec{ + Mode: hyperv1.MetricsForwardingModeEnabled, + }, + 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.MetricsForwardingModeEnabled, + }, + }, + }, + { + 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.MetricsForwardingModeDisabled, + }, + }, + annotations: map[string]string{ + hyperv1.EnableMetricsForwarding: "true", + }, + expectedMonitoring: hyperv1.MonitoringSpec{ + MetricsForwarding: hyperv1.MetricsForwardingSpec{ + Mode: hyperv1.MetricsForwardingModeDisabled, + }, + }, + }, + { + name: "When mode is Enabled and annotation is absent, it should keep Enabled", + monitoring: hyperv1.MonitoringSpec{ + MetricsForwarding: hyperv1.MetricsForwardingSpec{ + Mode: hyperv1.MetricsForwardingModeEnabled, + }, + }, + expectedMonitoring: hyperv1.MonitoringSpec{ + MetricsForwarding: hyperv1.MetricsForwardingSpec{ + Mode: hyperv1.MetricsForwardingModeEnabled, + }, + }, + }, + { + name: "When metricsSet is set without forwarding mode, it should be copied", + monitoring: hyperv1.MonitoringSpec{ + MetricsSet: hyperv1.MetricsSetAll, + }, + expectedMonitoring: hyperv1.MonitoringSpec{ + MetricsSet: hyperv1.MetricsSetAll, + }, + }, + } + + for _, test := range tests { + t.Run(test.name, func(t *testing.T) { + t.Parallel() + g := NewGomegaWithT(t) + + hostedCluster := &hyperv1.HostedCluster{ + ObjectMeta: metav1.ObjectMeta{ + Annotations: test.annotations, + }, + } + hostedCluster.Spec.Monitoring = test.monitoring + hostedControlPlane := &hyperv1.HostedControlPlane{} + + err := reconcileHostedControlPlane(hostedControlPlane, hostedCluster, true, true, func() (map[string]string, error) { return nil, nil }) + g.Expect(err).ToNot(HaveOccurred()) + g.Expect(hostedControlPlane.Spec.Monitoring).To(Equal(test.expectedMonitoring)) + }) + } +} + func TestReconcileHostedControlPlaneAnnotations(t *testing.T) { t.Parallel() type testCase struct { diff --git a/test/e2e/util/util_metrics_proxy.go b/test/e2e/util/util_metrics_proxy.go index df0ed701c87..412bb03413b 100644 --- a/test/e2e/util/util_metrics_proxy.go +++ b/test/e2e/util/util_metrics_proxy.go @@ -46,15 +46,12 @@ func EnsureMetricsForwarderWorking(t *testing.T, ctx context.Context, mgtClient g := NewWithT(t) hcpNamespace := manifests.HostedControlPlaneNamespace(hostedCluster.Namespace, hostedCluster.Name) - // 1. Enable metrics forwarding by adding the annotation. + // 1. Enable metrics forwarding via spec. t.Log("Enabling metrics forwarding on HostedCluster") err := UpdateObject(t, ctx, mgtClient, hostedCluster, func(obj *hyperv1.HostedCluster) { - if obj.Annotations == nil { - obj.Annotations = make(map[string]string) - } - obj.Annotations[hyperv1.EnableMetricsForwarding] = "true" + obj.Spec.Monitoring.MetricsForwarding.Mode = hyperv1.MetricsForwardingModeEnabled }) - g.Expect(err).NotTo(HaveOccurred(), "failed to patch HostedCluster with EnableMetricsForwarding annotation") + g.Expect(err).NotTo(HaveOccurred(), "failed to enable metrics forwarding on HostedCluster") // 2. Wait for management-side deployments. t.Log("Waiting for endpoint-resolver deployment") diff --git a/test/e2e/v2/tests/hosted_cluster_metrics_test.go b/test/e2e/v2/tests/hosted_cluster_metrics_test.go index b7dbc39192d..efe4a10a582 100644 --- a/test/e2e/v2/tests/hosted_cluster_metrics_test.go +++ b/test/e2e/v2/tests/hosted_cluster_metrics_test.go @@ -143,8 +143,8 @@ func EnsureMetricsForwarderWorkingTest(getTestCtx internal.TestContextGetter) { Skip("metrics forwarder requires version >= 4.22") } - if hostedCluster.Annotations[hyperv1.EnableMetricsForwarding] != "true" { - Skip("metrics forwarding annotation not set on hosted cluster; skipping verification test") + if hostedCluster.Spec.Monitoring.MetricsForwarding.Mode != hyperv1.MetricsForwardingModeEnabled { + Skip("metrics forwarding not enabled on hosted cluster; skipping verification test") } By("Waiting for management-side metrics deployments") 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 8486514f0a1..5e64ed314e6 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 @@ -187,6 +187,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 74b50f24ad3..f6580bd7ded 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 @@ -833,6 +835,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. @@ -869,6 +880,69 @@ func (olm *OLMCatalogPlacement) Type() string { return "OLMCatalogPlacement" } +// MetricsForwardingMode controls whether metrics forwarding is active for a hosted cluster. +// +// +kubebuilder:validation:Enum=Enabled;Disabled +type MetricsForwardingMode string + +const ( + // MetricsForwardingModeEnabled indicates metrics forwarding is active. + MetricsForwardingModeEnabled MetricsForwardingMode = "Enabled" + + // MetricsForwardingModeDisabled indicates metrics forwarding is inactive. + MetricsForwardingModeDisabled MetricsForwardingMode = "Disabled" +) + +// MetricsSet specifies the set of metrics to collect and forward from hosted clusters. +// +// +kubebuilder:validation:Enum=Telemetry;SRE;All +type MetricsSet string + +const ( + // MetricsSetTelemetry forwards only essential telemetry metrics. + MetricsSetTelemetry MetricsSet = "Telemetry" + + // MetricsSetSRE forwards metrics defined in the sre-metric-set ConfigMap. + MetricsSetSRE MetricsSet = "SRE" + + // MetricsSetAll forwards all metrics without filtering. + 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. + // + // +optional + MetricsForwarding MetricsForwardingSpec `json:"metricsForwarding,omitzero"` + + // metricsSet specifies which set of metrics to collect and forward. + // Valid values are "Telemetry", "SRE", and "All". + // 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". + // + // +optional + MetricsSet MetricsSet `json:"metricsSet,omitempty"` +} + +// MetricsForwardingSpec configures metrics forwarding for the hosted cluster. +// At least one field must be specified when this struct is present. +// +// +kubebuilder:validation:MinProperties=1 +type MetricsForwardingSpec struct { + // mode controls whether metrics forwarding is active for this hosted cluster. + // When set to "Enabled", metrics-proxy and endpoint-resolver are deployed in the + // control plane, and a metrics-forwarder is deployed in the hosted cluster. + // When set to "Disabled" or omitted, metrics forwarding is inactive. + // + // +optional + 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 a3d882374d2..bbc905abf08 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 @@ -2390,6 +2390,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. @@ -2562,6 +2563,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)) @@ -3412,6 +3414,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