diff --git a/config/v1alpha1/tests/clustermonitorings.config.openshift.io/ClusterMonitoringConfig.yaml b/config/v1alpha1/tests/clustermonitorings.config.openshift.io/ClusterMonitoringConfig.yaml index 83956355cef..4af134c0d34 100644 --- a/config/v1alpha1/tests/clustermonitorings.config.openshift.io/ClusterMonitoringConfig.yaml +++ b/config/v1alpha1/tests/clustermonitorings.config.openshift.io/ClusterMonitoringConfig.yaml @@ -1181,6 +1181,10 @@ tests: kind: ClusterMonitoring spec: thanosQuerierConfig: + logLevel: "Debug" + requestLogging: + policy: "AllRequests" + crossOriginRequestPolicy: "DenyAll" nodeSelector: kubernetes.io/os: linux resources: @@ -1201,6 +1205,10 @@ tests: kind: ClusterMonitoring spec: thanosQuerierConfig: + logLevel: "Debug" + requestLogging: + policy: "AllRequests" + crossOriginRequestPolicy: "DenyAll" nodeSelector: kubernetes.io/os: linux resources: @@ -1434,6 +1442,139 @@ tests: topologyKey: topology.kubernetes.io/zone whenUnsatisfiable: DoNotSchedule expectedError: "Duplicate value" + - name: Should accept ThanosQuerierConfig with logLevel set to Error + initial: | + apiVersion: config.openshift.io/v1alpha1 + kind: ClusterMonitoring + spec: + thanosQuerierConfig: + logLevel: "Error" + expected: | + apiVersion: config.openshift.io/v1alpha1 + kind: ClusterMonitoring + spec: + thanosQuerierConfig: + logLevel: "Error" + - name: Should accept ThanosQuerierConfig with logLevel set to Warn + initial: | + apiVersion: config.openshift.io/v1alpha1 + kind: ClusterMonitoring + spec: + thanosQuerierConfig: + logLevel: "Warn" + expected: | + apiVersion: config.openshift.io/v1alpha1 + kind: ClusterMonitoring + spec: + thanosQuerierConfig: + logLevel: "Warn" + - name: Should accept ThanosQuerierConfig with logLevel set to Info + initial: | + apiVersion: config.openshift.io/v1alpha1 + kind: ClusterMonitoring + spec: + thanosQuerierConfig: + logLevel: "Info" + expected: | + apiVersion: config.openshift.io/v1alpha1 + kind: ClusterMonitoring + spec: + thanosQuerierConfig: + logLevel: "Info" + - name: Should accept ThanosQuerierConfig with logLevel set to Debug + initial: | + apiVersion: config.openshift.io/v1alpha1 + kind: ClusterMonitoring + spec: + thanosQuerierConfig: + logLevel: "Debug" + expected: | + apiVersion: config.openshift.io/v1alpha1 + kind: ClusterMonitoring + spec: + thanosQuerierConfig: + logLevel: "Debug" + - name: Should reject ThanosQuerierConfig with invalid logLevel + initial: | + apiVersion: config.openshift.io/v1alpha1 + kind: ClusterMonitoring + spec: + thanosQuerierConfig: + logLevel: "InvalidLevel" + expectedError: 'spec.thanosQuerierConfig.logLevel: Unsupported value: "InvalidLevel": supported values: "Error", "Warn", "Info", "Debug"' + - name: Should accept ThanosQuerierConfig with requestLogging policy set to AllRequests + initial: | + apiVersion: config.openshift.io/v1alpha1 + kind: ClusterMonitoring + spec: + thanosQuerierConfig: + requestLogging: + policy: "AllRequests" + expected: | + apiVersion: config.openshift.io/v1alpha1 + kind: ClusterMonitoring + spec: + thanosQuerierConfig: + requestLogging: + policy: "AllRequests" + - name: Should accept ThanosQuerierConfig with requestLogging policy set to NoRequests + initial: | + apiVersion: config.openshift.io/v1alpha1 + kind: ClusterMonitoring + spec: + thanosQuerierConfig: + requestLogging: + policy: "NoRequests" + expected: | + apiVersion: config.openshift.io/v1alpha1 + kind: ClusterMonitoring + spec: + thanosQuerierConfig: + requestLogging: + policy: "NoRequests" + - name: Should reject ThanosQuerierConfig with invalid requestLogging policy + initial: | + apiVersion: config.openshift.io/v1alpha1 + kind: ClusterMonitoring + spec: + thanosQuerierConfig: + requestLogging: + policy: "InvalidValue" + expectedError: 'spec.thanosQuerierConfig.requestLogging.policy: Unsupported value: "InvalidValue": supported values: "AllRequests", "NoRequests"' + - name: Should accept ThanosQuerierConfig with crossOriginRequestPolicy set to AllowAll + initial: | + apiVersion: config.openshift.io/v1alpha1 + kind: ClusterMonitoring + spec: + thanosQuerierConfig: + crossOriginRequestPolicy: "AllowAll" + expected: | + apiVersion: config.openshift.io/v1alpha1 + kind: ClusterMonitoring + spec: + thanosQuerierConfig: + crossOriginRequestPolicy: "AllowAll" + - name: Should accept ThanosQuerierConfig with crossOriginRequestPolicy set to DenyAll + initial: | + apiVersion: config.openshift.io/v1alpha1 + kind: ClusterMonitoring + spec: + thanosQuerierConfig: + crossOriginRequestPolicy: "DenyAll" + expected: | + apiVersion: config.openshift.io/v1alpha1 + kind: ClusterMonitoring + spec: + thanosQuerierConfig: + crossOriginRequestPolicy: "DenyAll" + - name: Should reject ThanosQuerierConfig with invalid crossOriginRequestPolicy + initial: | + apiVersion: config.openshift.io/v1alpha1 + kind: ClusterMonitoring + spec: + thanosQuerierConfig: + crossOriginRequestPolicy: "InvalidValue" + expectedError: 'spec.thanosQuerierConfig.crossOriginRequestPolicy: Unsupported value: "InvalidValue": supported values: "AllowAll", "DenyAll"' - name: Should be able to create MonitoringPluginConfig with valid resources initial: | apiVersion: config.openshift.io/v1alpha1 diff --git a/config/v1alpha1/types_cluster_monitoring.go b/config/v1alpha1/types_cluster_monitoring.go index b532c846024..1f8693492d2 100644 --- a/config/v1alpha1/types_cluster_monitoring.go +++ b/config/v1alpha1/types_cluster_monitoring.go @@ -2377,6 +2377,34 @@ type TelemeterClientConfig struct { // At least one field must be specified; an empty thanosQuerierConfig object is not allowed. // +kubebuilder:validation:MinProperties=1 type ThanosQuerierConfig struct { + // logLevel defines the verbosity of logs emitted by Thanos Querier. + // logLevel is optional. + // Allowed values are Error, Warn, Info, and Debug. + // When set to Error, only errors will be logged. + // When set to Warn, both warnings and errors will be logged. + // When set to Info, general information, warnings, and errors will all be logged. + // When set to Debug, detailed debugging information will be logged. + // When omitted, this means no opinion and the platform is left to choose a reasonable default, that is subject to change over time. + // The current default value is `Info`. + // +optional + LogLevel LogLevel `json:"logLevel,omitempty"` + // requestLogging configures request logging for Thanos Querier. + // requestLogging is optional. + // When provided, the policy field within is required. + // When omitted, this means no opinion and the platform is left to choose a reasonable default, that is subject to change over time. + // The current default behavior is to not log any requests. + // +optional + RequestLogging ThanosQuerierRequestLoggingConfig `json:"requestLogging,omitempty,omitzero"` + // crossOriginRequestPolicy configures the CORS (Cross-Origin Resource Sharing) policy + // for Thanos Querier's HTTP endpoints. + // crossOriginRequestPolicy is optional. + // Valid values are "AllowAll" and "DenyAll". + // When set to "AllowAll", CORS headers are added to responses, allowing cross-origin requests from any domain. + // When set to "DenyAll", no CORS headers are added and cross-origin requests are rejected by the browser. + // When omitted, this means no opinion and the platform is left to choose a reasonable default, that is subject to change over time. + // The current default value is "DenyAll". + // +optional + CrossOriginRequestPolicy CrossOriginRequestPolicy `json:"crossOriginRequestPolicy,omitempty"` // nodeSelector defines the nodes on which the Pods are scheduled. // nodeSelector is optional. // @@ -2445,6 +2473,42 @@ type ThanosQuerierConfig struct { TopologySpreadConstraints []v1.TopologySpreadConstraint `json:"topologySpreadConstraints,omitempty"` } +// ThanosQuerierRequestLoggingConfig configures request logging for Thanos Querier. +type ThanosQuerierRequestLoggingConfig struct { + // policy determines which HTTP and gRPC requests are logged by Thanos Querier. + // Valid values are "AllRequests" and "NoRequests". + // When set to "AllRequests", every request received by Thanos Querier is logged with method, path, and response status. + // The log level for request logs is derived from the logLevel field. + // When set to "NoRequests", request logging is turned off. + // +required + Policy RequestLoggingPolicy `json:"policy,omitempty"` +} + +// RequestLoggingPolicy controls which HTTP and gRPC requests are logged. +// Valid values are "AllRequests" and "NoRequests". +// +kubebuilder:validation:Enum=AllRequests;NoRequests +type RequestLoggingPolicy string + +const ( + // RequestLoggingPolicyAllRequests enables logging of all incoming requests. + RequestLoggingPolicyAllRequests RequestLoggingPolicy = "AllRequests" + // RequestLoggingPolicyNoRequests disables request logging. + RequestLoggingPolicyNoRequests RequestLoggingPolicy = "NoRequests" +) + +// CrossOriginRequestPolicy controls the CORS (Cross-Origin Resource Sharing) policy +// for Thanos Querier's HTTP endpoints. +// Valid values are "AllowAll" and "DenyAll". +// +kubebuilder:validation:Enum=AllowAll;DenyAll +type CrossOriginRequestPolicy string + +const ( + // CrossOriginRequestPolicyAllowAll sets CORS headers allowing requests from any origin. + CrossOriginRequestPolicyAllowAll CrossOriginRequestPolicy = "AllowAll" + // CrossOriginRequestPolicyDenyAll does not set CORS headers, rejecting cross-origin requests. + CrossOriginRequestPolicyDenyAll CrossOriginRequestPolicy = "DenyAll" +) + // AuditProfile defines the audit log level for the Metrics Server. // +kubebuilder:validation:Enum=None;Metadata;Request;RequestResponse type AuditProfile string diff --git a/config/v1alpha1/zz_generated.crd-manifests/0000_10_config-operator_01_clustermonitorings.crd.yaml b/config/v1alpha1/zz_generated.crd-manifests/0000_10_config-operator_01_clustermonitorings.crd.yaml index 5e60466c039..b6968ddb931 100644 --- a/config/v1alpha1/zz_generated.crd-manifests/0000_10_config-operator_01_clustermonitorings.crd.yaml +++ b/config/v1alpha1/zz_generated.crd-manifests/0000_10_config-operator_01_clustermonitorings.crd.yaml @@ -5822,6 +5822,37 @@ spec: When set, at least one field must be specified within thanosQuerierConfig. minProperties: 1 properties: + crossOriginRequestPolicy: + description: |- + crossOriginRequestPolicy configures the CORS (Cross-Origin Resource Sharing) policy + for Thanos Querier's HTTP endpoints. + crossOriginRequestPolicy is optional. + Valid values are "AllowAll" and "DenyAll". + When set to "AllowAll", CORS headers are added to responses, allowing cross-origin requests from any domain. + When set to "DenyAll", no CORS headers are added and cross-origin requests are rejected by the browser. + When omitted, this means no opinion and the platform is left to choose a reasonable default, that is subject to change over time. + The current default value is "DenyAll". + enum: + - AllowAll + - DenyAll + type: string + logLevel: + description: |- + logLevel defines the verbosity of logs emitted by Thanos Querier. + logLevel is optional. + Allowed values are Error, Warn, Info, and Debug. + When set to Error, only errors will be logged. + When set to Warn, both warnings and errors will be logged. + When set to Info, general information, warnings, and errors will all be logged. + When set to Debug, detailed debugging information will be logged. + When omitted, this means no opinion and the platform is left to choose a reasonable default, that is subject to change over time. + The current default value is `Info`. + enum: + - Error + - Warn + - Info + - Debug + type: string nodeSelector: additionalProperties: type: string @@ -5836,6 +5867,28 @@ spec: maxProperties: 10 minProperties: 1 type: object + requestLogging: + description: |- + requestLogging configures request logging for Thanos Querier. + requestLogging is optional. + When provided, the policy field within is required. + When omitted, this means no opinion and the platform is left to choose a reasonable default, that is subject to change over time. + The current default behavior is to not log any requests. + properties: + policy: + description: |- + policy determines which HTTP and gRPC requests are logged by Thanos Querier. + Valid values are "AllRequests" and "NoRequests". + When set to "AllRequests", every request received by Thanos Querier is logged with method, path, and response status. + The log level for request logs is derived from the logLevel field. + When set to "NoRequests", request logging is turned off. + enum: + - AllRequests + - NoRequests + type: string + required: + - policy + type: object resources: description: |- resources defines the compute resource requests and limits for the Thanos Querier container. diff --git a/config/v1alpha1/zz_generated.deepcopy.go b/config/v1alpha1/zz_generated.deepcopy.go index efc8bf33992..a481b6b4c62 100644 --- a/config/v1alpha1/zz_generated.deepcopy.go +++ b/config/v1alpha1/zz_generated.deepcopy.go @@ -1954,6 +1954,7 @@ func (in *TelemeterClientConfig) DeepCopy() *TelemeterClientConfig { // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *ThanosQuerierConfig) DeepCopyInto(out *ThanosQuerierConfig) { *out = *in + out.RequestLogging = in.RequestLogging if in.NodeSelector != nil { in, out := &in.NodeSelector, &out.NodeSelector *out = make(map[string]string, len(*in)) @@ -1995,6 +1996,22 @@ func (in *ThanosQuerierConfig) DeepCopy() *ThanosQuerierConfig { return out } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ThanosQuerierRequestLoggingConfig) DeepCopyInto(out *ThanosQuerierRequestLoggingConfig) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ThanosQuerierRequestLoggingConfig. +func (in *ThanosQuerierRequestLoggingConfig) DeepCopy() *ThanosQuerierRequestLoggingConfig { + if in == nil { + return nil + } + out := new(ThanosQuerierRequestLoggingConfig) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *UppercaseActionConfig) DeepCopyInto(out *UppercaseActionConfig) { *out = *in diff --git a/config/v1alpha1/zz_generated.featuregated-crd-manifests/clustermonitorings.config.openshift.io/ClusterMonitoringConfig.yaml b/config/v1alpha1/zz_generated.featuregated-crd-manifests/clustermonitorings.config.openshift.io/ClusterMonitoringConfig.yaml index 113566b7fbd..34b63cefbbc 100644 --- a/config/v1alpha1/zz_generated.featuregated-crd-manifests/clustermonitorings.config.openshift.io/ClusterMonitoringConfig.yaml +++ b/config/v1alpha1/zz_generated.featuregated-crd-manifests/clustermonitorings.config.openshift.io/ClusterMonitoringConfig.yaml @@ -5822,6 +5822,37 @@ spec: When set, at least one field must be specified within thanosQuerierConfig. minProperties: 1 properties: + crossOriginRequestPolicy: + description: |- + crossOriginRequestPolicy configures the CORS (Cross-Origin Resource Sharing) policy + for Thanos Querier's HTTP endpoints. + crossOriginRequestPolicy is optional. + Valid values are "AllowAll" and "DenyAll". + When set to "AllowAll", CORS headers are added to responses, allowing cross-origin requests from any domain. + When set to "DenyAll", no CORS headers are added and cross-origin requests are rejected by the browser. + When omitted, this means no opinion and the platform is left to choose a reasonable default, that is subject to change over time. + The current default value is "DenyAll". + enum: + - AllowAll + - DenyAll + type: string + logLevel: + description: |- + logLevel defines the verbosity of logs emitted by Thanos Querier. + logLevel is optional. + Allowed values are Error, Warn, Info, and Debug. + When set to Error, only errors will be logged. + When set to Warn, both warnings and errors will be logged. + When set to Info, general information, warnings, and errors will all be logged. + When set to Debug, detailed debugging information will be logged. + When omitted, this means no opinion and the platform is left to choose a reasonable default, that is subject to change over time. + The current default value is `Info`. + enum: + - Error + - Warn + - Info + - Debug + type: string nodeSelector: additionalProperties: type: string @@ -5836,6 +5867,28 @@ spec: maxProperties: 10 minProperties: 1 type: object + requestLogging: + description: |- + requestLogging configures request logging for Thanos Querier. + requestLogging is optional. + When provided, the policy field within is required. + When omitted, this means no opinion and the platform is left to choose a reasonable default, that is subject to change over time. + The current default behavior is to not log any requests. + properties: + policy: + description: |- + policy determines which HTTP and gRPC requests are logged by Thanos Querier. + Valid values are "AllRequests" and "NoRequests". + When set to "AllRequests", every request received by Thanos Querier is logged with method, path, and response status. + The log level for request logs is derived from the logLevel field. + When set to "NoRequests", request logging is turned off. + enum: + - AllRequests + - NoRequests + type: string + required: + - policy + type: object resources: description: |- resources defines the compute resource requests and limits for the Thanos Querier container. diff --git a/config/v1alpha1/zz_generated.swagger_doc_generated.go b/config/v1alpha1/zz_generated.swagger_doc_generated.go index 8c79eb06781..0b364ee25cb 100644 --- a/config/v1alpha1/zz_generated.swagger_doc_generated.go +++ b/config/v1alpha1/zz_generated.swagger_doc_generated.go @@ -696,6 +696,9 @@ func (TelemeterClientConfig) SwaggerDoc() map[string]string { var map_ThanosQuerierConfig = map[string]string{ "": "ThanosQuerierConfig provides configuration options for the Thanos Querier component that runs in the `openshift-monitoring` namespace. At least one field must be specified; an empty thanosQuerierConfig object is not allowed.", + "logLevel": "logLevel defines the verbosity of logs emitted by Thanos Querier. logLevel is optional. Allowed values are Error, Warn, Info, and Debug. When set to Error, only errors will be logged. When set to Warn, both warnings and errors will be logged. When set to Info, general information, warnings, and errors will all be logged. When set to Debug, detailed debugging information will be logged. When omitted, this means no opinion and the platform is left to choose a reasonable default, that is subject to change over time. The current default value is `Info`.", + "requestLogging": "requestLogging configures request logging for Thanos Querier. requestLogging is optional. When provided, the policy field within is required. When omitted, this means no opinion and the platform is left to choose a reasonable default, that is subject to change over time. The current default behavior is to not log any requests.", + "crossOriginRequestPolicy": "crossOriginRequestPolicy configures the CORS (Cross-Origin Resource Sharing) policy for Thanos Querier's HTTP endpoints. crossOriginRequestPolicy is optional. Valid values are \"AllowAll\" and \"DenyAll\". When set to \"AllowAll\", CORS headers are added to responses, allowing cross-origin requests from any domain. When set to \"DenyAll\", no CORS headers are added and cross-origin requests are rejected by the browser. When omitted, this means no opinion and the platform is left to choose a reasonable default, that is subject to change over time. The current default value is \"DenyAll\".", "nodeSelector": "nodeSelector defines the nodes on which the Pods are scheduled. nodeSelector is optional.\n\nWhen omitted, this means the user has no opinion and the platform is left to choose reasonable defaults. These defaults are subject to change over time. The current default value is `kubernetes.io/os: linux`. When specified, nodeSelector must contain at least 1 entry and must not contain more than 10 entries.", "resources": "resources defines the compute resource requests and limits for the Thanos Querier container. resources is optional.\n\nWhen omitted, this means the user has no opinion and the platform is left to choose reasonable defaults. These defaults are subject to change over time. Requests cannot exceed limits. More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/ This is a simplified API that maps to Kubernetes ResourceRequirements. The current default values are:\n resources:\n - name: cpu\n request: 5m\n - name: memory\n request: 12Mi\nMaximum length for this list is 5. Minimum length for this list is 1. Each resource name must be unique within this list.", "tolerations": "tolerations defines tolerations for the pods. tolerations is optional.\n\nWhen omitted, this means the user has no opinion and the platform is left to choose reasonable defaults. These defaults are subject to change over time. Defaults are empty/unset. Maximum length for this list is 10. Minimum length for this list is 1.", @@ -706,6 +709,15 @@ func (ThanosQuerierConfig) SwaggerDoc() map[string]string { return map_ThanosQuerierConfig } +var map_ThanosQuerierRequestLoggingConfig = map[string]string{ + "": "ThanosQuerierRequestLoggingConfig configures request logging for Thanos Querier.", + "policy": "policy determines which HTTP and gRPC requests are logged by Thanos Querier. Valid values are \"AllRequests\" and \"NoRequests\". When set to \"AllRequests\", every request received by Thanos Querier is logged with method, path, and response status. The log level for request logs is derived from the logLevel field. When set to \"NoRequests\", request logging is turned off.", +} + +func (ThanosQuerierRequestLoggingConfig) SwaggerDoc() map[string]string { + return map_ThanosQuerierRequestLoggingConfig +} + var map_UppercaseActionConfig = map[string]string{ "": "UppercaseActionConfig configures the Uppercase action. Maps the concatenated source_labels to their upper case and writes to target_label. Requires Prometheus >= v2.36.0.", "targetLabel": "targetLabel is the label name where the upper-cased value is written. Must be between 1 and 128 characters in length.", diff --git a/openapi/generated_openapi/zz_generated.openapi.go b/openapi/generated_openapi/zz_generated.openapi.go index 098eb6661bf..63b760e2a14 100644 --- a/openapi/generated_openapi/zz_generated.openapi.go +++ b/openapi/generated_openapi/zz_generated.openapi.go @@ -541,6 +541,7 @@ func GetOpenAPIDefinitions(ref common.ReferenceCallback) map[string]common.OpenA "github.com/openshift/api/config/v1alpha1.TLSConfig": schema_openshift_api_config_v1alpha1_TLSConfig(ref), "github.com/openshift/api/config/v1alpha1.TelemeterClientConfig": schema_openshift_api_config_v1alpha1_TelemeterClientConfig(ref), "github.com/openshift/api/config/v1alpha1.ThanosQuerierConfig": schema_openshift_api_config_v1alpha1_ThanosQuerierConfig(ref), + "github.com/openshift/api/config/v1alpha1.ThanosQuerierRequestLoggingConfig": schema_openshift_api_config_v1alpha1_ThanosQuerierRequestLoggingConfig(ref), "github.com/openshift/api/config/v1alpha1.UppercaseActionConfig": schema_openshift_api_config_v1alpha1_UppercaseActionConfig(ref), "github.com/openshift/api/config/v1alpha1.UserDefinedMonitoring": schema_openshift_api_config_v1alpha1_UserDefinedMonitoring(ref), "github.com/openshift/api/config/v1alpha2.Custom": schema_openshift_api_config_v1alpha2_Custom(ref), @@ -26481,6 +26482,27 @@ func schema_openshift_api_config_v1alpha1_ThanosQuerierConfig(ref common.Referen Description: "ThanosQuerierConfig provides configuration options for the Thanos Querier component that runs in the `openshift-monitoring` namespace. At least one field must be specified; an empty thanosQuerierConfig object is not allowed.", Type: []string{"object"}, Properties: map[string]spec.Schema{ + "logLevel": { + SchemaProps: spec.SchemaProps{ + Description: "logLevel defines the verbosity of logs emitted by Thanos Querier. logLevel is optional. Allowed values are Error, Warn, Info, and Debug. When set to Error, only errors will be logged. When set to Warn, both warnings and errors will be logged. When set to Info, general information, warnings, and errors will all be logged. When set to Debug, detailed debugging information will be logged. When omitted, this means no opinion and the platform is left to choose a reasonable default, that is subject to change over time. The current default value is `Info`.", + Type: []string{"string"}, + Format: "", + }, + }, + "requestLogging": { + SchemaProps: spec.SchemaProps{ + Description: "requestLogging configures request logging for Thanos Querier. requestLogging is optional. When provided, the policy field within is required. When omitted, this means no opinion and the platform is left to choose a reasonable default, that is subject to change over time. The current default behavior is to not log any requests.", + Default: map[string]interface{}{}, + Ref: ref("github.com/openshift/api/config/v1alpha1.ThanosQuerierRequestLoggingConfig"), + }, + }, + "crossOriginRequestPolicy": { + SchemaProps: spec.SchemaProps{ + Description: "crossOriginRequestPolicy configures the CORS (Cross-Origin Resource Sharing) policy for Thanos Querier's HTTP endpoints. crossOriginRequestPolicy is optional. Valid values are \"AllowAll\" and \"DenyAll\". When set to \"AllowAll\", CORS headers are added to responses, allowing cross-origin requests from any domain. When set to \"DenyAll\", no CORS headers are added and cross-origin requests are rejected by the browser. When omitted, this means no opinion and the platform is left to choose a reasonable default, that is subject to change over time. The current default value is \"DenyAll\".", + Type: []string{"string"}, + Format: "", + }, + }, "nodeSelector": { SchemaProps: spec.SchemaProps{ Description: "nodeSelector defines the nodes on which the Pods are scheduled. nodeSelector is optional.\n\nWhen omitted, this means the user has no opinion and the platform is left to choose reasonable defaults. These defaults are subject to change over time. The current default value is `kubernetes.io/os: linux`. When specified, nodeSelector must contain at least 1 entry and must not contain more than 10 entries.", @@ -26565,7 +26587,28 @@ func schema_openshift_api_config_v1alpha1_ThanosQuerierConfig(ref common.Referen }, }, Dependencies: []string{ - "github.com/openshift/api/config/v1alpha1.ContainerResource", corev1.Toleration{}.OpenAPIModelName(), corev1.TopologySpreadConstraint{}.OpenAPIModelName()}, + "github.com/openshift/api/config/v1alpha1.ContainerResource", "github.com/openshift/api/config/v1alpha1.ThanosQuerierRequestLoggingConfig", corev1.Toleration{}.OpenAPIModelName(), corev1.TopologySpreadConstraint{}.OpenAPIModelName()}, + } +} + +func schema_openshift_api_config_v1alpha1_ThanosQuerierRequestLoggingConfig(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "ThanosQuerierRequestLoggingConfig configures request logging for Thanos Querier.", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "policy": { + SchemaProps: spec.SchemaProps{ + Description: "policy determines which HTTP and gRPC requests are logged by Thanos Querier. Valid values are \"AllRequests\" and \"NoRequests\". When set to \"AllRequests\", every request received by Thanos Querier is logged with method, path, and response status. The log level for request logs is derived from the logLevel field. When set to \"NoRequests\", request logging is turned off.", + Type: []string{"string"}, + Format: "", + }, + }, + }, + Required: []string{"policy"}, + }, + }, } } diff --git a/payload-manifests/crds/0000_10_config-operator_01_clustermonitorings.crd.yaml b/payload-manifests/crds/0000_10_config-operator_01_clustermonitorings.crd.yaml index 5e60466c039..b6968ddb931 100644 --- a/payload-manifests/crds/0000_10_config-operator_01_clustermonitorings.crd.yaml +++ b/payload-manifests/crds/0000_10_config-operator_01_clustermonitorings.crd.yaml @@ -5822,6 +5822,37 @@ spec: When set, at least one field must be specified within thanosQuerierConfig. minProperties: 1 properties: + crossOriginRequestPolicy: + description: |- + crossOriginRequestPolicy configures the CORS (Cross-Origin Resource Sharing) policy + for Thanos Querier's HTTP endpoints. + crossOriginRequestPolicy is optional. + Valid values are "AllowAll" and "DenyAll". + When set to "AllowAll", CORS headers are added to responses, allowing cross-origin requests from any domain. + When set to "DenyAll", no CORS headers are added and cross-origin requests are rejected by the browser. + When omitted, this means no opinion and the platform is left to choose a reasonable default, that is subject to change over time. + The current default value is "DenyAll". + enum: + - AllowAll + - DenyAll + type: string + logLevel: + description: |- + logLevel defines the verbosity of logs emitted by Thanos Querier. + logLevel is optional. + Allowed values are Error, Warn, Info, and Debug. + When set to Error, only errors will be logged. + When set to Warn, both warnings and errors will be logged. + When set to Info, general information, warnings, and errors will all be logged. + When set to Debug, detailed debugging information will be logged. + When omitted, this means no opinion and the platform is left to choose a reasonable default, that is subject to change over time. + The current default value is `Info`. + enum: + - Error + - Warn + - Info + - Debug + type: string nodeSelector: additionalProperties: type: string @@ -5836,6 +5867,28 @@ spec: maxProperties: 10 minProperties: 1 type: object + requestLogging: + description: |- + requestLogging configures request logging for Thanos Querier. + requestLogging is optional. + When provided, the policy field within is required. + When omitted, this means no opinion and the platform is left to choose a reasonable default, that is subject to change over time. + The current default behavior is to not log any requests. + properties: + policy: + description: |- + policy determines which HTTP and gRPC requests are logged by Thanos Querier. + Valid values are "AllRequests" and "NoRequests". + When set to "AllRequests", every request received by Thanos Querier is logged with method, path, and response status. + The log level for request logs is derived from the logLevel field. + When set to "NoRequests", request logging is turned off. + enum: + - AllRequests + - NoRequests + type: string + required: + - policy + type: object resources: description: |- resources defines the compute resource requests and limits for the Thanos Querier container.