From a007e77b6fd2eaf73cc8a0aba4d7e0fa8871cca0 Mon Sep 17 00:00:00 2001 From: Mario Fernandez Date: Thu, 21 May 2026 09:54:14 +0200 Subject: [PATCH 1/2] Add userAlertmanagerConfigSelection to ClusterMonitoring API Restore parity with the cluster-monitoring-config ConfigMap field enableUserAlertmanagerConfig that was removed from AlertmanagerConfig during API review (#2148). userAlertmanagerConfigSelection uses Selectable and None enum values (kube-api-linter nobools) instead of a boolean: Selectable matches enableUserAlertmanagerConfig: true, None matches false. The platform Alertmanager in openshift-monitoring discovers AlertmanagerConfig resources in user-defined namespaces only when set to Selectable and user-workload Alertmanager is not enabled. Omitted defaults to None. Includes CRD/OpenAPI codegen and integration tests. Co-authored-by: Cursor --- .../ClusterMonitoringConfig.yaml | 30 ++++++++ config/v1alpha1/types_cluster_monitoring.go | 29 ++++++++ ...ig-operator_01_clustermonitorings.crd.yaml | 18 +++++ .../ClusterMonitoringConfig.yaml | 18 +++++ .../zz_generated.swagger_doc_generated.go | 7 +- .../generated_openapi/zz_generated.openapi.go | 8 +++ openapi/openapi.json | 72 +++++++++++++------ ...ig-operator_01_clustermonitorings.crd.yaml | 18 +++++ 8 files changed, 177 insertions(+), 23 deletions(-) diff --git a/config/v1alpha1/tests/clustermonitorings.config.openshift.io/ClusterMonitoringConfig.yaml b/config/v1alpha1/tests/clustermonitorings.config.openshift.io/ClusterMonitoringConfig.yaml index 83956355cef..c8670664e7c 100644 --- a/config/v1alpha1/tests/clustermonitorings.config.openshift.io/ClusterMonitoringConfig.yaml +++ b/config/v1alpha1/tests/clustermonitorings.config.openshift.io/ClusterMonitoringConfig.yaml @@ -18,6 +18,36 @@ tests: spec: userDefined: mode: "Disabled" + - name: Should accept userAlertmanagerConfigSelection on alertmanagerConfig + initial: | + apiVersion: config.openshift.io/v1alpha1 + kind: ClusterMonitoring + spec: + userDefined: + mode: "Disabled" + alertmanagerConfig: + deploymentMode: "DefaultConfig" + userAlertmanagerConfigSelection: Selectable + expected: | + apiVersion: config.openshift.io/v1alpha1 + kind: ClusterMonitoring + spec: + userDefined: + mode: "Disabled" + alertmanagerConfig: + deploymentMode: "DefaultConfig" + userAlertmanagerConfigSelection: Selectable + - name: Should reject invalid userAlertmanagerConfigSelection on alertmanagerConfig + initial: | + apiVersion: config.openshift.io/v1alpha1 + kind: ClusterMonitoring + spec: + userDefined: + mode: "Disabled" + alertmanagerConfig: + deploymentMode: "DefaultConfig" + userAlertmanagerConfigSelection: Enabled + expectedError: 'spec.alertmanagerConfig.userAlertmanagerConfigSelection: Unsupported value: "Enabled": supported values: "Selectable", "None"' - name: Should reject ContainerResource with duplicate names initial: | apiVersion: config.openshift.io/v1alpha1 diff --git a/config/v1alpha1/types_cluster_monitoring.go b/config/v1alpha1/types_cluster_monitoring.go index b532c846024..ce122ab314c 100644 --- a/config/v1alpha1/types_cluster_monitoring.go +++ b/config/v1alpha1/types_cluster_monitoring.go @@ -794,8 +794,37 @@ type AlertmanagerConfig struct { // When set to CustomConfig, the Alertmanager will be deployed with custom configuration. // +optional CustomConfig AlertmanagerCustomConfig `json:"customConfig,omitempty,omitzero"` + // userAlertmanagerConfigSelection is an optional field that controls whether user-defined + // namespaces can be selected for AlertmanagerConfig lookups on the platform Alertmanager + // instance in the `openshift-monitoring` namespace. + // Valid values are Selectable and None. + // When set to Selectable, the platform Alertmanager discovers AlertmanagerConfig resources + // in user-defined namespaces. This is equivalent to `enableUserAlertmanagerConfig: true` in + // the cluster-monitoring-config ConfigMap. + // When set to None, user-defined namespaces are not selected for AlertmanagerConfig lookups + // on the platform Alertmanager. This is equivalent to `enableUserAlertmanagerConfig: false` + // in the cluster-monitoring-config ConfigMap. + // This setting only applies when the user-workload monitoring Alertmanager is not enabled. + // When omitted, the default value is None. + // +optional + // +kubebuilder:validation:Enum=Selectable;None + UserAlertmanagerConfigSelection UserAlertmanagerConfigSelection `json:"userAlertmanagerConfigSelection,omitempty"` } +// UserAlertmanagerConfigSelection controls whether the platform Alertmanager selects +// AlertmanagerConfig resources from user-defined namespaces. +// +enum +type UserAlertmanagerConfigSelection string + +const ( + // UserAlertmanagerConfigSelectionSelectable enables user-defined namespaces to be selected + // for AlertmanagerConfig lookups on the platform Alertmanager. + UserAlertmanagerConfigSelectionSelectable UserAlertmanagerConfigSelection = "Selectable" + // UserAlertmanagerConfigSelectionNone disables user-defined namespaces from being selected + // for AlertmanagerConfig lookups on the platform Alertmanager. + UserAlertmanagerConfigSelectionNone UserAlertmanagerConfigSelection = "None" +) + // AlertmanagerCustomConfig represents the configuration for a custom Alertmanager deployment. // alertmanagerCustomConfig provides configuration options for the default Alertmanager instance // that runs in the `openshift-monitoring` namespace. Use this configuration to control 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..89723cfc46b 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 @@ -888,6 +888,24 @@ spec: - DefaultConfig - CustomConfig type: string + userAlertmanagerConfigSelection: + description: |- + userAlertmanagerConfigSelection is an optional field that controls whether user-defined + namespaces can be selected for AlertmanagerConfig lookups on the platform Alertmanager + instance in the `openshift-monitoring` namespace. + Valid values are Selectable and None. + When set to Selectable, the platform Alertmanager discovers AlertmanagerConfig resources + in user-defined namespaces. This is equivalent to `enableUserAlertmanagerConfig: true` in + the cluster-monitoring-config ConfigMap. + When set to None, user-defined namespaces are not selected for AlertmanagerConfig lookups + on the platform Alertmanager. This is equivalent to `enableUserAlertmanagerConfig: false` + in the cluster-monitoring-config ConfigMap. + This setting only applies when the user-workload monitoring Alertmanager is not enabled. + When omitted, the default value is None. + enum: + - Selectable + - None + type: string required: - deploymentMode type: object 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..5d22b8514e3 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 @@ -888,6 +888,24 @@ spec: - DefaultConfig - CustomConfig type: string + userAlertmanagerConfigSelection: + description: |- + userAlertmanagerConfigSelection is an optional field that controls whether user-defined + namespaces can be selected for AlertmanagerConfig lookups on the platform Alertmanager + instance in the `openshift-monitoring` namespace. + Valid values are Selectable and None. + When set to Selectable, the platform Alertmanager discovers AlertmanagerConfig resources + in user-defined namespaces. This is equivalent to `enableUserAlertmanagerConfig: true` in + the cluster-monitoring-config ConfigMap. + When set to None, user-defined namespaces are not selected for AlertmanagerConfig lookups + on the platform Alertmanager. This is equivalent to `enableUserAlertmanagerConfig: false` + in the cluster-monitoring-config ConfigMap. + This setting only applies when the user-workload monitoring Alertmanager is not enabled. + When omitted, the default value is None. + enum: + - Selectable + - None + type: string required: - deploymentMode type: object diff --git a/config/v1alpha1/zz_generated.swagger_doc_generated.go b/config/v1alpha1/zz_generated.swagger_doc_generated.go index 8c79eb06781..bd2e9b7e590 100644 --- a/config/v1alpha1/zz_generated.swagger_doc_generated.go +++ b/config/v1alpha1/zz_generated.swagger_doc_generated.go @@ -96,9 +96,10 @@ func (AdditionalAlertmanagerConfig) SwaggerDoc() map[string]string { } var map_AlertmanagerConfig = map[string]string{ - "": "alertmanagerConfig provides configuration options for the default Alertmanager instance that runs in the `openshift-monitoring` namespace. Use this configuration to control whether the default Alertmanager is deployed, how it logs, and how its pods are scheduled.", - "deploymentMode": "deploymentMode determines whether the default Alertmanager instance should be deployed as part of the monitoring stack. Allowed values are Disabled, DefaultConfig, and CustomConfig. When set to Disabled, the Alertmanager instance will not be deployed. When set to DefaultConfig, the platform will deploy Alertmanager with default settings. When set to CustomConfig, the Alertmanager will be deployed with custom configuration.", - "customConfig": "customConfig must be set when deploymentMode is CustomConfig, and must be unset otherwise. When set to CustomConfig, the Alertmanager will be deployed with custom configuration.", + "": "alertmanagerConfig provides configuration options for the default Alertmanager instance that runs in the `openshift-monitoring` namespace. Use this configuration to control whether the default Alertmanager is deployed, how it logs, and how its pods are scheduled.", + "deploymentMode": "deploymentMode determines whether the default Alertmanager instance should be deployed as part of the monitoring stack. Allowed values are Disabled, DefaultConfig, and CustomConfig. When set to Disabled, the Alertmanager instance will not be deployed. When set to DefaultConfig, the platform will deploy Alertmanager with default settings. When set to CustomConfig, the Alertmanager will be deployed with custom configuration.", + "customConfig": "customConfig must be set when deploymentMode is CustomConfig, and must be unset otherwise. When set to CustomConfig, the Alertmanager will be deployed with custom configuration.", + "userAlertmanagerConfigSelection": "userAlertmanagerConfigSelection is an optional field that controls whether user-defined namespaces can be selected for AlertmanagerConfig lookups on the platform Alertmanager instance in the `openshift-monitoring` namespace. Valid values are Selectable and None. When set to Selectable, the platform Alertmanager discovers AlertmanagerConfig resources in user-defined namespaces. This is equivalent to `enableUserAlertmanagerConfig: true` in the cluster-monitoring-config ConfigMap. When set to None, user-defined namespaces are not selected for AlertmanagerConfig lookups on the platform Alertmanager. This is equivalent to `enableUserAlertmanagerConfig: false` in the cluster-monitoring-config ConfigMap. This setting only applies when the user-workload monitoring Alertmanager is not enabled. When omitted, the default value is None.", } func (AlertmanagerConfig) SwaggerDoc() map[string]string { diff --git a/openapi/generated_openapi/zz_generated.openapi.go b/openapi/generated_openapi/zz_generated.openapi.go index 098eb6661bf..58cae551478 100644 --- a/openapi/generated_openapi/zz_generated.openapi.go +++ b/openapi/generated_openapi/zz_generated.openapi.go @@ -22724,6 +22724,14 @@ func schema_openshift_api_config_v1alpha1_AlertmanagerConfig(ref common.Referenc Ref: ref("github.com/openshift/api/config/v1alpha1.AlertmanagerCustomConfig"), }, }, + "userAlertmanagerConfigSelection": { + SchemaProps: spec.SchemaProps{ + Description: "userAlertmanagerConfigSelection is an optional field that controls whether user-defined namespaces can be selected for AlertmanagerConfig lookups on the platform Alertmanager instance in the `openshift-monitoring` namespace. Valid values are Selectable and None. When set to Selectable, the platform Alertmanager discovers AlertmanagerConfig resources in user-defined namespaces. This is equivalent to `enableUserAlertmanagerConfig: true` in the cluster-monitoring-config ConfigMap. When set to None, user-defined namespaces are not selected for AlertmanagerConfig lookups on the platform Alertmanager. This is equivalent to `enableUserAlertmanagerConfig: false` in the cluster-monitoring-config ConfigMap. This setting only applies when the user-workload monitoring Alertmanager is not enabled. When omitted, the default value is None.\n\nPossible enum values:\n - `\"None\"` disables user-defined namespaces from being selected for AlertmanagerConfig lookups on the platform Alertmanager.\n - `\"Selectable\"` enables user-defined namespaces to be selected for AlertmanagerConfig lookups on the platform Alertmanager.", + Type: []string{"string"}, + Format: "", + Enum: []interface{}{"None", "Selectable"}, + }, + }, }, Required: []string{"deploymentMode"}, }, diff --git a/openapi/openapi.json b/openapi/openapi.json index 2b1f51b9d29..25177079a67 100644 --- a/openapi/openapi.json +++ b/openapi/openapi.json @@ -15834,6 +15834,7 @@ "properties": { "kms": { "description": "kms defines the configuration for the external KMS instance that manages the encryption keys, when KMS encryption is enabled sensitive resources will be encrypted using keys managed by an externally configured KMS instance.\n\nThe Key Management Service (KMS) instance provides symmetric encryption and is responsible for managing the lifecyle of the encryption keys outside of the control plane. This allows integration with an external provider to manage the data encryption keys securely.", + "default": {}, "$ref": "#/definitions/com.github.openshift.api.config.v1.KMSPluginConfig" }, "type": { @@ -20514,6 +20515,19 @@ } } }, + "com.github.openshift.api.config.v1.NetworkObservabilitySpec": { + "description": "NetworkObservabilitySpec defines the configuration for network observability installation", + "type": "object", + "required": [ + "installationPolicy" + ], + "properties": { + "installationPolicy": { + "description": "installationPolicy controls whether network observability is installed during cluster deployment. Valid values are \"InstallAndEnable\" and \"NoAction\". When set to \"InstallAndEnable\", ensure that network observability will be installed and enabled on the cluster. If already installed, no action taken, but if it gets uninstalled, it will install it again. When set to \"NoAction\", nothing will be done regarding Network observability.", + "type": "string" + } + } + }, "com.github.openshift.api.config.v1.NetworkSpec": { "description": "NetworkSpec is the desired network configuration. As a general rule, this SHOULD NOT be read directly. Instead, you should consume the NetworkStatus, as it indicates the currently deployed configuration. Currently, most spec fields are immutable after installation. Please view the individual ones for further details on each.", "type": "object", @@ -20541,6 +20555,11 @@ "default": {}, "$ref": "#/definitions/com.github.openshift.api.config.v1.NetworkDiagnostics" }, + "networkObservability": { + "description": "networkObservability is an optional field that configures network observability installation during cluster deployment (day-0). When omitted, unless this is a SNO cluster, network observability will be installed if not already present, after that, no action taken.", + "default": {}, + "$ref": "#/definitions/com.github.openshift.api.config.v1.NetworkObservabilitySpec" + }, "networkType": { "description": "networkType is the plugin that is to be deployed (e.g. OVNKubernetes). This should match a value that the cluster-network-operator understands, or else no networking will be installed. Currently supported values are: - OVNKubernetes This field is immutable after installation.", "type": "string", @@ -22323,7 +22342,7 @@ "type": "object", "properties": { "allowedRegistries": { - "description": "allowedRegistries are the only registries permitted for image pull and push actions. All other registries are denied.\n\nOnly one of BlockedRegistries or AllowedRegistries may be set.", + "description": "allowedRegistries are the only registries permitted for image pull and push actions. All other registries are denied. Each entry must be a valid registry scope in the format hostname[:port][/path], optionally prefixed with \"*.\" for wildcard subdomains (e.g., \"*.example.com\"). The hostname must consist of valid DNS labels separated by dots, where each label contains only alphanumeric characters and hyphens and does not start or end with a hyphen. Entries must not be empty, must not include tags (e.g., \":latest\") or digests (e.g., \"@sha256:...\"), and must be at most 256 characters in length. The list may contain at most 1024 entries.\n\nOnly one of BlockedRegistries or AllowedRegistries may be set.", "type": "array", "items": { "type": "string", @@ -22332,7 +22351,7 @@ "x-kubernetes-list-type": "atomic" }, "blockedRegistries": { - "description": "blockedRegistries cannot be used for image pull and push actions. All other registries are permitted.\n\nOnly one of BlockedRegistries or AllowedRegistries may be set.", + "description": "blockedRegistries cannot be used for image pull and push actions. All other registries are permitted. Each entry must be a valid registry scope in the format hostname[:port][/path], optionally prefixed with \"*.\" for wildcard subdomains (e.g., \"*.example.com\"). The hostname must consist of valid DNS labels separated by dots, where each label contains only alphanumeric characters and hyphens and does not start or end with a hyphen. Entries must not be empty, must not include tags (e.g., \":latest\") or digests (e.g., \"@sha256:...\"), and must be at most 256 characters in length. The list may contain at most 1024 entries.\n\nOnly one of BlockedRegistries or AllowedRegistries may be set.", "type": "array", "items": { "type": "string", @@ -22350,7 +22369,7 @@ "x-kubernetes-list-type": "set" }, "insecureRegistries": { - "description": "insecureRegistries are registries which do not have a valid TLS certificates or only support HTTP connections.", + "description": "insecureRegistries are registries which do not have a valid TLS certificates or only support HTTP connections. Each entry must be a valid registry scope in the format hostname[:port][/path], optionally prefixed with \"*.\" for wildcard subdomains (e.g., \"*.example.com\"). The hostname must consist of valid DNS labels separated by dots, where each label contains only alphanumeric characters and hyphens and does not start or end with a hyphen. Entries must not be empty, must not include tags (e.g., \":latest\") or digests (e.g., \"@sha256:...\"), and must be at most 256 characters in length. The list may contain at most 1024 entries.", "type": "array", "items": { "type": "string", @@ -23893,6 +23912,14 @@ "deploymentMode": { "description": "deploymentMode determines whether the default Alertmanager instance should be deployed as part of the monitoring stack. Allowed values are Disabled, DefaultConfig, and CustomConfig. When set to Disabled, the Alertmanager instance will not be deployed. When set to DefaultConfig, the platform will deploy Alertmanager with default settings. When set to CustomConfig, the Alertmanager will be deployed with custom configuration.", "type": "string" + }, + "userAlertmanagerConfigSelection": { + "description": "userAlertmanagerConfigSelection is an optional field that controls whether user-defined namespaces can be selected for AlertmanagerConfig lookups on the platform Alertmanager instance in the `openshift-monitoring` namespace. Valid values are Selectable and None. When set to Selectable, the platform Alertmanager discovers AlertmanagerConfig resources in user-defined namespaces. This is equivalent to `enableUserAlertmanagerConfig: true` in the cluster-monitoring-config ConfigMap. When set to None, user-defined namespaces are not selected for AlertmanagerConfig lookups on the platform Alertmanager. This is equivalent to `enableUserAlertmanagerConfig: false` in the cluster-monitoring-config ConfigMap. This setting only applies when the user-workload monitoring Alertmanager is not enabled. When omitted, the default value is None.\n\nPossible enum values:\n - `\"None\"` disables user-defined namespaces from being selected for AlertmanagerConfig lookups on the platform Alertmanager.\n - `\"Selectable\"` enables user-defined namespaces to be selected for AlertmanagerConfig lookups on the platform Alertmanager.", + "type": "string", + "enum": [ + "None", + "Selectable" + ] } } }, @@ -24844,6 +24871,11 @@ "default": {}, "$ref": "#/definitions/com.github.openshift.api.config.v1alpha1.NodeExporterCollectorProcessesConfig" }, + "softirqs": { + "description": "softirqs configures the softirqs collector, which exposes detailed softirq statistics from /proc/softirqs. softirqs is optional. When omitted, this means no opinion and the platform is left to choose a reasonable default, which is subject to change over time. The current default is disabled. Enable when you need visibility into kernel softirq processing across CPUs.", + "default": {}, + "$ref": "#/definitions/com.github.openshift.api.config.v1alpha1.NodeExporterCollectorSoftirqsConfig" + }, "systemd": { "description": "systemd configures the systemd collector, which collects statistics on the systemd daemon and its managed services. systemd is optional. When omitted, this means no opinion and the platform is left to choose a reasonable default, which is subject to change over time. The current default is disabled. Enabling this collector with a long list of selected units may produce metrics with high cardinality. If you enable this collector, closely monitor the prometheus-k8s deployment for excessive memory usage. Enable when you need metrics for specific units; scope units carefully.", "default": {}, @@ -25002,6 +25034,23 @@ } } }, + "com.github.openshift.api.config.v1alpha1.NodeExporterCollectorSoftirqsConfig": { + "description": "NodeExporterCollectorSoftirqsConfig provides configuration for the softirqs collector of the node-exporter agent. The softirqs collector exposes detailed softirq statistics from /proc/softirqs. It is disabled by default.", + "type": "object", + "required": [ + "collectionPolicy" + ], + "properties": { + "collectionPolicy": { + "description": "collectionPolicy declares whether the softirqs collector collects metrics. This field is required. Valid values are \"Collect\" and \"DoNotCollect\". When set to \"Collect\", the softirqs collector is active and softirq statistics are collected. When set to \"DoNotCollect\", the softirqs collector is inactive.\n\nPossible enum values:\n - `\"Collect\"` means the collector is active and will produce metrics.\n - `\"DoNotCollect\"` means the collector is inactive and will not produce metrics.", + "type": "string", + "enum": [ + "Collect", + "DoNotCollect" + ] + } + } + }, "com.github.openshift.api.config.v1alpha1.NodeExporterCollectorSystemdCollectConfig": { "description": "NodeExporterCollectorSystemdCollectConfig holds configuration options for the systemd collector when it is actively collecting metrics. At least one field must be specified.", "type": "object", @@ -25087,14 +25136,6 @@ "type": "integer", "format": "int32" }, - "nodeSelector": { - "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.", - "type": "object", - "additionalProperties": { - "type": "string", - "default": "" - } - }, "resources": { "description": "resources defines the compute resource requests and limits for the node-exporter container. This includes CPU, memory and HugePages constraints to help control scheduling and resource usage. When not specified, defaults are used by the platform. Requests cannot exceed limits. This field is optional. 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: 8m\n limit: null\n - name: memory\n request: 32Mi\n limit: null", "type": "array", @@ -25106,15 +25147,6 @@ "name" ], "x-kubernetes-list-type": "map" - }, - "tolerations": { - "description": "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. The current default is to tolerate all taints (operator: Exists without any key), which is typical for DaemonSets that must run on every node. Maximum length for this list is 10. Minimum length for this list is 1.", - "type": "array", - "items": { - "default": {}, - "$ref": "#/definitions/Toleration.v1.core.api.k8s.io" - }, - "x-kubernetes-list-type": "atomic" } } }, 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..89723cfc46b 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 @@ -888,6 +888,24 @@ spec: - DefaultConfig - CustomConfig type: string + userAlertmanagerConfigSelection: + description: |- + userAlertmanagerConfigSelection is an optional field that controls whether user-defined + namespaces can be selected for AlertmanagerConfig lookups on the platform Alertmanager + instance in the `openshift-monitoring` namespace. + Valid values are Selectable and None. + When set to Selectable, the platform Alertmanager discovers AlertmanagerConfig resources + in user-defined namespaces. This is equivalent to `enableUserAlertmanagerConfig: true` in + the cluster-monitoring-config ConfigMap. + When set to None, user-defined namespaces are not selected for AlertmanagerConfig lookups + on the platform Alertmanager. This is equivalent to `enableUserAlertmanagerConfig: false` + in the cluster-monitoring-config ConfigMap. + This setting only applies when the user-workload monitoring Alertmanager is not enabled. + When omitted, the default value is None. + enum: + - Selectable + - None + type: string required: - deploymentMode type: object From 4d4299169f6b29b0f8f94992a8a147044a104a78 Mon Sep 17 00:00:00 2001 From: Mario Fernandez Date: Wed, 27 May 2026 17:10:40 +0200 Subject: [PATCH 2/2] Move userAlertmanagerConfigSelection under alertmanager customConfig Address API review feedback to colocate user-namespace AlertmanagerConfig lookup settings with other Alertmanager deployment options in AlertmanagerCustomConfig. The field is only valid when deploymentMode is CustomConfig, matching the customConfig union semantics. Update integration tests and regenerated CRD/OpenAPI artifacts. Co-authored-by: Cursor --- .../ClusterMonitoringConfig.yaml | 21 ++++++----- config/v1alpha1/types_cluster_monitoring.go | 33 ++++++++--------- ...ig-operator_01_clustermonitorings.crd.yaml | 36 +++++++++---------- .../ClusterMonitoringConfig.yaml | 36 +++++++++---------- .../zz_generated.swagger_doc_generated.go | 24 ++++++------- .../generated_openapi/zz_generated.openapi.go | 18 +++++----- openapi/openapi.json | 18 +++++----- ...ig-operator_01_clustermonitorings.crd.yaml | 36 +++++++++---------- 8 files changed, 113 insertions(+), 109 deletions(-) diff --git a/config/v1alpha1/tests/clustermonitorings.config.openshift.io/ClusterMonitoringConfig.yaml b/config/v1alpha1/tests/clustermonitorings.config.openshift.io/ClusterMonitoringConfig.yaml index c8670664e7c..26cfaa16739 100644 --- a/config/v1alpha1/tests/clustermonitorings.config.openshift.io/ClusterMonitoringConfig.yaml +++ b/config/v1alpha1/tests/clustermonitorings.config.openshift.io/ClusterMonitoringConfig.yaml @@ -18,7 +18,7 @@ tests: spec: userDefined: mode: "Disabled" - - name: Should accept userAlertmanagerConfigSelection on alertmanagerConfig + - name: Should accept userAlertmanagerConfigSelection on alertmanagerConfig customConfig initial: | apiVersion: config.openshift.io/v1alpha1 kind: ClusterMonitoring @@ -26,8 +26,9 @@ tests: userDefined: mode: "Disabled" alertmanagerConfig: - deploymentMode: "DefaultConfig" - userAlertmanagerConfigSelection: Selectable + deploymentMode: "CustomConfig" + customConfig: + userAlertmanagerConfigSelection: Selectable expected: | apiVersion: config.openshift.io/v1alpha1 kind: ClusterMonitoring @@ -35,9 +36,10 @@ tests: userDefined: mode: "Disabled" alertmanagerConfig: - deploymentMode: "DefaultConfig" - userAlertmanagerConfigSelection: Selectable - - name: Should reject invalid userAlertmanagerConfigSelection on alertmanagerConfig + deploymentMode: "CustomConfig" + customConfig: + userAlertmanagerConfigSelection: Selectable + - name: Should reject invalid userAlertmanagerConfigSelection on alertmanagerConfig customConfig initial: | apiVersion: config.openshift.io/v1alpha1 kind: ClusterMonitoring @@ -45,9 +47,10 @@ tests: userDefined: mode: "Disabled" alertmanagerConfig: - deploymentMode: "DefaultConfig" - userAlertmanagerConfigSelection: Enabled - expectedError: 'spec.alertmanagerConfig.userAlertmanagerConfigSelection: Unsupported value: "Enabled": supported values: "Selectable", "None"' + deploymentMode: "CustomConfig" + customConfig: + userAlertmanagerConfigSelection: Enabled + expectedError: 'spec.alertmanagerConfig.customConfig.userAlertmanagerConfigSelection: Unsupported value: "Enabled": supported values: "Selectable", "None"' - name: Should reject ContainerResource with duplicate names initial: | apiVersion: config.openshift.io/v1alpha1 diff --git a/config/v1alpha1/types_cluster_monitoring.go b/config/v1alpha1/types_cluster_monitoring.go index ce122ab314c..d204f41734f 100644 --- a/config/v1alpha1/types_cluster_monitoring.go +++ b/config/v1alpha1/types_cluster_monitoring.go @@ -794,21 +794,6 @@ type AlertmanagerConfig struct { // When set to CustomConfig, the Alertmanager will be deployed with custom configuration. // +optional CustomConfig AlertmanagerCustomConfig `json:"customConfig,omitempty,omitzero"` - // userAlertmanagerConfigSelection is an optional field that controls whether user-defined - // namespaces can be selected for AlertmanagerConfig lookups on the platform Alertmanager - // instance in the `openshift-monitoring` namespace. - // Valid values are Selectable and None. - // When set to Selectable, the platform Alertmanager discovers AlertmanagerConfig resources - // in user-defined namespaces. This is equivalent to `enableUserAlertmanagerConfig: true` in - // the cluster-monitoring-config ConfigMap. - // When set to None, user-defined namespaces are not selected for AlertmanagerConfig lookups - // on the platform Alertmanager. This is equivalent to `enableUserAlertmanagerConfig: false` - // in the cluster-monitoring-config ConfigMap. - // This setting only applies when the user-workload monitoring Alertmanager is not enabled. - // When omitted, the default value is None. - // +optional - // +kubebuilder:validation:Enum=Selectable;None - UserAlertmanagerConfigSelection UserAlertmanagerConfigSelection `json:"userAlertmanagerConfigSelection,omitempty"` } // UserAlertmanagerConfigSelection controls whether the platform Alertmanager selects @@ -828,9 +813,25 @@ const ( // AlertmanagerCustomConfig represents the configuration for a custom Alertmanager deployment. // alertmanagerCustomConfig provides configuration options for the default Alertmanager instance // that runs in the `openshift-monitoring` namespace. Use this configuration to control -// whether the default Alertmanager is deployed, how it logs, and how its pods are scheduled. +// whether user-defined namespaces are selected for AlertmanagerConfig lookups, how it logs, +// and how its pods are scheduled. // +kubebuilder:validation:MinProperties=1 type AlertmanagerCustomConfig struct { + // userAlertmanagerConfigSelection is an optional field that controls whether user-defined + // namespaces can be selected for AlertmanagerConfig lookups on the platform Alertmanager + // instance in the `openshift-monitoring` namespace. + // Valid values are Selectable and None. + // When set to Selectable, the platform Alertmanager discovers AlertmanagerConfig resources + // in user-defined namespaces. This is equivalent to `enableUserAlertmanagerConfig: true` in + // the cluster-monitoring-config ConfigMap. + // When set to None, user-defined namespaces are not selected for AlertmanagerConfig lookups + // on the platform Alertmanager. This is equivalent to `enableUserAlertmanagerConfig: false` + // in the cluster-monitoring-config ConfigMap. + // This setting only applies when the user-workload monitoring Alertmanager is not enabled. + // When omitted, the default value is None. + // +optional + // +kubebuilder:validation:Enum=Selectable;None + UserAlertmanagerConfigSelection UserAlertmanagerConfigSelection `json:"userAlertmanagerConfigSelection,omitempty"` // logLevel defines the verbosity of logs emitted by Alertmanager. // This field allows users to control the amount and severity of logs generated, which can be useful // for debugging issues or reducing noise in production environments. 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 89723cfc46b..ecc5524440b 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 @@ -453,6 +453,24 @@ spec: - topologyKey - whenUnsatisfiable x-kubernetes-list-type: map + userAlertmanagerConfigSelection: + description: |- + userAlertmanagerConfigSelection is an optional field that controls whether user-defined + namespaces can be selected for AlertmanagerConfig lookups on the platform Alertmanager + instance in the `openshift-monitoring` namespace. + Valid values are Selectable and None. + When set to Selectable, the platform Alertmanager discovers AlertmanagerConfig resources + in user-defined namespaces. This is equivalent to `enableUserAlertmanagerConfig: true` in + the cluster-monitoring-config ConfigMap. + When set to None, user-defined namespaces are not selected for AlertmanagerConfig lookups + on the platform Alertmanager. This is equivalent to `enableUserAlertmanagerConfig: false` + in the cluster-monitoring-config ConfigMap. + This setting only applies when the user-workload monitoring Alertmanager is not enabled. + When omitted, the default value is None. + enum: + - Selectable + - None + type: string volumeClaimTemplate: description: |- volumeClaimTemplate defines persistent storage for Alertmanager. Use this setting to @@ -888,24 +906,6 @@ spec: - DefaultConfig - CustomConfig type: string - userAlertmanagerConfigSelection: - description: |- - userAlertmanagerConfigSelection is an optional field that controls whether user-defined - namespaces can be selected for AlertmanagerConfig lookups on the platform Alertmanager - instance in the `openshift-monitoring` namespace. - Valid values are Selectable and None. - When set to Selectable, the platform Alertmanager discovers AlertmanagerConfig resources - in user-defined namespaces. This is equivalent to `enableUserAlertmanagerConfig: true` in - the cluster-monitoring-config ConfigMap. - When set to None, user-defined namespaces are not selected for AlertmanagerConfig lookups - on the platform Alertmanager. This is equivalent to `enableUserAlertmanagerConfig: false` - in the cluster-monitoring-config ConfigMap. - This setting only applies when the user-workload monitoring Alertmanager is not enabled. - When omitted, the default value is None. - enum: - - Selectable - - None - type: string required: - deploymentMode type: object 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 5d22b8514e3..bd04d04f20a 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 @@ -453,6 +453,24 @@ spec: - topologyKey - whenUnsatisfiable x-kubernetes-list-type: map + userAlertmanagerConfigSelection: + description: |- + userAlertmanagerConfigSelection is an optional field that controls whether user-defined + namespaces can be selected for AlertmanagerConfig lookups on the platform Alertmanager + instance in the `openshift-monitoring` namespace. + Valid values are Selectable and None. + When set to Selectable, the platform Alertmanager discovers AlertmanagerConfig resources + in user-defined namespaces. This is equivalent to `enableUserAlertmanagerConfig: true` in + the cluster-monitoring-config ConfigMap. + When set to None, user-defined namespaces are not selected for AlertmanagerConfig lookups + on the platform Alertmanager. This is equivalent to `enableUserAlertmanagerConfig: false` + in the cluster-monitoring-config ConfigMap. + This setting only applies when the user-workload monitoring Alertmanager is not enabled. + When omitted, the default value is None. + enum: + - Selectable + - None + type: string volumeClaimTemplate: description: |- volumeClaimTemplate defines persistent storage for Alertmanager. Use this setting to @@ -888,24 +906,6 @@ spec: - DefaultConfig - CustomConfig type: string - userAlertmanagerConfigSelection: - description: |- - userAlertmanagerConfigSelection is an optional field that controls whether user-defined - namespaces can be selected for AlertmanagerConfig lookups on the platform Alertmanager - instance in the `openshift-monitoring` namespace. - Valid values are Selectable and None. - When set to Selectable, the platform Alertmanager discovers AlertmanagerConfig resources - in user-defined namespaces. This is equivalent to `enableUserAlertmanagerConfig: true` in - the cluster-monitoring-config ConfigMap. - When set to None, user-defined namespaces are not selected for AlertmanagerConfig lookups - on the platform Alertmanager. This is equivalent to `enableUserAlertmanagerConfig: false` - in the cluster-monitoring-config ConfigMap. - This setting only applies when the user-workload monitoring Alertmanager is not enabled. - When omitted, the default value is None. - enum: - - Selectable - - None - type: string required: - deploymentMode type: object diff --git a/config/v1alpha1/zz_generated.swagger_doc_generated.go b/config/v1alpha1/zz_generated.swagger_doc_generated.go index bd2e9b7e590..b7b3562e813 100644 --- a/config/v1alpha1/zz_generated.swagger_doc_generated.go +++ b/config/v1alpha1/zz_generated.swagger_doc_generated.go @@ -96,10 +96,9 @@ func (AdditionalAlertmanagerConfig) SwaggerDoc() map[string]string { } var map_AlertmanagerConfig = map[string]string{ - "": "alertmanagerConfig provides configuration options for the default Alertmanager instance that runs in the `openshift-monitoring` namespace. Use this configuration to control whether the default Alertmanager is deployed, how it logs, and how its pods are scheduled.", - "deploymentMode": "deploymentMode determines whether the default Alertmanager instance should be deployed as part of the monitoring stack. Allowed values are Disabled, DefaultConfig, and CustomConfig. When set to Disabled, the Alertmanager instance will not be deployed. When set to DefaultConfig, the platform will deploy Alertmanager with default settings. When set to CustomConfig, the Alertmanager will be deployed with custom configuration.", - "customConfig": "customConfig must be set when deploymentMode is CustomConfig, and must be unset otherwise. When set to CustomConfig, the Alertmanager will be deployed with custom configuration.", - "userAlertmanagerConfigSelection": "userAlertmanagerConfigSelection is an optional field that controls whether user-defined namespaces can be selected for AlertmanagerConfig lookups on the platform Alertmanager instance in the `openshift-monitoring` namespace. Valid values are Selectable and None. When set to Selectable, the platform Alertmanager discovers AlertmanagerConfig resources in user-defined namespaces. This is equivalent to `enableUserAlertmanagerConfig: true` in the cluster-monitoring-config ConfigMap. When set to None, user-defined namespaces are not selected for AlertmanagerConfig lookups on the platform Alertmanager. This is equivalent to `enableUserAlertmanagerConfig: false` in the cluster-monitoring-config ConfigMap. This setting only applies when the user-workload monitoring Alertmanager is not enabled. When omitted, the default value is None.", + "": "alertmanagerConfig provides configuration options for the default Alertmanager instance that runs in the `openshift-monitoring` namespace. Use this configuration to control whether the default Alertmanager is deployed, how it logs, and how its pods are scheduled.", + "deploymentMode": "deploymentMode determines whether the default Alertmanager instance should be deployed as part of the monitoring stack. Allowed values are Disabled, DefaultConfig, and CustomConfig. When set to Disabled, the Alertmanager instance will not be deployed. When set to DefaultConfig, the platform will deploy Alertmanager with default settings. When set to CustomConfig, the Alertmanager will be deployed with custom configuration.", + "customConfig": "customConfig must be set when deploymentMode is CustomConfig, and must be unset otherwise. When set to CustomConfig, the Alertmanager will be deployed with custom configuration.", } func (AlertmanagerConfig) SwaggerDoc() map[string]string { @@ -107,14 +106,15 @@ func (AlertmanagerConfig) SwaggerDoc() map[string]string { } var map_AlertmanagerCustomConfig = map[string]string{ - "": "AlertmanagerCustomConfig represents the configuration for a custom Alertmanager deployment. alertmanagerCustomConfig provides configuration options for the default Alertmanager instance that runs in the `openshift-monitoring` namespace. Use this configuration to control whether the default Alertmanager is deployed, how it logs, and how its pods are scheduled.", - "logLevel": "logLevel defines the verbosity of logs emitted by Alertmanager. This field allows users to control the amount and severity of logs generated, which can be useful for debugging issues or reducing noise in production environments. 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`.", - "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`.", - "resources": "resources defines the compute resource requests and limits for the Alertmanager container. This includes CPU, memory and HugePages constraints to help control scheduling and resource usage. When not specified, defaults are used by the platform. Requests cannot exceed limits. This field is optional. 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: 4m\n limit: null\n - name: memory\n request: 40Mi\n limit: null\nMaximum length for this list is 5. Minimum length for this list is 1. Each resource name must be unique within this list.", - "secrets": "secrets defines a list of secrets that need to be mounted into the Alertmanager. The secrets must reside within the same namespace as the Alertmanager object. They will be added as volumes named secret- and mounted at /etc/alertmanager/secrets/ within the 'alertmanager' container of the Alertmanager Pods.\n\nThese secrets can be used to authenticate Alertmanager with endpoint receivers. For example, you can use secrets to: - Provide certificates for TLS authentication with receivers that require private CA certificates - Store credentials for Basic HTTP authentication with receivers that require password-based auth - Store any other authentication credentials needed by your alert receivers\n\nThis field is optional. Maximum length for this list is 10. Minimum length for this list is 1. Entries in this list must be unique.", - "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.", - "topologySpreadConstraints": "topologySpreadConstraints defines rules for how Alertmanager Pods should be distributed across topology domains such as zones, nodes, or other user-defined labels. topologySpreadConstraints is optional. This helps improve high availability and resource efficiency by avoiding placing too many replicas in the same failure domain.\n\nWhen omitted, this means no opinion and the platform is left to choose a default, which is subject to change over time. This field maps directly to the `topologySpreadConstraints` field in the Pod spec. Default is empty list. Maximum length for this list is 10. Minimum length for this list is 1. Entries must have unique topologyKey and whenUnsatisfiable pairs.", - "volumeClaimTemplate": "volumeClaimTemplate defines persistent storage for Alertmanager. Use this setting to configure the persistent volume claim, including storage class and volume size. If omitted, the Pod uses ephemeral storage and alert data will not persist across restarts.", + "": "AlertmanagerCustomConfig represents the configuration for a custom Alertmanager deployment. alertmanagerCustomConfig provides configuration options for the default Alertmanager instance that runs in the `openshift-monitoring` namespace. Use this configuration to control whether user-defined namespaces are selected for AlertmanagerConfig lookups, how it logs, and how its pods are scheduled.", + "userAlertmanagerConfigSelection": "userAlertmanagerConfigSelection is an optional field that controls whether user-defined namespaces can be selected for AlertmanagerConfig lookups on the platform Alertmanager instance in the `openshift-monitoring` namespace. Valid values are Selectable and None. When set to Selectable, the platform Alertmanager discovers AlertmanagerConfig resources in user-defined namespaces. This is equivalent to `enableUserAlertmanagerConfig: true` in the cluster-monitoring-config ConfigMap. When set to None, user-defined namespaces are not selected for AlertmanagerConfig lookups on the platform Alertmanager. This is equivalent to `enableUserAlertmanagerConfig: false` in the cluster-monitoring-config ConfigMap. This setting only applies when the user-workload monitoring Alertmanager is not enabled. When omitted, the default value is None.", + "logLevel": "logLevel defines the verbosity of logs emitted by Alertmanager. This field allows users to control the amount and severity of logs generated, which can be useful for debugging issues or reducing noise in production environments. 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`.", + "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`.", + "resources": "resources defines the compute resource requests and limits for the Alertmanager container. This includes CPU, memory and HugePages constraints to help control scheduling and resource usage. When not specified, defaults are used by the platform. Requests cannot exceed limits. This field is optional. 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: 4m\n limit: null\n - name: memory\n request: 40Mi\n limit: null\nMaximum length for this list is 5. Minimum length for this list is 1. Each resource name must be unique within this list.", + "secrets": "secrets defines a list of secrets that need to be mounted into the Alertmanager. The secrets must reside within the same namespace as the Alertmanager object. They will be added as volumes named secret- and mounted at /etc/alertmanager/secrets/ within the 'alertmanager' container of the Alertmanager Pods.\n\nThese secrets can be used to authenticate Alertmanager with endpoint receivers. For example, you can use secrets to: - Provide certificates for TLS authentication with receivers that require private CA certificates - Store credentials for Basic HTTP authentication with receivers that require password-based auth - Store any other authentication credentials needed by your alert receivers\n\nThis field is optional. Maximum length for this list is 10. Minimum length for this list is 1. Entries in this list must be unique.", + "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.", + "topologySpreadConstraints": "topologySpreadConstraints defines rules for how Alertmanager Pods should be distributed across topology domains such as zones, nodes, or other user-defined labels. topologySpreadConstraints is optional. This helps improve high availability and resource efficiency by avoiding placing too many replicas in the same failure domain.\n\nWhen omitted, this means no opinion and the platform is left to choose a default, which is subject to change over time. This field maps directly to the `topologySpreadConstraints` field in the Pod spec. Default is empty list. Maximum length for this list is 10. Minimum length for this list is 1. Entries must have unique topologyKey and whenUnsatisfiable pairs.", + "volumeClaimTemplate": "volumeClaimTemplate defines persistent storage for Alertmanager. Use this setting to configure the persistent volume claim, including storage class and volume size. If omitted, the Pod uses ephemeral storage and alert data will not persist across restarts.", } func (AlertmanagerCustomConfig) SwaggerDoc() map[string]string { diff --git a/openapi/generated_openapi/zz_generated.openapi.go b/openapi/generated_openapi/zz_generated.openapi.go index 58cae551478..26139463b91 100644 --- a/openapi/generated_openapi/zz_generated.openapi.go +++ b/openapi/generated_openapi/zz_generated.openapi.go @@ -22724,14 +22724,6 @@ func schema_openshift_api_config_v1alpha1_AlertmanagerConfig(ref common.Referenc Ref: ref("github.com/openshift/api/config/v1alpha1.AlertmanagerCustomConfig"), }, }, - "userAlertmanagerConfigSelection": { - SchemaProps: spec.SchemaProps{ - Description: "userAlertmanagerConfigSelection is an optional field that controls whether user-defined namespaces can be selected for AlertmanagerConfig lookups on the platform Alertmanager instance in the `openshift-monitoring` namespace. Valid values are Selectable and None. When set to Selectable, the platform Alertmanager discovers AlertmanagerConfig resources in user-defined namespaces. This is equivalent to `enableUserAlertmanagerConfig: true` in the cluster-monitoring-config ConfigMap. When set to None, user-defined namespaces are not selected for AlertmanagerConfig lookups on the platform Alertmanager. This is equivalent to `enableUserAlertmanagerConfig: false` in the cluster-monitoring-config ConfigMap. This setting only applies when the user-workload monitoring Alertmanager is not enabled. When omitted, the default value is None.\n\nPossible enum values:\n - `\"None\"` disables user-defined namespaces from being selected for AlertmanagerConfig lookups on the platform Alertmanager.\n - `\"Selectable\"` enables user-defined namespaces to be selected for AlertmanagerConfig lookups on the platform Alertmanager.", - Type: []string{"string"}, - Format: "", - Enum: []interface{}{"None", "Selectable"}, - }, - }, }, Required: []string{"deploymentMode"}, }, @@ -22745,9 +22737,17 @@ func schema_openshift_api_config_v1alpha1_AlertmanagerCustomConfig(ref common.Re return common.OpenAPIDefinition{ Schema: spec.Schema{ SchemaProps: spec.SchemaProps{ - Description: "AlertmanagerCustomConfig represents the configuration for a custom Alertmanager deployment. alertmanagerCustomConfig provides configuration options for the default Alertmanager instance that runs in the `openshift-monitoring` namespace. Use this configuration to control whether the default Alertmanager is deployed, how it logs, and how its pods are scheduled.", + Description: "AlertmanagerCustomConfig represents the configuration for a custom Alertmanager deployment. alertmanagerCustomConfig provides configuration options for the default Alertmanager instance that runs in the `openshift-monitoring` namespace. Use this configuration to control whether user-defined namespaces are selected for AlertmanagerConfig lookups, how it logs, and how its pods are scheduled.", Type: []string{"object"}, Properties: map[string]spec.Schema{ + "userAlertmanagerConfigSelection": { + SchemaProps: spec.SchemaProps{ + Description: "userAlertmanagerConfigSelection is an optional field that controls whether user-defined namespaces can be selected for AlertmanagerConfig lookups on the platform Alertmanager instance in the `openshift-monitoring` namespace. Valid values are Selectable and None. When set to Selectable, the platform Alertmanager discovers AlertmanagerConfig resources in user-defined namespaces. This is equivalent to `enableUserAlertmanagerConfig: true` in the cluster-monitoring-config ConfigMap. When set to None, user-defined namespaces are not selected for AlertmanagerConfig lookups on the platform Alertmanager. This is equivalent to `enableUserAlertmanagerConfig: false` in the cluster-monitoring-config ConfigMap. This setting only applies when the user-workload monitoring Alertmanager is not enabled. When omitted, the default value is None.\n\nPossible enum values:\n - `\"None\"` disables user-defined namespaces from being selected for AlertmanagerConfig lookups on the platform Alertmanager.\n - `\"Selectable\"` enables user-defined namespaces to be selected for AlertmanagerConfig lookups on the platform Alertmanager.", + Type: []string{"string"}, + Format: "", + Enum: []interface{}{"None", "Selectable"}, + }, + }, "logLevel": { SchemaProps: spec.SchemaProps{ Description: "logLevel defines the verbosity of logs emitted by Alertmanager. This field allows users to control the amount and severity of logs generated, which can be useful for debugging issues or reducing noise in production environments. 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`.", diff --git a/openapi/openapi.json b/openapi/openapi.json index 25177079a67..ac92ec341dd 100644 --- a/openapi/openapi.json +++ b/openapi/openapi.json @@ -23912,19 +23912,11 @@ "deploymentMode": { "description": "deploymentMode determines whether the default Alertmanager instance should be deployed as part of the monitoring stack. Allowed values are Disabled, DefaultConfig, and CustomConfig. When set to Disabled, the Alertmanager instance will not be deployed. When set to DefaultConfig, the platform will deploy Alertmanager with default settings. When set to CustomConfig, the Alertmanager will be deployed with custom configuration.", "type": "string" - }, - "userAlertmanagerConfigSelection": { - "description": "userAlertmanagerConfigSelection is an optional field that controls whether user-defined namespaces can be selected for AlertmanagerConfig lookups on the platform Alertmanager instance in the `openshift-monitoring` namespace. Valid values are Selectable and None. When set to Selectable, the platform Alertmanager discovers AlertmanagerConfig resources in user-defined namespaces. This is equivalent to `enableUserAlertmanagerConfig: true` in the cluster-monitoring-config ConfigMap. When set to None, user-defined namespaces are not selected for AlertmanagerConfig lookups on the platform Alertmanager. This is equivalent to `enableUserAlertmanagerConfig: false` in the cluster-monitoring-config ConfigMap. This setting only applies when the user-workload monitoring Alertmanager is not enabled. When omitted, the default value is None.\n\nPossible enum values:\n - `\"None\"` disables user-defined namespaces from being selected for AlertmanagerConfig lookups on the platform Alertmanager.\n - `\"Selectable\"` enables user-defined namespaces to be selected for AlertmanagerConfig lookups on the platform Alertmanager.", - "type": "string", - "enum": [ - "None", - "Selectable" - ] } } }, "com.github.openshift.api.config.v1alpha1.AlertmanagerCustomConfig": { - "description": "AlertmanagerCustomConfig represents the configuration for a custom Alertmanager deployment. alertmanagerCustomConfig provides configuration options for the default Alertmanager instance that runs in the `openshift-monitoring` namespace. Use this configuration to control whether the default Alertmanager is deployed, how it logs, and how its pods are scheduled.", + "description": "AlertmanagerCustomConfig represents the configuration for a custom Alertmanager deployment. alertmanagerCustomConfig provides configuration options for the default Alertmanager instance that runs in the `openshift-monitoring` namespace. Use this configuration to control whether user-defined namespaces are selected for AlertmanagerConfig lookups, how it logs, and how its pods are scheduled.", "type": "object", "properties": { "logLevel": { @@ -23982,6 +23974,14 @@ ], "x-kubernetes-list-type": "map" }, + "userAlertmanagerConfigSelection": { + "description": "userAlertmanagerConfigSelection is an optional field that controls whether user-defined namespaces can be selected for AlertmanagerConfig lookups on the platform Alertmanager instance in the `openshift-monitoring` namespace. Valid values are Selectable and None. When set to Selectable, the platform Alertmanager discovers AlertmanagerConfig resources in user-defined namespaces. This is equivalent to `enableUserAlertmanagerConfig: true` in the cluster-monitoring-config ConfigMap. When set to None, user-defined namespaces are not selected for AlertmanagerConfig lookups on the platform Alertmanager. This is equivalent to `enableUserAlertmanagerConfig: false` in the cluster-monitoring-config ConfigMap. This setting only applies when the user-workload monitoring Alertmanager is not enabled. When omitted, the default value is None.\n\nPossible enum values:\n - `\"None\"` disables user-defined namespaces from being selected for AlertmanagerConfig lookups on the platform Alertmanager.\n - `\"Selectable\"` enables user-defined namespaces to be selected for AlertmanagerConfig lookups on the platform Alertmanager.", + "type": "string", + "enum": [ + "None", + "Selectable" + ] + }, "volumeClaimTemplate": { "description": "volumeClaimTemplate defines persistent storage for Alertmanager. Use this setting to configure the persistent volume claim, including storage class and volume size. If omitted, the Pod uses ephemeral storage and alert data will not persist across restarts.", "$ref": "#/definitions/PersistentVolumeClaim.v1.core.api.k8s.io" 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 89723cfc46b..ecc5524440b 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 @@ -453,6 +453,24 @@ spec: - topologyKey - whenUnsatisfiable x-kubernetes-list-type: map + userAlertmanagerConfigSelection: + description: |- + userAlertmanagerConfigSelection is an optional field that controls whether user-defined + namespaces can be selected for AlertmanagerConfig lookups on the platform Alertmanager + instance in the `openshift-monitoring` namespace. + Valid values are Selectable and None. + When set to Selectable, the platform Alertmanager discovers AlertmanagerConfig resources + in user-defined namespaces. This is equivalent to `enableUserAlertmanagerConfig: true` in + the cluster-monitoring-config ConfigMap. + When set to None, user-defined namespaces are not selected for AlertmanagerConfig lookups + on the platform Alertmanager. This is equivalent to `enableUserAlertmanagerConfig: false` + in the cluster-monitoring-config ConfigMap. + This setting only applies when the user-workload monitoring Alertmanager is not enabled. + When omitted, the default value is None. + enum: + - Selectable + - None + type: string volumeClaimTemplate: description: |- volumeClaimTemplate defines persistent storage for Alertmanager. Use this setting to @@ -888,24 +906,6 @@ spec: - DefaultConfig - CustomConfig type: string - userAlertmanagerConfigSelection: - description: |- - userAlertmanagerConfigSelection is an optional field that controls whether user-defined - namespaces can be selected for AlertmanagerConfig lookups on the platform Alertmanager - instance in the `openshift-monitoring` namespace. - Valid values are Selectable and None. - When set to Selectable, the platform Alertmanager discovers AlertmanagerConfig resources - in user-defined namespaces. This is equivalent to `enableUserAlertmanagerConfig: true` in - the cluster-monitoring-config ConfigMap. - When set to None, user-defined namespaces are not selected for AlertmanagerConfig lookups - on the platform Alertmanager. This is equivalent to `enableUserAlertmanagerConfig: false` - in the cluster-monitoring-config ConfigMap. - This setting only applies when the user-workload monitoring Alertmanager is not enabled. - When omitted, the default value is None. - enum: - - Selectable - - None - type: string required: - deploymentMode type: object