Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -1181,6 +1181,9 @@ tests:
kind: ClusterMonitoring
spec:
thanosQuerierConfig:
logLevel: "Debug"
enableRequestLogging: "Enabled"
enableCORS: "Disabled"
nodeSelector:
kubernetes.io/os: linux
resources:
Expand All @@ -1201,6 +1204,9 @@ tests:
kind: ClusterMonitoring
spec:
thanosQuerierConfig:
logLevel: "Debug"
enableRequestLogging: "Enabled"
enableCORS: "Disabled"
nodeSelector:
kubernetes.io/os: linux
resources:
Expand Down Expand Up @@ -1434,6 +1440,134 @@ 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 enableRequestLogging set to Enabled
initial: |
apiVersion: config.openshift.io/v1alpha1
kind: ClusterMonitoring
spec:
thanosQuerierConfig:
enableRequestLogging: "Enabled"
expected: |
apiVersion: config.openshift.io/v1alpha1
kind: ClusterMonitoring
spec:
thanosQuerierConfig:
enableRequestLogging: "Enabled"
- name: Should accept ThanosQuerierConfig with enableRequestLogging set to Disabled
initial: |
apiVersion: config.openshift.io/v1alpha1
kind: ClusterMonitoring
spec:
thanosQuerierConfig:
enableRequestLogging: "Disabled"
expected: |
apiVersion: config.openshift.io/v1alpha1
kind: ClusterMonitoring
spec:
thanosQuerierConfig:
enableRequestLogging: "Disabled"
- name: Should reject ThanosQuerierConfig with invalid enableRequestLogging
initial: |
apiVersion: config.openshift.io/v1alpha1
kind: ClusterMonitoring
spec:
thanosQuerierConfig:
enableRequestLogging: "InvalidValue"
expectedError: 'spec.thanosQuerierConfig.enableRequestLogging: Unsupported value: "InvalidValue": supported values: "Enabled", "Disabled"'
- name: Should accept ThanosQuerierConfig with enableCORS set to Enabled
initial: |
apiVersion: config.openshift.io/v1alpha1
kind: ClusterMonitoring
spec:
thanosQuerierConfig:
enableCORS: "Enabled"
expected: |
apiVersion: config.openshift.io/v1alpha1
kind: ClusterMonitoring
spec:
thanosQuerierConfig:
enableCORS: "Enabled"
- name: Should accept ThanosQuerierConfig with enableCORS set to Disabled
initial: |
apiVersion: config.openshift.io/v1alpha1
kind: ClusterMonitoring
spec:
thanosQuerierConfig:
enableCORS: "Disabled"
expected: |
apiVersion: config.openshift.io/v1alpha1
kind: ClusterMonitoring
spec:
thanosQuerierConfig:
enableCORS: "Disabled"
- name: Should reject ThanosQuerierConfig with invalid enableCORS
initial: |
apiVersion: config.openshift.io/v1alpha1
kind: ClusterMonitoring
spec:
thanosQuerierConfig:
enableCORS: "InvalidValue"
expectedError: 'spec.thanosQuerierConfig.enableCORS: Unsupported value: "InvalidValue": supported values: "Enabled", "Disabled"'
- name: Should be able to create MonitoringPluginConfig with valid resources
initial: |
apiVersion: config.openshift.io/v1alpha1
Expand Down
41 changes: 41 additions & 0 deletions config/v1alpha1/types_cluster_monitoring.go
Original file line number Diff line number Diff line change
Expand Up @@ -2381,6 +2381,35 @@ 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"`
// enableRequestLogging controls whether all incoming HTTP requests are logged by Thanos Querier.
// enableRequestLogging is optional.
// Valid values are "Enabled" and "Disabled".
// When set to "Enabled", every request received by Thanos Querier is logged with method, path, and response status.
// When set to "Disabled", request logging is turned off.
// 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 "Disabled".
// +optional
EnableRequestLogging ThanosQuerierToggle `json:"enableRequestLogging,omitempty"`
// enableCORS controls whether Thanos Querier sets CORS headers allowing access from any origin.
// enableCORS is optional.
// Valid values are "Enabled" and "Disabled".
// When set to "Enabled", CORS headers are added to responses, allowing cross-origin requests from any domain.
// When set to "Disabled", no CORS headers are added.
// 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 "Disabled".
// +optional
EnableCORS ThanosQuerierToggle `json:"enableCORS,omitempty"`
// nodeSelector defines the nodes on which the Pods are scheduled.
// nodeSelector is optional.
//
Expand Down Expand Up @@ -2449,6 +2478,18 @@ type ThanosQuerierConfig struct {
TopologySpreadConstraints []v1.TopologySpreadConstraint `json:"topologySpreadConstraints,omitempty"`
}

// ThanosQuerierToggle is a string type for Thanos Querier feature toggles.
// Valid values are "Enabled" and "Disabled".
// +kubebuilder:validation:Enum=Enabled;Disabled
type ThanosQuerierToggle string

const (
// ThanosQuerierToggleEnabled enables the feature.
ThanosQuerierToggleEnabled ThanosQuerierToggle = "Enabled"
// ThanosQuerierToggleDisabled disables the feature.
ThanosQuerierToggleDisabled ThanosQuerierToggle = "Disabled"
)

// AuditProfile defines the audit log level for the Metrics Server.
// +kubebuilder:validation:Enum=None;Metadata;Request;RequestResponse
type AuditProfile string
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5888,6 +5888,49 @@ spec:
When set, at least one field must be specified within thanosQuerierConfig.
minProperties: 1
properties:
enableCORS:
description: |-
enableCORS controls whether Thanos Querier sets CORS headers allowing access from any origin.
enableCORS is optional.
Valid values are "Enabled" and "Disabled".
When set to "Enabled", CORS headers are added to responses, allowing cross-origin requests from any domain.
When set to "Disabled", no CORS headers are added.
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 "Disabled".
enum:
- Enabled
- Disabled
type: string
enableRequestLogging:
description: |-
enableRequestLogging controls whether all incoming HTTP requests are logged by Thanos Querier.
enableRequestLogging is optional.
Valid values are "Enabled" and "Disabled".
When set to "Enabled", every request received by Thanos Querier is logged with method, path, and response status.
When set to "Disabled", request logging is turned off.
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 "Disabled".
enum:
- Enabled
- Disabled
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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5888,6 +5888,49 @@ spec:
When set, at least one field must be specified within thanosQuerierConfig.
minProperties: 1
properties:
enableCORS:
description: |-
enableCORS controls whether Thanos Querier sets CORS headers allowing access from any origin.
enableCORS is optional.
Valid values are "Enabled" and "Disabled".
When set to "Enabled", CORS headers are added to responses, allowing cross-origin requests from any domain.
When set to "Disabled", no CORS headers are added.
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 "Disabled".
enum:
- Enabled
- Disabled
type: string
enableRequestLogging:
description: |-
enableRequestLogging controls whether all incoming HTTP requests are logged by Thanos Querier.
enableRequestLogging is optional.
Valid values are "Enabled" and "Disabled".
When set to "Enabled", every request received by Thanos Querier is logged with method, path, and response status.
When set to "Disabled", request logging is turned off.
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 "Disabled".
enum:
- Enabled
- Disabled
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
Expand Down
3 changes: 3 additions & 0 deletions config/v1alpha1/zz_generated.swagger_doc_generated.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading