diff --git a/bundle/manifests/prometheus-k8s_rbac.authorization.k8s.io_v1_role.yaml b/bundle/manifests/prometheus-k8s_rbac.authorization.k8s.io_v1_role.yaml index 9f5a7a5b92..d8ceead69e 100644 --- a/bundle/manifests/prometheus-k8s_rbac.authorization.k8s.io_v1_role.yaml +++ b/bundle/manifests/prometheus-k8s_rbac.authorization.k8s.io_v1_role.yaml @@ -13,3 +13,11 @@ rules: verbs: - list - watch +- apiGroups: + - "discovery.k8s.io" + resources: + - endpointslices + verbs: + - get + - list + - watch diff --git a/config/windows-exporter/windows-exporter-role.yaml b/config/windows-exporter/windows-exporter-role.yaml index c20bd9bb74..d2d71b0e5d 100644 --- a/config/windows-exporter/windows-exporter-role.yaml +++ b/config/windows-exporter/windows-exporter-role.yaml @@ -13,3 +13,11 @@ rules: verbs: - list - watch + - apiGroups: + - "discovery.k8s.io" + resources: + - endpointslices + verbs: + - get + - list + - watch diff --git a/controllers/metric_controller.go b/controllers/metric_controller.go index 4acc3130b0..be2620c904 100644 --- a/controllers/metric_controller.go +++ b/controllers/metric_controller.go @@ -132,6 +132,7 @@ func (r *metricReconciler) ensureServiceMonitor(ctx context.Context) error { replacement1 := "$1:9182" replacement2 := metrics.WindowsMetricsResource attachMetadataBool := true + endpointSliceRole := monv1.EndpointSliceRole expectedSM := &monv1.ServiceMonitor{ ObjectMeta: metav1.ObjectMeta{ Name: metrics.WindowsMetricsResource, @@ -141,6 +142,7 @@ func (r *metricReconciler) ensureServiceMonitor(ctx context.Context) error { }, }, Spec: monv1.ServiceMonitorSpec{ + ServiceDiscoveryRole: &endpointSliceRole, AttachMetadata: &monv1.AttachMetadata{ Node: &attachMetadataBool, }, @@ -165,7 +167,7 @@ func (r *metricReconciler) ensureServiceMonitor(ctx context.Context) error { Replacement: &replacement0, TargetLabel: "instance", SourceLabels: []monv1.LabelName{ - "__meta_kubernetes_endpoint_address_target_name", + "__meta_kubernetes_endpointslice_endpoint_target_name", }, }, { // Include only Windows nodes for this serviceMonitor diff --git a/go.mod b/go.mod index 53461506af..c1ab182e03 100644 --- a/go.mod +++ b/go.mod @@ -23,8 +23,8 @@ require ( github.com/operator-framework/operator-lib v0.4.0 github.com/operator-framework/operator-lifecycle-manager v0.22.0 github.com/pkg/sftp v1.13.10 - github.com/prometheus-operator/prometheus-operator/pkg/apis/monitoring v0.85.0 - github.com/prometheus-operator/prometheus-operator/pkg/client v0.85.0 + github.com/prometheus-operator/prometheus-operator/pkg/apis/monitoring v0.86.2 + github.com/prometheus-operator/prometheus-operator/pkg/client v0.86.2 github.com/spf13/cobra v1.10.1 github.com/spf13/pflag v1.0.10 github.com/stretchr/testify v1.11.1 diff --git a/go.sum b/go.sum index dcf173d785..29aeaa9ba0 100644 --- a/go.sum +++ b/go.sum @@ -544,10 +544,10 @@ github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 h1:Jamvg5psRI github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/posener/complete v1.1.1/go.mod h1:em0nMJCgc9GFtwrmVmEMR/ZL6WyhyjMBndrE9hABlRI= github.com/pquerna/cachecontrol v0.0.0-20171018203845-0dec1b30a021/go.mod h1:prYjPmNq4d1NPVmpShWobRqXY3q7Vp+80DqgxxUrUIA= -github.com/prometheus-operator/prometheus-operator/pkg/apis/monitoring v0.85.0 h1:oY+F5FZFmCjCyzkHWPjVQpzvnvEB/0FP+iyzDUUlqFc= -github.com/prometheus-operator/prometheus-operator/pkg/apis/monitoring v0.85.0/go.mod h1:VB7wtBmDT6W2RJHzsvPZlBId+EnmeQA0d33fFTXvraM= -github.com/prometheus-operator/prometheus-operator/pkg/client v0.85.0 h1:OdW3Vnmoa2pM5PfRyQaSEO+UN5yamEUS1MuhwE0PxbY= -github.com/prometheus-operator/prometheus-operator/pkg/client v0.85.0/go.mod h1:5ctipSFkXKeXig01Or0aXKNaaBQFWZAAK1zzYWz9YZY= +github.com/prometheus-operator/prometheus-operator/pkg/apis/monitoring v0.86.2 h1:VRXUgbGmpmjZgFYiUnTwlC+JjfCUs5KKFsorJhI1ZKQ= +github.com/prometheus-operator/prometheus-operator/pkg/apis/monitoring v0.86.2/go.mod h1:nPk0OteXBkbT0CRCa2oZQL1jRLW6RJ2fuIijHypeJdk= +github.com/prometheus-operator/prometheus-operator/pkg/client v0.86.2 h1:aD+r5a/96ZVT11Uo6Jpt3gO2Hutq3NROB8lXYKMZlOI= +github.com/prometheus-operator/prometheus-operator/pkg/client v0.86.2/go.mod h1:fXZB2vXirMxIjFEIggDrFirYJQh7GkHCZRwm8aKD0e8= github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw= github.com/prometheus/client_golang v0.9.3/go.mod h1:/TN21ttK/J9q6uSwhBd54HahCDft0ttaMvbicHlPoso= github.com/prometheus/client_golang v1.0.0/go.mod h1:db9x61etRT2tGnBNRi70OPL5FsnadC4Ky3P0J6CfImo= diff --git a/test/e2e/delete_test.go b/test/e2e/delete_test.go index 620a968da1..56b2af78fd 100644 --- a/test/e2e/delete_test.go +++ b/test/e2e/delete_test.go @@ -273,8 +273,9 @@ func (tc *testContext) testWindowsNodeDeletion(t *testing.T) { _, err = tc.waitForWindowsMachines(int(expectedNodeCount), "", true) require.NoError(t, err, "ConfigMap controller Windows machine deletion failed") - // Test if prometheus configuration is updated to have no node entries in the endpoints object + // Test if prometheus configuration is updated to have no node entries in the endpointslice objects. t.Run("Prometheus configuration", tc.testPrometheus) + t.Run("Prometheus endpoint slice cleanup", tc.testPrometheusEndpointSliceCleanup) // Cleanup windows-instances ConfigMap tc.deleteWindowsInstanceConfigMap() diff --git a/test/e2e/metrics_test.go b/test/e2e/metrics_test.go index 249451f647..55e91e5fc8 100644 --- a/test/e2e/metrics_test.go +++ b/test/e2e/metrics_test.go @@ -82,6 +82,41 @@ func (tc *testContext) testPrometheus(t *testing.T) { } +// testPrometheusEndpointSliceCleanup verifies that no Windows nodes remain in kubelet EndpointSlices +func (tc *testContext) testPrometheusEndpointSliceCleanup(t *testing.T) { + // List all EndpointSlices for the kubelet service in kube-system namespace + endpointSlices, err := tc.client.K8s.DiscoveryV1().EndpointSlices("kube-system").List( + context.TODO(), + metav1.ListOptions{ + LabelSelector: "kubernetes.io/service-name=kubelet", + }, + ) + require.NoError(t, err, "error listing EndpointSlices for kubelet service") + + // Verify that no Windows node addresses appear in any EndpointSlice + var foundWindowsNodes []string + for _, slice := range endpointSlices.Items { + for _, endpoint := range slice.Endpoints { + // Check if this endpoint references a node + if endpoint.TargetRef == nil || endpoint.TargetRef.Kind != "Node" { + continue + } + // Try to get the node to check its OS + node, err := tc.client.K8s.CoreV1().Nodes().Get(context.Background(), + endpoint.TargetRef.Name, metav1.GetOptions{}) + require.NoError(t, err, "node %s referenced in EndpointSlice not found - EndpointSlice not synced properly", + endpoint.TargetRef.Name) + // Check if this is a Windows node + if nodeOS, exists := node.Labels["kubernetes.io/os"]; exists && nodeOS == "windows" { + foundWindowsNodes = append(foundWindowsNodes, node.Name) + } + } + } + + require.Empty(t, foundWindowsNodes, + "Found Windows nodes in kubelet EndpointSlices after deletion: %v", foundWindowsNodes) +} + // PrometheusQuery defines the result of the /query request // Example Reference of Prometheus Query Response: https://prometheus.io/docs/prometheus/latest/querying/api/ type PrometheusQuery struct { @@ -239,9 +274,12 @@ func (tc *testContext) testPodMetrics(t *testing.T, podName string) { fmt.Sprintf("pod_interface_network:container_network_receive_bytes:irate5m{pod='%s',namespace='%s'}", podName, tc.workloadNamespace), fmt.Sprintf("pod_interface_network:container_network_transmit_bytes_total:irate5m{pod='%s',namespace='%s'}", podName, tc.workloadNamespace), } + // Use extended timeout to account for EndpointSlice propagation, metric scraping, + // and recording rule evaluation when using EndpointSlice-based service discovery + podMetricsTimeout := 5 * time.Minute for i, query := range queries { t.Run("query "+strconv.Itoa(i), func(t *testing.T) { - err := wait.PollUntilContextTimeout(context.TODO(), retry.Interval, retry.ResourceChangeTimeout, true, + err := wait.PollUntilContextTimeout(context.TODO(), retry.Interval, podMetricsTimeout, true, func(ctx context.Context) (done bool, err error) { results, err := makePrometheusQuery(prometheusRoute.Spec.Host, query, prometheusToken) if err != nil { diff --git a/vendor/github.com/prometheus-operator/prometheus-operator/pkg/apis/monitoring/resource.go b/vendor/github.com/prometheus-operator/prometheus-operator/pkg/apis/monitoring/resource.go index 25736ce920..e467c2bfa8 100644 --- a/vendor/github.com/prometheus-operator/prometheus-operator/pkg/apis/monitoring/resource.go +++ b/vendor/github.com/prometheus-operator/prometheus-operator/pkg/apis/monitoring/resource.go @@ -22,9 +22,15 @@ const ( PrometheusesKind = "Prometheus" PrometheusName = "prometheuses" + PrometheusAgentsKind = "PrometheusAgent" + PrometheusAgentName = "prometheusagents" + AlertmanagersKind = "Alertmanager" AlertmanagerName = "alertmanagers" + AlertmanagerConfigsKind = "AlertmanagerConfig" + AlertmanagerConfigName = "alertmanagerconfigs" + ServiceMonitorsKind = "ServiceMonitor" ServiceMonitorName = "servicemonitors" @@ -39,22 +45,51 @@ const ( ScrapeConfigsKind = "ScrapeConfig" ScrapeConfigName = "scrapeconfigs" + + ThanosRulersKind = "ThanosRuler" + ThanosRulerName = "thanosrulers" ) var resourceToKindMap = map[string]string{ - PrometheusName: PrometheusesKind, - AlertmanagerName: AlertmanagersKind, - ServiceMonitorName: ServiceMonitorsKind, - PodMonitorName: PodMonitorsKind, - PrometheusRuleName: PrometheusRuleKind, - ProbeName: ProbesKind, - ScrapeConfigName: ScrapeConfigsKind, + PrometheusName: PrometheusesKind, + PrometheusAgentName: PrometheusAgentsKind, + AlertmanagerName: AlertmanagersKind, + AlertmanagerConfigName: AlertmanagerConfigsKind, + ServiceMonitorName: ServiceMonitorsKind, + PodMonitorName: PodMonitorsKind, + PrometheusRuleName: PrometheusRuleKind, + ProbeName: ProbesKind, + ScrapeConfigName: ScrapeConfigsKind, + ThanosRulerName: ThanosRulersKind, +} + +var kindToResource = map[string]string{ + PrometheusesKind: PrometheusName, + PrometheusAgentsKind: PrometheusAgentName, + AlertmanagersKind: AlertmanagerName, + AlertmanagerConfigsKind: AlertmanagerConfigName, + ServiceMonitorsKind: ServiceMonitorName, + PodMonitorsKind: PodMonitorName, + PrometheusRuleKind: PrometheusRuleName, + ProbesKind: ProbeName, + ScrapeConfigsKind: ScrapeConfigName, + ThanosRulersKind: ThanosRulerName, +} + +// KindToResource returns the resource name corresponding to the given kind. +func KindToResource(k string) string { + kind, found := kindToResource[k] + if !found { + panic(fmt.Sprintf("failed to map kind %q to a resource name", k)) + } + return kind } -func ResourceToKind(s string) string { - kind, found := resourceToKindMap[s] +// ResourceToKind returns the kind corresponding to the given resource name. +func ResourceToKind(r string) string { + kind, found := resourceToKindMap[r] if !found { - panic(fmt.Sprintf("failed to map resource %q to a kind", s)) + panic(fmt.Sprintf("failed to map resource %q to a kind", r)) } return kind } diff --git a/vendor/github.com/prometheus-operator/prometheus-operator/pkg/apis/monitoring/v1/alertmanager_types.go b/vendor/github.com/prometheus-operator/prometheus-operator/pkg/apis/monitoring/v1/alertmanager_types.go index 1eb6b0227d..29de797287 100644 --- a/vendor/github.com/prometheus-operator/prometheus-operator/pkg/apis/monitoring/v1/alertmanager_types.go +++ b/vendor/github.com/prometheus-operator/prometheus-operator/pkg/apis/monitoring/v1/alertmanager_types.go @@ -48,14 +48,20 @@ const ( // // The resource defines via label and namespace selectors which `AlertmanagerConfig` objects should be associated to the deployed Alertmanager instances. type Alertmanager struct { - metav1.TypeMeta `json:",inline"` + // TypeMeta defines the versioned schema of this representation of an object. + // +optional + metav1.TypeMeta `json:",inline"` + // metadata defines ObjectMeta as the metadata that all persisted resources. + // +optional metav1.ObjectMeta `json:"metadata,omitempty"` - // Specification of the desired behavior of the Alertmanager cluster. More info: + // spec defines the specification of the desired behavior of the Alertmanager cluster. More info: // https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#spec-and-status + // +required Spec AlertmanagerSpec `json:"spec"` - // Most recent observed status of the Alertmanager cluster. Read-only. + // status defines the most recent observed status of the Alertmanager cluster. Read-only. // More info: // https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#spec-and-status + // +optional Status AlertmanagerStatus `json:"status,omitempty"` } @@ -68,7 +74,7 @@ func (l *Alertmanager) DeepCopyObject() runtime.Object { // https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#spec-and-status // +k8s:openapi-gen=true type AlertmanagerSpec struct { - // PodMetadata configures labels and annotations which are propagated to the Alertmanager pods. + // podMetadata defines labels and annotations which are propagated to the Alertmanager pods. // // The following items are reserved and cannot be overridden: // * "alertmanager" label, set to the name of the Alertmanager instance. @@ -77,45 +83,55 @@ type AlertmanagerSpec struct { // * "app.kubernetes.io/name" label, set to "alertmanager". // * "app.kubernetes.io/version" label, set to the Alertmanager version. // * "kubectl.kubernetes.io/default-container" annotation, set to "alertmanager". + // +optional PodMetadata *EmbeddedObjectMetadata `json:"podMetadata,omitempty"` - // Image if specified has precedence over baseImage, tag and sha + // image if specified has precedence over baseImage, tag and sha // combinations. Specifying the version is still necessary to ensure the // Prometheus Operator knows what version of Alertmanager is being // configured. + // +optional Image *string `json:"image,omitempty"` - // Image pull policy for the 'alertmanager', 'init-config-reloader' and 'config-reloader' containers. + // imagePullPolicy for the 'alertmanager', 'init-config-reloader' and 'config-reloader' containers. // See https://kubernetes.io/docs/concepts/containers/images/#image-pull-policy for more details. // +kubebuilder:validation:Enum="";Always;Never;IfNotPresent + // +optional ImagePullPolicy v1.PullPolicy `json:"imagePullPolicy,omitempty"` - // Version the cluster should be on. + // version the cluster should be on. + // +optional Version string `json:"version,omitempty"` - // Tag of Alertmanager container image to be deployed. Defaults to the value of `version`. + // tag of Alertmanager container image to be deployed. Defaults to the value of `version`. // Version is ignored if Tag is set. // Deprecated: use 'image' instead. The image tag can be specified as part of the image URL. + // +optional Tag string `json:"tag,omitempty"` - // SHA of Alertmanager container image to be deployed. Defaults to the value of `version`. + // sha of Alertmanager container image to be deployed. Defaults to the value of `version`. // Similar to a tag, but the SHA explicitly deploys an immutable container image. // Version and Tag are ignored if SHA is set. // Deprecated: use 'image' instead. The image digest can be specified as part of the image URL. + // +optional SHA string `json:"sha,omitempty"` - // Base image that is used to deploy pods, without tag. + // baseImage that is used to deploy pods, without tag. // Deprecated: use 'image' instead. + // +optional BaseImage string `json:"baseImage,omitempty"` - // An optional list of references to secrets in the same namespace + // imagePullSecrets An optional list of references to secrets in the same namespace // to use for pulling prometheus and alertmanager images from registries // see https://kubernetes.io/docs/tasks/configure-pod-container/pull-image-private-registry/ + // +optional ImagePullSecrets []v1.LocalObjectReference `json:"imagePullSecrets,omitempty"` - // Secrets is a list of Secrets in the same namespace as the Alertmanager + // secrets is a list of Secrets in the same namespace as the Alertmanager // object, which shall be mounted into the Alertmanager Pods. // Each Secret is added to the StatefulSet definition as a volume named `secret-`. // The Secrets are mounted into `/etc/alertmanager/secrets/` in the 'alertmanager' container. + // +optional Secrets []string `json:"secrets,omitempty"` - // ConfigMaps is a list of ConfigMaps in the same namespace as the Alertmanager + // configMaps defines a list of ConfigMaps in the same namespace as the Alertmanager // object, which shall be mounted into the Alertmanager Pods. // Each ConfigMap is added to the StatefulSet definition as a volume named `configmap-`. // The ConfigMaps are mounted into `/etc/alertmanager/configmaps/` in the 'alertmanager' container. + // +optional ConfigMaps []string `json:"configMaps,omitempty"` - // ConfigSecret is the name of a Kubernetes Secret in the same namespace as the + // configSecret defines the name of a Kubernetes Secret in the same namespace as the // Alertmanager object, which contains the configuration for this Alertmanager // instance. If empty, it defaults to `alertmanager-`. // @@ -127,91 +143,110 @@ type AlertmanagerSpec struct { // If either the secret or the `alertmanager.yaml` key is missing, the // operator provisions a minimal Alertmanager configuration with one empty // receiver (effectively dropping alert notifications). + // +optional ConfigSecret string `json:"configSecret,omitempty"` - // Log level for Alertmanager to be configured with. + // logLevel for Alertmanager to be configured with. // +kubebuilder:validation:Enum="";debug;info;warn;error + // +optional LogLevel string `json:"logLevel,omitempty"` - // Log format for Alertmanager to be configured with. + // logFormat for Alertmanager to be configured with. // +kubebuilder:validation:Enum="";logfmt;json + // +optional LogFormat string `json:"logFormat,omitempty"` - // Size is the expected size of the alertmanager cluster. The controller will + // replicas defines the expected size of the alertmanager cluster. The controller will // eventually make the size of the running cluster equal to the expected // size. + // +optional Replicas *int32 `json:"replicas,omitempty"` - // Time duration Alertmanager shall retain data for. Default is '120h', + // retention defines the time duration Alertmanager shall retain data for. Default is '120h', // and must match the regular expression `[0-9]+(ms|s|m|h)` (milliseconds seconds minutes hours). // +kubebuilder:default:="120h" + // +optional Retention GoDuration `json:"retention,omitempty"` - // Storage is the definition of how storage will be used by the Alertmanager + // storage defines the definition of how storage will be used by the Alertmanager // instances. + // +optional Storage *StorageSpec `json:"storage,omitempty"` - // Volumes allows configuration of additional volumes on the output StatefulSet definition. + // volumes allows configuration of additional volumes on the output StatefulSet definition. // Volumes specified will be appended to other volumes that are generated as a result of // StorageSpec objects. + // +optional Volumes []v1.Volume `json:"volumes,omitempty"` - // VolumeMounts allows configuration of additional VolumeMounts on the output StatefulSet definition. + // volumeMounts allows configuration of additional VolumeMounts on the output StatefulSet definition. // VolumeMounts specified will be appended to other VolumeMounts in the alertmanager container, // that are generated as a result of StorageSpec objects. + // +optional VolumeMounts []v1.VolumeMount `json:"volumeMounts,omitempty"` - // The field controls if and how PVCs are deleted during the lifecycle of a StatefulSet. + // persistentVolumeClaimRetentionPolicy controls if and how PVCs are deleted during the lifecycle of a StatefulSet. // The default behavior is all PVCs are retained. // This is an alpha field from kubernetes 1.23 until 1.26 and a beta field from 1.26. // It requires enabling the StatefulSetAutoDeletePVC feature gate. // // +optional PersistentVolumeClaimRetentionPolicy *appsv1.StatefulSetPersistentVolumeClaimRetentionPolicy `json:"persistentVolumeClaimRetentionPolicy,omitempty"` - // The external URL the Alertmanager instances will be available under. This is + // externalUrl defines the URL used to access the Alertmanager web service. This is // necessary to generate correct URLs. This is necessary if Alertmanager is not // served from root of a DNS name. + // +optional ExternalURL string `json:"externalUrl,omitempty"` - // The route prefix Alertmanager registers HTTP handlers for. This is useful, + // routePrefix Alertmanager registers HTTP handlers for. This is useful, // if using ExternalURL and a proxy is rewriting HTTP routes of a request, // and the actual ExternalURL is still true, but the server serves requests // under a different route prefix. For example for use with `kubectl proxy`. + // +optional RoutePrefix string `json:"routePrefix,omitempty"` - // If set to true all actions on the underlying managed objects are not + // paused if set to true all actions on the underlying managed objects are not // going to be performed, except for delete actions. + // +optional Paused bool `json:"paused,omitempty"` - // Define which Nodes the Pods are scheduled on. + // nodeSelector defines which Nodes the Pods are scheduled on. + // +optional NodeSelector map[string]string `json:"nodeSelector,omitempty"` - // Define resources requests and limits for single Pods. + // resources defines the resource requests and limits of the Pods. + // +optional Resources v1.ResourceRequirements `json:"resources,omitempty"` - // If specified, the pod's scheduling constraints. + // affinity defines the pod's scheduling constraints. + // +optional Affinity *v1.Affinity `json:"affinity,omitempty"` - // If specified, the pod's tolerations. + // tolerations defines the pod's tolerations. + // +optional Tolerations []v1.Toleration `json:"tolerations,omitempty"` - // If specified, the pod's topology spread constraints. + // topologySpreadConstraints defines the Pod's topology spread constraints. + // +optional TopologySpreadConstraints []v1.TopologySpreadConstraint `json:"topologySpreadConstraints,omitempty"` - // SecurityContext holds pod-level security attributes and common container settings. + // securityContext holds pod-level security attributes and common container settings. // This defaults to the default PodSecurityContext. + // +optional SecurityContext *v1.PodSecurityContext `json:"securityContext,omitempty"` - // Defines the DNS policy for the pods. + // dnsPolicy defines the DNS policy for the pods. // // +optional DNSPolicy *DNSPolicy `json:"dnsPolicy,omitempty"` - // Defines the DNS configuration for the pods. + // dnsConfig defines the DNS configuration for the pods. // // +optional DNSConfig *PodDNSConfig `json:"dnsConfig,omitempty"` - // Indicates whether information about services should be injected into pod's environment variables + // enableServiceLinks defines whether information about services should be injected into pod's environment variables // +optional EnableServiceLinks *bool `json:"enableServiceLinks,omitempty"` - // The name of the service name used by the underlying StatefulSet(s) as the governing service. + // serviceName defines the service name used by the underlying StatefulSet(s) as the governing service. // If defined, the Service must be created before the Alertmanager resource in the same namespace and it must define a selector that matches the pod labels. - // If empty, the operator will create and manage a headless service named `alertmanager-operated` for Alermanager resources. + // If empty, the operator will create and manage a headless service named `alertmanager-operated` for Alertmanager resources. // When deploying multiple Alertmanager resources in the same namespace, it is recommended to specify a different value for each. // See https://kubernetes.io/docs/concepts/workloads/controllers/statefulset/#stable-network-id for more details. // +optional // +kubebuilder:validation:MinLength=1 ServiceName *string `json:"serviceName,omitempty"` - // ServiceAccountName is the name of the ServiceAccount to use to run the + // serviceAccountName is the name of the ServiceAccount to use to run the // Prometheus Pods. + // +optional ServiceAccountName string `json:"serviceAccountName,omitempty"` - // ListenLocal makes the Alertmanager server listen on loopback, so that it + // listenLocal defines the Alertmanager server listen on loopback, so that it // does not bind against the Pod IP. Note this is only for the Alertmanager // UI, not the gossip communication. + // +optional ListenLocal bool `json:"listenLocal,omitempty"` - // Containers allows injecting additional containers. This is meant to + // containers allows injecting additional containers. This is meant to // allow adding an authentication proxy to an Alertmanager pod. // Containers described here modify an operator generated container if they // share the same name and modifications are done via a strategic merge @@ -219,8 +254,9 @@ type AlertmanagerSpec struct { // `config-reloader`. Overriding containers is entirely outside the scope // of what the maintainers will support and by doing so, you accept that // this behaviour may break at any time without notice. + // +optional Containers []v1.Container `json:"containers,omitempty"` - // InitContainers allows adding initContainers to the pod definition. Those can be used to e.g. + // initContainers allows adding initContainers to the pod definition. Those can be used to e.g. // fetch secrets for injection into the Alertmanager configuration from external sources. Any // errors during the execution of an initContainer will lead to a restart of the Pod. More info: https://kubernetes.io/docs/concepts/workloads/pods/init-containers/ // InitContainers described here modify an operator @@ -229,42 +265,55 @@ type AlertmanagerSpec struct { // `init-config-reloader`. Overriding init containers is entirely outside the // scope of what the maintainers will support and by doing so, you accept that // this behaviour may break at any time without notice. + // +optional InitContainers []v1.Container `json:"initContainers,omitempty"` - // Priority class assigned to the Pods + // priorityClassName assigned to the Pods + // +optional PriorityClassName string `json:"priorityClassName,omitempty"` - // AdditionalPeers allows injecting a set of additional Alertmanagers to peer with to form a highly available cluster. + // additionalPeers allows injecting a set of additional Alertmanagers to peer with to form a highly available cluster. + // +optional AdditionalPeers []string `json:"additionalPeers,omitempty"` - // ClusterAdvertiseAddress is the explicit address to advertise in cluster. + // clusterAdvertiseAddress defines the explicit address to advertise in cluster. // Needs to be provided for non RFC1918 [1] (public) addresses. // [1] RFC1918: https://tools.ietf.org/html/rfc1918 + // +optional ClusterAdvertiseAddress string `json:"clusterAdvertiseAddress,omitempty"` - // Interval between gossip attempts. + // clusterGossipInterval defines the interval between gossip attempts. + // +optional ClusterGossipInterval GoDuration `json:"clusterGossipInterval,omitempty"` - // Defines the identifier that uniquely identifies the Alertmanager cluster. + // clusterLabel defines the identifier that uniquely identifies the Alertmanager cluster. // You should only set it when the Alertmanager cluster includes Alertmanager instances which are external to this Alertmanager resource. In practice, the addresses of the external instances are provided via the `.spec.additionalPeers` field. + // +optional ClusterLabel *string `json:"clusterLabel,omitempty"` - // Interval between pushpull attempts. + // clusterPushpullInterval defines the interval between pushpull attempts. + // +optional ClusterPushpullInterval GoDuration `json:"clusterPushpullInterval,omitempty"` - // Timeout for cluster peering. + // clusterPeerTimeout defines the timeout for cluster peering. + // +optional ClusterPeerTimeout GoDuration `json:"clusterPeerTimeout,omitempty"` - // Port name used for the pods and governing service. + // portName defines the port's name for the pods and governing service. // Defaults to `web`. // +kubebuilder:default:="web" + // +optional PortName string `json:"portName,omitempty"` - // ForceEnableClusterMode ensures Alertmanager does not deactivate the cluster mode when running with a single replica. + // forceEnableClusterMode ensures Alertmanager does not deactivate the cluster mode when running with a single replica. // Use case is e.g. spanning an Alertmanager cluster across Kubernetes clusters with a single replica in each. + // +optional ForceEnableClusterMode bool `json:"forceEnableClusterMode,omitempty"` - // AlertmanagerConfigs to be selected for to merge and configure Alertmanager with. + // alertmanagerConfigSelector defines the selector to be used for to merge and configure Alertmanager with. + // +optional AlertmanagerConfigSelector *metav1.LabelSelector `json:"alertmanagerConfigSelector,omitempty"` - // Namespaces to be selected for AlertmanagerConfig discovery. If nil, only + // alertmanagerConfigNamespaceSelector defines the namespaces to be selected for AlertmanagerConfig discovery. If nil, only // check own namespace. + // +optional AlertmanagerConfigNamespaceSelector *metav1.LabelSelector `json:"alertmanagerConfigNamespaceSelector,omitempty"` - // AlertmanagerConfigMatcherStrategy defines how AlertmanagerConfig objects + // alertmanagerConfigMatcherStrategy defines how AlertmanagerConfig objects // process incoming alerts. + // +optional AlertmanagerConfigMatcherStrategy AlertmanagerConfigMatcherStrategy `json:"alertmanagerConfigMatcherStrategy,omitempty"` - // Minimum number of seconds for which a newly created pod should be ready + // minReadySeconds defines the minimum number of seconds for which a newly created pod should be ready // without any of its container crashing for it to be considered available. // // If unset, pods will be considered available as soon as they are ready. @@ -272,33 +321,36 @@ type AlertmanagerSpec struct { // +kubebuilder:validation:Minimum:=0 // +optional MinReadySeconds *int32 `json:"minReadySeconds,omitempty"` - // Pods' hostAliases configuration + // hostAliases Pods configuration // +listType=map // +listMapKey=ip + // +optional HostAliases []HostAlias `json:"hostAliases,omitempty"` - // Defines the web command line flags when starting Alertmanager. + // web defines the web command line flags when starting Alertmanager. + // +optional Web *AlertmanagerWebSpec `json:"web,omitempty"` - // Defines the limits command line flags when starting Alertmanager. + // limits defines the limits command line flags when starting Alertmanager. + // +optional Limits *AlertmanagerLimitsSpec `json:"limits,omitempty"` - // Configures the mutual TLS configuration for the Alertmanager cluster's gossip protocol. + // clusterTLS defines the mutual TLS configuration for the Alertmanager cluster's gossip protocol. // // It requires Alertmanager >= 0.24.0. - //+optional + // +optional ClusterTLS *ClusterTLSConfig `json:"clusterTLS,omitempty"` - // alertmanagerConfiguration specifies the configuration of Alertmanager. + // alertmanagerConfiguration defines the configuration of Alertmanager. // // If defined, it takes precedence over the `configSecret` field. // // This is an *experimental feature*, it may change in any upcoming release // in a breaking way. // - //+optional + // +optional AlertmanagerConfiguration *AlertmanagerConfiguration `json:"alertmanagerConfiguration,omitempty"` - // AutomountServiceAccountToken indicates whether a service account token should be automatically mounted in the pod. + // automountServiceAccountToken defines whether a service account token should be automatically mounted in the pod. // If the service account has `automountServiceAccountToken: true`, set the field to `false` to opt out of automounting API credentials. // +optional AutomountServiceAccountToken *bool `json:"automountServiceAccountToken,omitempty"` - // Enable access to Alertmanager feature flags. By default, no features are enabled. + // enableFeatures defines the Alertmanager's feature flags. By default, no features are enabled. // Enabling features which are disabled by default is entirely outside the // scope of what the maintainers will support and by doing so, you accept // that this behaviour may break at any time without notice. @@ -306,7 +358,7 @@ type AlertmanagerSpec struct { // It requires Alertmanager >= 0.27.0. // +optional EnableFeatures []string `json:"enableFeatures,omitempty"` - // AdditionalArgs allows setting additional arguments for the 'Alertmanager' container. + // additionalArgs allows setting additional arguments for the 'Alertmanager' container. // It is intended for e.g. activating hidden flags which are not supported by // the dedicated configuration options yet. The arguments are passed as-is to the // Alertmanager container which may cause issues if they are invalid or not supported @@ -314,7 +366,7 @@ type AlertmanagerSpec struct { // +optional AdditionalArgs []Argument `json:"additionalArgs,omitempty"` - // Optional duration in seconds the pod needs to terminate gracefully. + // terminationGracePeriodSeconds defines the Optional duration in seconds the pod needs to terminate gracefully. // Value must be non-negative integer. The value zero indicates stop immediately via // the kill signal (no opportunity to shut down) which may lead to data corruption. // @@ -324,7 +376,7 @@ type AlertmanagerSpec struct { // +optional TerminationGracePeriodSeconds *int64 `json:"terminationGracePeriodSeconds,omitempty"` - // HostUsers supports the user space in Kubernetes. + // hostUsers supports the user space in Kubernetes. // // More info: https://kubernetes.io/docs/tasks/configure-pod-container/user-namespaces/ // @@ -337,7 +389,7 @@ type AlertmanagerSpec struct { } type AlertmanagerConfigMatcherStrategy struct { - // AlertmanagerConfigMatcherStrategyType defines the strategy used by + // type defines the strategy used by // AlertmanagerConfig objects to match alerts in the routes and inhibition // rules. // @@ -345,6 +397,7 @@ type AlertmanagerConfigMatcherStrategy struct { // // +kubebuilder:validation:Enum="OnNamespace";"OnNamespaceExceptForAlertmanagerNamespace";"None" // +kubebuilder:default:="OnNamespace" + // +optional Type AlertmanagerConfigMatcherStrategyType `json:"type,omitempty"` } @@ -362,7 +415,7 @@ const ( // is in the same namespace as the Alertmanager object, where it will process all alerts. OnNamespaceExceptForAlertmanagerNamespaceConfigMatcherStrategyType AlertmanagerConfigMatcherStrategyType = "OnNamespaceExceptForAlertmanagerNamespace" - // With `None`, the route and inhbition rules of an AlertmanagerConfig + // With `None`, the route and inhibition rules of an AlertmanagerConfig // object process all incoming alerts. NoneConfigMatcherStrategyType AlertmanagerConfigMatcherStrategyType = "None" ) @@ -370,15 +423,16 @@ const ( // AlertmanagerConfiguration defines the Alertmanager configuration. // +k8s:openapi-gen=true type AlertmanagerConfiguration struct { - // The name of the AlertmanagerConfig resource which is used to generate the Alertmanager configuration. + // name defines the name of the AlertmanagerConfig custom resource which is used to generate the Alertmanager configuration. // It must be defined in the same namespace as the Alertmanager object. // The operator will not enforce a `namespace` label for routes and inhibition rules. // +kubebuilder:validation:MinLength=1 + // +optional Name string `json:"name,omitempty"` - // Defines the global parameters of the Alertmanager configuration. + // global defines the global parameters of the Alertmanager configuration. // +optional Global *AlertmanagerGlobalConfig `json:"global,omitempty"` - // Custom notification templates. + // templates defines the custom notification templates. // +optional Templates []SecretOrConfigMap `json:"templates,omitempty"` } @@ -386,46 +440,57 @@ type AlertmanagerConfiguration struct { // AlertmanagerGlobalConfig configures parameters that are valid in all other configuration contexts. // See https://prometheus.io/docs/alerting/latest/configuration/#configuration-file type AlertmanagerGlobalConfig struct { - // Configures global SMTP parameters. + // smtp defines global SMTP parameters. // +optional SMTPConfig *GlobalSMTPConfig `json:"smtp,omitempty"` - // ResolveTimeout is the default value used by alertmanager if the alert does + // resolveTimeout defines the default value used by alertmanager if the alert does // not include EndsAt, after this time passes it can declare the alert as resolved if it has not been updated. // This has no impact on alerts from Prometheus, as they always include EndsAt. + // +optional ResolveTimeout Duration `json:"resolveTimeout,omitempty"` - // HTTP client configuration. + // httpConfig defines the default HTTP configuration. + // +optional HTTPConfig *HTTPConfig `json:"httpConfig,omitempty"` - // The default Slack API URL. + // slackApiUrl defines the default Slack API URL. + // +optional SlackAPIURL *v1.SecretKeySelector `json:"slackApiUrl,omitempty"` - // The default OpsGenie API URL. + // opsGenieApiUrl defines the default OpsGenie API URL. + // +optional OpsGenieAPIURL *v1.SecretKeySelector `json:"opsGenieApiUrl,omitempty"` - // The default OpsGenie API Key. + // opsGenieApiKey defines the default OpsGenie API Key. + // +optional OpsGenieAPIKey *v1.SecretKeySelector `json:"opsGenieApiKey,omitempty"` - // The default Pagerduty URL. - PagerdutyURL *string `json:"pagerdutyUrl,omitempty"` + // pagerdutyUrl defines the default Pagerduty URL. + // +optional + PagerdutyURL *URL `json:"pagerdutyUrl,omitempty"` - // The default Telegram config + // telegram defines the default Telegram config + // +optional TelegramConfig *GlobalTelegramConfig `json:"telegram,omitempty"` - // The default configuration for Jira. + // jira defines the default configuration for Jira. + // +optional JiraConfig *GlobalJiraConfig `json:"jira,omitempty"` - // The default configuration for VictorOps. + // victorops defines the default configuration for VictorOps. + // +optional VictorOpsConfig *GlobalVictorOpsConfig `json:"victorops,omitempty"` - // The default configuration for Rocket Chat. + // rocketChat defines the default configuration for Rocket Chat. + // +optional RocketChatConfig *GlobalRocketChatConfig `json:"rocketChat,omitempty"` - // The default configuration for Jira. + // webex defines the default configuration for Jira. + // +optional WebexConfig *GlobalWebexConfig `json:"webex,omitempty"` - // The default WeChat Config + // wechat defines the default WeChat Config // +optional WeChatConfig *GlobalWeChatConfig `json:"wechat,omitempty"` } @@ -435,23 +500,29 @@ type AlertmanagerGlobalConfig struct { // https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#spec-and-status // +k8s:openapi-gen=true type AlertmanagerStatus struct { - // Represents whether any actions on the underlying managed objects are + // paused defines whether any actions on the underlying managed objects are // being performed. Only delete actions will be performed. + // +optional Paused bool `json:"paused"` - // Total number of non-terminated pods targeted by this Alertmanager + // replicas defines the total number of non-terminated pods targeted by this Alertmanager // object (their labels match the selector). + // +optional Replicas int32 `json:"replicas"` - // Total number of non-terminated pods targeted by this Alertmanager + // updatedReplicas defines the total number of non-terminated pods targeted by this Alertmanager // object that have the desired version spec. + // +optional UpdatedReplicas int32 `json:"updatedReplicas"` - // Total number of available pods (ready for at least minReadySeconds) + // availableReplicas defines the total number of available pods (ready for at least minReadySeconds) // targeted by this Alertmanager cluster. + // +optional AvailableReplicas int32 `json:"availableReplicas"` - // Total number of unavailable pods targeted by this Alertmanager object. + // unavailableReplicas defines the total number of unavailable pods targeted by this Alertmanager object. + // +optional UnavailableReplicas int32 `json:"unavailableReplicas"` - // The selector used to match the pods targeted by this Alertmanager object. + // selector used to match the pods targeted by this Alertmanager object. + // +optional Selector string `json:"selector,omitempty"` - // The current state of the Alertmanager object. + // conditions defines the current state of the Alertmanager object. // +listType=map // +listMapKey=type // +optional @@ -474,11 +545,11 @@ func (a *Alertmanager) SetUnavailableReplicas(i int) { a.Status.UnavailableRepli // +k8s:openapi-gen=true type AlertmanagerWebSpec struct { WebConfigFileFields `json:",inline"` - // Maximum number of GET requests processed concurrently. This corresponds to the + // getConcurrency defines the maximum number of GET requests processed concurrently. This corresponds to the // Alertmanager's `--web.get-concurrency` flag. // +optional GetConcurrency *uint32 `json:"getConcurrency,omitempty"` - // Timeout for HTTP requests. This corresponds to the Alertmanager's + // timeout for HTTP requests. This corresponds to the Alertmanager's // `--web.timeout` flag. // +optional Timeout *uint32 `json:"timeout,omitempty"` @@ -487,14 +558,14 @@ type AlertmanagerWebSpec struct { // AlertmanagerLimitsSpec defines the limits command line flags when starting Alertmanager. // +k8s:openapi-gen=true type AlertmanagerLimitsSpec struct { - // The maximum number active and pending silences. This corresponds to the + // maxSilences defines the maximum number active and pending silences. This corresponds to the // Alertmanager's `--silences.max-silences` flag. // It requires Alertmanager >= v0.28.0. // // +kubebuilder:validation:Minimum:=0 // +optional MaxSilences *int32 `json:"maxSilences,omitempty"` - // The maximum size of an individual silence as stored on disk. This corresponds to the Alertmanager's + // maxPerSilenceBytes defines the maximum size of an individual silence as stored on disk. This corresponds to the Alertmanager's // `--silences.max-per-silence-bytes` flag. // It requires Alertmanager >= v0.28.0. // @@ -505,47 +576,47 @@ type AlertmanagerLimitsSpec struct { // GlobalSMTPConfig configures global SMTP parameters. // See https://prometheus.io/docs/alerting/latest/configuration/#configuration-file type GlobalSMTPConfig struct { - // The default SMTP From header field. + // from defines the default SMTP From header field. // +optional From *string `json:"from,omitempty"` - // The default SMTP smarthost used for sending emails. + // smartHost defines the default SMTP smarthost used for sending emails. // +optional SmartHost *HostPort `json:"smartHost,omitempty"` - // The default hostname to identify to the SMTP server. + // hello defines the default hostname to identify to the SMTP server. // +optional Hello *string `json:"hello,omitempty"` - // SMTP Auth using CRAM-MD5, LOGIN and PLAIN. If empty, Alertmanager doesn't authenticate to the SMTP server. + // authUsername represents SMTP Auth using CRAM-MD5, LOGIN and PLAIN. If empty, Alertmanager doesn't authenticate to the SMTP server. // +optional AuthUsername *string `json:"authUsername,omitempty"` - // SMTP Auth using LOGIN and PLAIN. + // authPassword represents SMTP Auth using LOGIN and PLAIN. // +optional AuthPassword *v1.SecretKeySelector `json:"authPassword,omitempty"` - // SMTP Auth using PLAIN + // authIdentity represents SMTP Auth using PLAIN // +optional AuthIdentity *string `json:"authIdentity,omitempty"` - // SMTP Auth using CRAM-MD5. + // authSecret represents SMTP Auth using CRAM-MD5. // +optional AuthSecret *v1.SecretKeySelector `json:"authSecret,omitempty"` - // The default SMTP TLS requirement. + // requireTLS defines the default SMTP TLS requirement. // Note that Go does not support unencrypted connections to remote SMTP endpoints. // +optional RequireTLS *bool `json:"requireTLS,omitempty"` - // The default TLS configuration for SMTP receivers + // tlsConfig defines the default TLS configuration for SMTP receivers // +optional TLSConfig *SafeTLSConfig `json:"tlsConfig,omitempty"` } // GlobalTelegramConfig configures global Telegram parameters. type GlobalTelegramConfig struct { - // The default Telegram API URL. + // apiURL defines he default Telegram API URL. // // It requires Alertmanager >= v0.24.0. // +optional @@ -554,7 +625,7 @@ type GlobalTelegramConfig struct { // GlobalJiraConfig configures global Jira parameters. type GlobalJiraConfig struct { - // The default Jira API URL. + // apiURL defines the default Jira API URL. // // It requires Alertmanager >= v0.28.0. // @@ -564,21 +635,21 @@ type GlobalJiraConfig struct { // GlobalRocketChatConfig configures global Rocket Chat parameters. type GlobalRocketChatConfig struct { - // The default Rocket Chat API URL. + // apiURL defines the default Rocket Chat API URL. // // It requires Alertmanager >= v0.28.0. // // +optional APIURL *URL `json:"apiURL,omitempty"` - // The default Rocket Chat token. + // token defines the default Rocket Chat token. // // It requires Alertmanager >= v0.28.0. // // +optional Token *v1.SecretKeySelector `json:"token,omitempty"` - // The default Rocket Chat Token ID. + // tokenID defines the default Rocket Chat Token ID. // // It requires Alertmanager >= v0.28.0. // @@ -589,7 +660,7 @@ type GlobalRocketChatConfig struct { // GlobalWebexConfig configures global Webex parameters. // See https://prometheus.io/docs/alerting/latest/configuration/#configuration-file type GlobalWebexConfig struct { - // The default Webex API URL. + // apiURL defines the is the default Webex API URL. // // It requires Alertmanager >= v0.25.0. // @@ -598,16 +669,16 @@ type GlobalWebexConfig struct { } type GlobalWeChatConfig struct { - // The default WeChat API URL. + // apiURL defines he default WeChat API URL. // The default value is "https://qyapi.weixin.qq.com/cgi-bin/" // +optional APIURL *URL `json:"apiURL,omitempty"` - // The default WeChat API Secret. + // apiSecret defines the default WeChat API Secret. // +optional APISecret *v1.SecretKeySelector `json:"apiSecret,omitempty"` - // The default WeChat API Corporate ID. + // apiCorpID defines the default WeChat API Corporate ID. // +optional // +kubebuilder:validation:MinLength=1 APICorpID *string `json:"apiCorpID,omitempty"` @@ -615,11 +686,11 @@ type GlobalWeChatConfig struct { // GlobalVictorOpsConfig configures global VictorOps parameters. type GlobalVictorOpsConfig struct { - // The default VictorOps API URL. + // apiURL defines the default VictorOps API URL. // // +optional APIURL *URL `json:"apiURL,omitempty"` - // The default VictorOps API Key. + // apiKey defines the default VictorOps API Key. // // +optional APIKey *v1.SecretKeySelector `json:"apiKey,omitempty"` @@ -627,51 +698,22 @@ type GlobalVictorOpsConfig struct { // HostPort represents a "host:port" network address. type HostPort struct { - // Defines the host's address, it can be a DNS name or a literal IP address. + // host defines the host's address, it can be a DNS name or a literal IP address. // +kubebuilder:validation:MinLength=1 + // +required Host string `json:"host"` - // Defines the host's port, it can be a literal port number or a port name. + // port defines the host's port, it can be a literal port number or a port name. // +kubebuilder:validation:MinLength=1 + // +required Port string `json:"port"` } -// HTTPConfig defines a client HTTP configuration. -// See https://prometheus.io/docs/alerting/latest/configuration/#http_config -type HTTPConfig struct { - // Authorization header configuration for the client. - // This is mutually exclusive with BasicAuth and is only available starting from Alertmanager v0.22+. - // +optional - Authorization *SafeAuthorization `json:"authorization,omitempty"` - // BasicAuth for the client. - // This is mutually exclusive with Authorization. If both are defined, BasicAuth takes precedence. - // +optional - BasicAuth *BasicAuth `json:"basicAuth,omitempty"` - // OAuth2 client credentials used to fetch a token for the targets. - // +optional - OAuth2 *OAuth2 `json:"oauth2,omitempty"` - // The secret's key that contains the bearer token to be used by the client - // for authentication. - // The secret needs to be in the same namespace as the Alertmanager - // object and accessible by the Prometheus Operator. - // +optional - BearerTokenSecret *v1.SecretKeySelector `json:"bearerTokenSecret,omitempty"` - // TLS configuration for the client. - // +optional - TLSConfig *SafeTLSConfig `json:"tlsConfig,omitempty"` - - ProxyConfig `json:",inline"` - - // FollowRedirects specifies whether the client should follow HTTP 3xx redirects. - // +optional - FollowRedirects *bool `json:"followRedirects,omitempty"` -} - // AlertmanagerList is a list of Alertmanagers. // +k8s:openapi-gen=true type AlertmanagerList struct { + // TypeMeta defines the versioned schema of this representation of an object. metav1.TypeMeta `json:",inline"` - // Standard list metadata - // More info: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#metadata + // metadata defines ListMeta as metadata for collection responses. metav1.ListMeta `json:"metadata,omitempty"` // List of Alertmanagers Items []Alertmanager `json:"items"` @@ -685,10 +727,10 @@ func (l *AlertmanagerList) DeepCopyObject() runtime.Object { // ClusterTLSConfig defines the mutual TLS configuration for the Alertmanager cluster TLS protocol. // +k8s:openapi-gen=true type ClusterTLSConfig struct { - // Server-side configuration for mutual TLS. + // server defines the server-side configuration for mutual TLS. // +required ServerTLS WebTLSConfig `json:"server"` - // Client-side configuration for mutual TLS. + // client defines the client-side configuration for mutual TLS. // +required ClientTLS SafeTLSConfig `json:"client"` } diff --git a/vendor/github.com/prometheus-operator/prometheus-operator/pkg/apis/monitoring/v1/dns_types.go b/vendor/github.com/prometheus-operator/prometheus-operator/pkg/apis/monitoring/v1/dns_types.go index a4731458b7..d68b698312 100644 --- a/vendor/github.com/prometheus-operator/prometheus-operator/pkg/apis/monitoring/v1/dns_types.go +++ b/vendor/github.com/prometheus-operator/prometheus-operator/pkg/apis/monitoring/v1/dns_types.go @@ -16,25 +16,25 @@ package v1 // PodDNSConfig defines the DNS parameters of a pod in addition to // those generated from DNSPolicy. type PodDNSConfig struct { - // A list of DNS name server IP addresses. + // nameservers defines the list of DNS name server IP addresses. // This will be appended to the base nameservers generated from DNSPolicy. - // +kubebuilder:validation:Optional + // +optional // +listType:=set // +kubebuilder:validation:items:MinLength:=1 Nameservers []string `json:"nameservers,omitempty"` - // A list of DNS search domains for host-name lookup. + // searches defines the list of DNS search domains for host-name lookup. // This will be appended to the base search paths generated from DNSPolicy. - // +kubebuilder:validation:Optional + // +optional // +listType:=set // +kubebuilder:validation:items:MinLength:=1 Searches []string `json:"searches,omitempty"` - // A list of DNS resolver options. + // options defines the list of DNS resolver options. // This will be merged with the base options generated from DNSPolicy. // Resolution options given in Options // will override those that appear in the base DNSPolicy. - // +kubebuilder:validation:Optional + // +optional // +listType=map // +listMapKey=name Options []PodDNSConfigOption `json:"options,omitempty"` @@ -42,12 +42,13 @@ type PodDNSConfig struct { // PodDNSConfigOption defines DNS resolver options of a pod. type PodDNSConfigOption struct { - // Name is required and must be unique. + // name is required and must be unique. // +kubebuilder:validation:MinLength=1 + // +required Name string `json:"name"` - // Value is optional. - // +kubebuilder:validation:Optional + // value is optional. + // +optional Value *string `json:"value,omitempty"` } @@ -56,21 +57,21 @@ type PodDNSConfigOption struct { type DNSPolicy string const ( - // DNSClusterFirstWithHostNet indicates that the pod should use cluster DNS + // DNSClusterFirstWithHostNet defines that the pod should use cluster DNS // first, if it is available, then fall back on the default // (as determined by kubelet) DNS settings. DNSClusterFirstWithHostNet DNSPolicy = "ClusterFirstWithHostNet" - // DNSClusterFirst indicates that the pod should use cluster DNS + // DNSClusterFirst defines that the pod should use cluster DNS // first unless hostNetwork is true, if it is available, then // fall back on the default (as determined by kubelet) DNS settings. DNSClusterFirst DNSPolicy = "ClusterFirst" - // DNSDefault indicates that the pod should use the default (as + // DNSDefault defines that the pod should use the default (as // determined by kubelet) DNS settings. DNSDefault DNSPolicy = "Default" - // DNSNone indicates that the pod should use empty DNS settings. DNS + // DNSNone defines that the pod should use empty DNS settings. DNS // parameters such as nameservers and search paths should be defined via // DNSConfig. DNSNone DNSPolicy = "None" diff --git a/vendor/github.com/prometheus-operator/prometheus-operator/pkg/apis/monitoring/v1/http_config.go b/vendor/github.com/prometheus-operator/prometheus-operator/pkg/apis/monitoring/v1/http_config.go new file mode 100644 index 0000000000..3d7a0b8230 --- /dev/null +++ b/vendor/github.com/prometheus-operator/prometheus-operator/pkg/apis/monitoring/v1/http_config.go @@ -0,0 +1,130 @@ +// Copyright 2018 The prometheus-operator Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package v1 + +import ( + "errors" + "fmt" + + v1 "k8s.io/api/core/v1" +) + +// HTTPConfig defines the configuration for the HTTP client. +type HTTPConfig struct { + // authorization configures the Authorization header credentials used by + // the client. + // + // Cannot be set at the same time as `basicAuth`, `bearerTokenSecret` or `oauth2`. + // + // +optional + Authorization *SafeAuthorization `json:"authorization,omitempty"` + + // basicAuth defines the Basic Authentication credentials used by the + // client. + // + // Cannot be set at the same time as `authorization`, `bearerTokenSecret` or `oauth2`. + // + // +optional + BasicAuth *BasicAuth `json:"basicAuth,omitempty"` + + // oauth2 defines the OAuth2 settings used by the client. + // + // It requires Prometheus >= 2.27.0. + // + // Cannot be set at the same time as `authorization`, `basicAuth` or `bearerTokenSecret`. + // + // +optional + OAuth2 *OAuth2 `json:"oauth2,omitempty"` + + // bearerTokenSecret defines a key of a Secret containing the bearer token + // used by the client for authentication. The secret needs to be in the + // same namespace as the custom resource and readable by the Prometheus + // Operator. + // + // Cannot be set at the same time as `authorization`, `basicAuth` or `oauth2`. + // + // +optional + // + // Deprecated: use `authorization` instead. + BearerTokenSecret *v1.SecretKeySelector `json:"bearerTokenSecret,omitempty"` + + // tlsConfig defines the TLS configuration used by the client. + // + // +optional + TLSConfig *SafeTLSConfig `json:"tlsConfig,omitempty"` + + ProxyConfig `json:",inline"` + + // followRedirects defines whether the client should follow HTTP 3xx + // redirects. + // + // +optional + FollowRedirects *bool `json:"followRedirects,omitempty"` + + // enableHttp2 can be used to disable HTTP2. + // + // +optional + EnableHTTP2 *bool `json:"enableHttp2,omitempty"` +} + +// Validate semantically validates the given HTTPConfig. +func (hc *HTTPConfig) Validate() error { + if hc == nil { + return nil + } + + // Check duplicate authentication methods. + switch { + case hc.Authorization != nil: + switch { + case hc.BasicAuth != nil: + return errors.New("authorization and basicAuth cannot be configured at the same time") + case hc.BearerTokenSecret != nil: + return errors.New("authorization and bearerTokenSecret cannot be configured at the same time") + case hc.OAuth2 != nil: + return errors.New("authorization and oauth2 cannot be configured at the same time") + } + case hc.BasicAuth != nil: + switch { + case hc.BearerTokenSecret != nil: + return errors.New("basicAuth and bearerTokenSecret cannot be configured at the same time") + case hc.OAuth2 != nil: + return errors.New("basicAuth and oauth2 cannot be configured at the same time") + } + case hc.BearerTokenSecret != nil: + switch { + case hc.OAuth2 != nil: + return errors.New("bearerTokenSecret and oauth2 cannot be configured at the same time") + } + } + + if err := hc.Authorization.Validate(); err != nil { + return fmt.Errorf("authorization: %w", err) + } + + if err := hc.OAuth2.Validate(); err != nil { + return fmt.Errorf("oauth2: %w", err) + } + + if err := hc.TLSConfig.Validate(); err != nil { + return fmt.Errorf("tlsConfig: %w", err) + } + + if err := hc.ProxyConfig.Validate(); err != nil { + return err + } + + return nil +} diff --git a/vendor/github.com/prometheus-operator/prometheus-operator/pkg/apis/monitoring/v1/podmonitor_types.go b/vendor/github.com/prometheus-operator/prometheus-operator/pkg/apis/monitoring/v1/podmonitor_types.go index ee0f250868..58783ae828 100644 --- a/vendor/github.com/prometheus-operator/prometheus-operator/pkg/apis/monitoring/v1/podmonitor_types.go +++ b/vendor/github.com/prometheus-operator/prometheus-operator/pkg/apis/monitoring/v1/podmonitor_types.go @@ -15,7 +15,6 @@ package v1 import ( - v1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/runtime" "k8s.io/apimachinery/pkg/util/intstr" @@ -30,6 +29,7 @@ const ( // +genclient // +k8s:openapi-gen=true // +kubebuilder:resource:categories="prometheus-operator",shortName="pmon" +// +kubebuilder:subresource:status // The `PodMonitor` custom resource definition (CRD) defines how `Prometheus` and `PrometheusAgent` can scrape metrics from a group of pods. // Among other things, it allows to specify: @@ -40,10 +40,23 @@ const ( // // `Prometheus` and `PrometheusAgent` objects select `PodMonitor` objects using label and namespace selectors. type PodMonitor struct { - metav1.TypeMeta `json:",inline"` + // TypeMeta defines the versioned schema of this representation of an object. + // +optional + metav1.TypeMeta `json:",inline"` + // metadata defines ObjectMeta as the metadata that all persisted resources. + // +optional metav1.ObjectMeta `json:"metadata,omitempty"` - // Specification of desired Pod selection for target discovery by Prometheus. + // spec defines the specification of desired Pod selection for target discovery by Prometheus. + // +required Spec PodMonitorSpec `json:"spec"` + // status defines the status subresource. It is under active development and is updated only when the + // "StatusForConfigurationResources" feature gate is enabled. + // + // Most recent observed status of the PodMonitor. Read-only. + // More info: + // https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#spec-and-status + // +optional + Status ConfigResourceStatus `json:"status,omitempty,omitzero"` } // DeepCopyObject implements the runtime.Object interface. @@ -51,10 +64,14 @@ func (l *PodMonitor) DeepCopyObject() runtime.Object { return l.DeepCopy() } +func (l *PodMonitor) Bindings() []WorkloadBinding { + return l.Status.Bindings +} + // PodMonitorSpec contains specification parameters for a PodMonitor. // +k8s:openapi-gen=true type PodMonitorSpec struct { - // The label to use to retrieve the job name from. + // jobLabel defines the label to use to retrieve the job name from. // `jobLabel` selects the label from the associated Kubernetes `Pod` // object which will be used as the `job` label for all metrics. // @@ -64,22 +81,25 @@ type PodMonitorSpec struct { // // If the value of this field is empty, the `job` label of the metrics // defaults to the namespace and name of the PodMonitor object (e.g. `/`). + // +optional JobLabel string `json:"jobLabel,omitempty"` - // `podTargetLabels` defines the labels which are transferred from the + // podTargetLabels defines the labels which are transferred from the // associated Kubernetes `Pod` object onto the ingested metrics. // + // +optional PodTargetLabels []string `json:"podTargetLabels,omitempty"` - // Defines how to scrape metrics from the selected pods. + // podMetricsEndpoints defines how to scrape metrics from the selected pods. // // +optional PodMetricsEndpoints []PodMetricsEndpoint `json:"podMetricsEndpoints"` - // Label selector to select the Kubernetes `Pod` objects to scrape metrics from. + // selector defines the label selector to select the Kubernetes `Pod` objects to scrape metrics from. + // +required Selector metav1.LabelSelector `json:"selector"` - // Mechanism used to select the endpoints to scrape. + // selectorMechanism defines the mechanism used to select the endpoints to scrape. // By default, the selection process relies on relabel configurations to filter the discovered targets. // Alternatively, you can opt in for role selectors, which may offer better efficiency in large clusters. // Which strategy is best for your use case needs to be carefully evaluated. @@ -89,23 +109,24 @@ type PodMonitorSpec struct { // +optional SelectorMechanism *SelectorMechanism `json:"selectorMechanism,omitempty"` - // `namespaceSelector` defines in which namespace(s) Prometheus should discover the pods. + // namespaceSelector defines in which namespace(s) Prometheus should discover the pods. // By default, the pods are discovered in the same namespace as the `PodMonitor` object but it is possible to select pods across different/all namespaces. + // +optional NamespaceSelector NamespaceSelector `json:"namespaceSelector,omitempty"` - // `sampleLimit` defines a per-scrape limit on the number of scraped samples + // sampleLimit defines a per-scrape limit on the number of scraped samples // that will be accepted. // // +optional SampleLimit *uint64 `json:"sampleLimit,omitempty"` - // `targetLimit` defines a limit on the number of scraped targets that will + // targetLimit defines a limit on the number of scraped targets that will // be accepted. // // +optional TargetLimit *uint64 `json:"targetLimit,omitempty"` - // `scrapeProtocols` defines the protocols to negotiate during a scrape. It tells clients the + // scrapeProtocols defines the protocols to negotiate during a scrape. It tells clients the // protocols supported by Prometheus in order of preference (from most to least preferred). // // If unset, Prometheus uses its default value. @@ -116,25 +137,25 @@ type PodMonitorSpec struct { // +optional ScrapeProtocols []ScrapeProtocol `json:"scrapeProtocols,omitempty"` - // The protocol to use if a scrape returns blank, unparseable, or otherwise invalid Content-Type. + // fallbackScrapeProtocol defines the protocol to use if a scrape returns blank, unparseable, or otherwise invalid Content-Type. // // It requires Prometheus >= v3.0.0. // +optional FallbackScrapeProtocol *ScrapeProtocol `json:"fallbackScrapeProtocol,omitempty"` - // Per-scrape limit on number of labels that will be accepted for a sample. + // labelLimit defines the per-scrape limit on number of labels that will be accepted for a sample. // // It requires Prometheus >= v2.27.0. // // +optional LabelLimit *uint64 `json:"labelLimit,omitempty"` - // Per-scrape limit on length of labels name that will be accepted for a sample. + // labelNameLengthLimit defines the per-scrape limit on length of labels name that will be accepted for a sample. // // It requires Prometheus >= v2.27.0. // // +optional LabelNameLengthLimit *uint64 `json:"labelNameLengthLimit,omitempty"` - // Per-scrape limit on length of labels value that will be accepted for a sample. + // labelValueLengthLimit defines the per-scrape limit on length of labels value that will be accepted for a sample. // // It requires Prometheus >= v2.27.0. // @@ -143,7 +164,7 @@ type PodMonitorSpec struct { NativeHistogramConfig `json:",inline"` - // Per-scrape limit on the number of targets dropped by relabeling + // keepDroppedTargets defines the per-scrape limit on the number of targets dropped by relabeling // that will be kept in memory. 0 means no limit. // // It requires Prometheus >= v2.47.0. @@ -151,7 +172,7 @@ type PodMonitorSpec struct { // +optional KeepDroppedTargets *uint64 `json:"keepDroppedTargets,omitempty"` - // `attachMetadata` defines additional metadata which is added to the + // attachMetadata defines additional metadata which is added to the // discovered targets. // // It requires Prometheus >= v2.35.0. @@ -159,12 +180,12 @@ type PodMonitorSpec struct { // +optional AttachMetadata *AttachMetadata `json:"attachMetadata,omitempty"` - // The scrape class to apply. + // scrapeClass defines the scrape class to apply. // +optional // +kubebuilder:validation:MinLength=1 ScrapeClassName *string `json:"scrapeClass,omitempty"` - // When defined, bodySizeLimit specifies a job level limit on the size + // bodySizeLimit when defined specifies a job level limit on the size // of uncompressed response body that will be accepted by Prometheus. // // It requires Prometheus >= v2.28.0. @@ -176,9 +197,10 @@ type PodMonitorSpec struct { // PodMonitorList is a list of PodMonitors. // +k8s:openapi-gen=true type PodMonitorList struct { + // TypeMeta defines the versioned schema of this representation of an object. + // +optional metav1.TypeMeta `json:",inline"` - // Standard list metadata - // More info: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#metadata + // metadata defines ListMeta as metadata for collection responses. metav1.ListMeta `json:"metadata,omitempty"` // List of PodMonitors Items []PodMonitor `json:"items"` @@ -194,30 +216,32 @@ func (l *PodMonitorList) DeepCopyObject() runtime.Object { // // +k8s:openapi-gen=true type PodMetricsEndpoint struct { - // The `Pod` port name which exposes the endpoint. + // port defines the `Pod` port name which exposes the endpoint. // // It takes precedence over the `portNumber` and `targetPort` fields. // +optional Port *string `json:"port,omitempty"` - // The `Pod` port number which exposes the endpoint. + // portNumber defines the `Pod` port number which exposes the endpoint. // +kubebuilder:validation:Minimum=1 // +kubebuilder:validation:Maximum=65535 // +optional PortNumber *int32 `json:"portNumber,omitempty"` - // Name or number of the target port of the `Pod` object behind the Service, the + // targetPort defines the name or number of the target port of the `Pod` object behind the Service, the // port must be specified with container port property. // // Deprecated: use 'port' or 'portNumber' instead. + // +optional TargetPort *intstr.IntOrString `json:"targetPort,omitempty"` - // HTTP path from which to scrape for metrics. + // path defines the HTTP path from which to scrape for metrics. // // If empty, Prometheus uses the default value (e.g. `/metrics`). + // +optional Path string `json:"path,omitempty"` - // HTTP scheme to use for scraping. + // scheme defines the HTTP scheme to use for scraping. // // `http` and `https` are the expected values unless you rewrite the // `__scheme__` label via relabeling. @@ -225,48 +249,39 @@ type PodMetricsEndpoint struct { // If empty, Prometheus uses the default value `http`. // // +kubebuilder:validation:Enum=http;https + // +optional Scheme string `json:"scheme,omitempty"` - // `params` define optional HTTP URL parameters. + // params define optional HTTP URL parameters. + // +optional Params map[string][]string `json:"params,omitempty"` - // Interval at which Prometheus scrapes the metrics from the target. + // interval at which Prometheus scrapes the metrics from the target. // // If empty, Prometheus uses the global scrape interval. + // +optional Interval Duration `json:"interval,omitempty"` - // Timeout after which Prometheus considers the scrape to be failed. + // scrapeTimeout defines the timeout after which Prometheus considers the scrape to be failed. // // If empty, Prometheus uses the global scrape timeout unless it is less // than the target's scrape interval value in which the latter is used. // The value cannot be greater than the scrape interval otherwise the operator will reject the resource. - ScrapeTimeout Duration `json:"scrapeTimeout,omitempty"` - - // TLS configuration to use when scraping the target. - // - // +optional - TLSConfig *SafeTLSConfig `json:"tlsConfig,omitempty"` - - // `bearerTokenSecret` specifies a key of a Secret containing the bearer - // token for scraping targets. The secret needs to be in the same namespace - // as the PodMonitor object and readable by the Prometheus Operator. - // // +optional - // - // Deprecated: use `authorization` instead. - BearerTokenSecret v1.SecretKeySelector `json:"bearerTokenSecret,omitempty"` + ScrapeTimeout Duration `json:"scrapeTimeout,omitempty"` - // When true, `honorLabels` preserves the metric's labels when they collide + // honorLabels when true preserves the metric's labels when they collide // with the target's labels. + // +optional HonorLabels bool `json:"honorLabels,omitempty"` - // `honorTimestamps` controls whether Prometheus preserves the timestamps + // honorTimestamps defines whether Prometheus preserves the timestamps // when exposed by the target. // // +optional HonorTimestamps *bool `json:"honorTimestamps,omitempty"` - // `trackTimestampsStaleness` defines whether Prometheus tracks staleness of + // trackTimestampsStaleness defines whether Prometheus tracks staleness of // the metrics that have an explicit timestamp present in scraped data. // Has no effect if `honorTimestamps` is false. // @@ -275,38 +290,13 @@ type PodMetricsEndpoint struct { // +optional TrackTimestampsStaleness *bool `json:"trackTimestampsStaleness,omitempty"` - // `basicAuth` configures the Basic Authentication credentials to use when - // scraping the target. - // - // Cannot be set at the same time as `authorization`, or `oauth2`. - // - // +optional - BasicAuth *BasicAuth `json:"basicAuth,omitempty"` - - // `oauth2` configures the OAuth2 settings to use when scraping the target. - // - // It requires Prometheus >= 2.27.0. - // - // Cannot be set at the same time as `authorization`, or `basicAuth`. - // - // +optional - OAuth2 *OAuth2 `json:"oauth2,omitempty"` - - // `authorization` configures the Authorization header credentials to use when - // scraping the target. - // - // Cannot be set at the same time as `basicAuth`, or `oauth2`. - // - // +optional - Authorization *SafeAuthorization `json:"authorization,omitempty"` - - // `metricRelabelings` configures the relabeling rules to apply to the + // metricRelabelings defines the relabeling rules to apply to the // samples before ingestion. // // +optional MetricRelabelConfigs []RelabelConfig `json:"metricRelabelings,omitempty"` - // `relabelings` configures the relabeling rules to apply the target's + // relabelings defines the relabeling rules to apply the target's // metadata labels. // // The Operator automatically adds relabelings for a few standard Kubernetes fields. @@ -318,21 +308,7 @@ type PodMetricsEndpoint struct { // +optional RelabelConfigs []RelabelConfig `json:"relabelings,omitempty"` - // +optional - ProxyConfig `json:",inline"` - - // `followRedirects` defines whether the scrape requests should follow HTTP - // 3xx redirects. - // - // +optional - FollowRedirects *bool `json:"followRedirects,omitempty"` - - // `enableHttp2` can be used to disable HTTP2 when scraping the target. - // - // +optional - EnableHttp2 *bool `json:"enableHttp2,omitempty"` - - // When true, the pods which are not running (e.g. either in Failed or + // filterRunning when true, the pods which are not running (e.g. either in Failed or // Succeeded state) are dropped during the target discovery. // // If unset, the filtering is enabled. @@ -341,4 +317,6 @@ type PodMetricsEndpoint struct { // // +optional FilterRunning *bool `json:"filterRunning,omitempty"` + + HTTPConfig `json:",inline"` } diff --git a/vendor/github.com/prometheus-operator/prometheus-operator/pkg/apis/monitoring/v1/probe_types.go b/vendor/github.com/prometheus-operator/prometheus-operator/pkg/apis/monitoring/v1/probe_types.go index 44e2e9471b..0dabfe5e9b 100644 --- a/vendor/github.com/prometheus-operator/prometheus-operator/pkg/apis/monitoring/v1/probe_types.go +++ b/vendor/github.com/prometheus-operator/prometheus-operator/pkg/apis/monitoring/v1/probe_types.go @@ -15,6 +15,8 @@ package v1 import ( + "errors" + v1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/runtime" @@ -29,6 +31,7 @@ const ( // +genclient // +k8s:openapi-gen=true // +kubebuilder:resource:categories="prometheus-operator",shortName="prb" +// +kubebuilder:subresource:status // The `Probe` custom resource definition (CRD) defines how to scrape metrics from prober exporters such as the [blackbox exporter](https://github.com/prometheus/blackbox_exporter). // @@ -38,10 +41,23 @@ const ( // // `Prometheus` and `PrometheusAgent` objects select `Probe` objects using label and namespace selectors. type Probe struct { - metav1.TypeMeta `json:",inline"` + // TypeMeta defines the versioned schema of this representation of an object. + // +optional + metav1.TypeMeta `json:",inline"` + // metadata defines ObjectMeta as the metadata that all persisted resources. + // +optional metav1.ObjectMeta `json:"metadata,omitempty"` - // Specification of desired Ingress selection for target discovery by Prometheus. + // spec defines the specification of desired Ingress selection for target discovery by Prometheus. + // +required Spec ProbeSpec `json:"spec"` + // status defines the status subresource. It is under active development and is updated only when the + // "StatusForConfigurationResources" feature gate is enabled. + // + // Most recent observed status of the Probe. Read-only. + // More info: + // https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#spec-and-status + // +optional + Status ConfigResourceStatus `json:"status,omitempty,omitzero"` } // DeepCopyObject implements the runtime.Object interface. @@ -49,49 +65,65 @@ func (l *Probe) DeepCopyObject() runtime.Object { return l.DeepCopy() } +func (l *Probe) Bindings() []WorkloadBinding { + return l.Status.Bindings +} + // ProbeSpec contains specification parameters for a Probe. // +k8s:openapi-gen=true type ProbeSpec struct { - // The job name assigned to scraped metrics by default. + // jobName assigned to scraped metrics by default. + // +optional JobName string `json:"jobName,omitempty"` - // Specification for the prober to use for probing targets. + // prober defines the specification for the prober to use for probing targets. // The prober.URL parameter is required. Targets cannot be probed if left empty. + // +optional ProberSpec ProberSpec `json:"prober,omitempty"` - // The module to use for probing specifying how to probe the target. + // module to use for probing specifying how to probe the target. // Example module configuring in the blackbox exporter: // https://github.com/prometheus/blackbox_exporter/blob/master/example.yml + // +optional Module string `json:"module,omitempty"` - // Targets defines a set of static or dynamically discovered targets to probe. + // targets defines a set of static or dynamically discovered targets to probe. + // +optional Targets ProbeTargets `json:"targets,omitempty"` - // Interval at which targets are probed using the configured prober. + // interval at which targets are probed using the configured prober. // If not specified Prometheus' global scrape interval is used. + // +optional Interval Duration `json:"interval,omitempty"` - // Timeout for scraping metrics from the Prometheus exporter. + // scrapeTimeout defines the timeout for scraping metrics from the Prometheus exporter. // If not specified, the Prometheus global scrape timeout is used. // The value cannot be greater than the scrape interval otherwise the operator will reject the resource. + // +optional ScrapeTimeout Duration `json:"scrapeTimeout,omitempty"` - // TLS configuration to use when scraping the endpoint. + // tlsConfig defines the TLS configuration to use when scraping the endpoint. + // +optional TLSConfig *SafeTLSConfig `json:"tlsConfig,omitempty"` - // Secret to mount to read bearer token for scraping targets. The secret + // bearerTokenSecret defines the secret to mount to read bearer token for scraping targets. The secret // needs to be in the same namespace as the probe and accessible by // the Prometheus Operator. + // +optional BearerTokenSecret v1.SecretKeySelector `json:"bearerTokenSecret,omitempty"` - // BasicAuth allow an endpoint to authenticate over basic authentication. + // basicAuth allow an endpoint to authenticate over basic authentication. // More info: https://prometheus.io/docs/operating/configuration/#endpoint + // +optional BasicAuth *BasicAuth `json:"basicAuth,omitempty"` - // OAuth2 for the URL. Only valid in Prometheus versions 2.27.0 and newer. + // oauth2 for the URL. Only valid in Prometheus versions 2.27.0 and newer. + // +optional OAuth2 *OAuth2 `json:"oauth2,omitempty"` - // MetricRelabelConfigs to apply to samples before ingestion. + // metricRelabelings defines the RelabelConfig to apply to samples before ingestion. + // +optional MetricRelabelConfigs []RelabelConfig `json:"metricRelabelings,omitempty"` - // Authorization section for this endpoint + // authorization section for this endpoint + // +optional Authorization *SafeAuthorization `json:"authorization,omitempty"` - // SampleLimit defines per-scrape limit on number of scraped samples that will be accepted. + // sampleLimit defines per-scrape limit on number of scraped samples that will be accepted. // +optional SampleLimit *uint64 `json:"sampleLimit,omitempty"` - // TargetLimit defines a limit on the number of scraped targets that will be accepted. + // targetLimit defines a limit on the number of scraped targets that will be accepted. // +optional TargetLimit *uint64 `json:"targetLimit,omitempty"` - // `scrapeProtocols` defines the protocols to negotiate during a scrape. It tells clients the + // scrapeProtocols defines the protocols to negotiate during a scrape. It tells clients the // protocols supported by Prometheus in order of preference (from most to least preferred). // // If unset, Prometheus uses its default value. @@ -101,26 +133,27 @@ type ProbeSpec struct { // +listType=set // +optional ScrapeProtocols []ScrapeProtocol `json:"scrapeProtocols,omitempty"` - // The protocol to use if a scrape returns blank, unparseable, or otherwise invalid Content-Type. + // fallbackScrapeProtocol defines the protocol to use if a scrape returns blank, unparseable, or otherwise invalid Content-Type. // // It requires Prometheus >= v3.0.0. // +optional FallbackScrapeProtocol *ScrapeProtocol `json:"fallbackScrapeProtocol,omitempty"` - // Per-scrape limit on number of labels that will be accepted for a sample. + // labelLimit defines the per-scrape limit on number of labels that will be accepted for a sample. // Only valid in Prometheus versions 2.27.0 and newer. // +optional LabelLimit *uint64 `json:"labelLimit,omitempty"` - // Per-scrape limit on length of labels name that will be accepted for a sample. + // labelNameLengthLimit defines the per-scrape limit on length of labels name that will be accepted for a sample. // Only valid in Prometheus versions 2.27.0 and newer. // +optional LabelNameLengthLimit *uint64 `json:"labelNameLengthLimit,omitempty"` - // Per-scrape limit on length of labels value that will be accepted for a sample. + // labelValueLengthLimit defines the per-scrape limit on length of labels value that will be accepted for a sample. // Only valid in Prometheus versions 2.27.0 and newer. // +optional LabelValueLengthLimit *uint64 `json:"labelValueLengthLimit,omitempty"` + // +optional NativeHistogramConfig `json:",inline"` - // Per-scrape limit on the number of targets dropped by relabeling + // keepDroppedTargets defines the per-scrape limit on the number of targets dropped by relabeling // that will be kept in memory. 0 means no limit. // // It requires Prometheus >= v2.47.0. @@ -128,12 +161,12 @@ type ProbeSpec struct { // +optional KeepDroppedTargets *uint64 `json:"keepDroppedTargets,omitempty"` - // The scrape class to apply. + // scrapeClass defines the scrape class to apply. // +optional // +kubebuilder:validation:MinLength=1 ScrapeClassName *string `json:"scrapeClass,omitempty"` - // The list of HTTP query parameters for the scrape. + // params defines the list of HTTP query parameters for the scrape. // Please note that the `.spec.module` field takes precedence over the `module` parameter from this list when both are defined. // The module name must be added using Module under ProbeSpec. // +optional @@ -146,13 +179,14 @@ type ProbeSpec struct { // ProbeParam defines specification of extra parameters for a Probe. // +k8s:openapi-gen=true type ProbeParam struct { - // The parameter name + // name defines the parameter name // +kubebuilder:validation:MinLength=1 // +required Name string `json:"name,omitempty"` - // The parameter values + // values defines the parameter values // +kubebuilder:validation:MinItems=1 // +kubebuilder:validation:items:MinLength=1 + // +optional Values []string `json:"values,omitempty"` } @@ -165,43 +199,37 @@ type ProbeTargets struct { // relabeling configuration. // If `ingress` is also defined, `staticConfig` takes precedence. // More info: https://prometheus.io/docs/prometheus/latest/configuration/configuration/#static_config. + // +optional StaticConfig *ProbeTargetStaticConfig `json:"staticConfig,omitempty"` // ingress defines the Ingress objects to probe and the relabeling // configuration. // If `staticConfig` is also defined, `staticConfig` takes precedence. + // +optional Ingress *ProbeTargetIngress `json:"ingress,omitempty"` } // Validate semantically validates the given ProbeTargets. func (it *ProbeTargets) Validate() error { if it.StaticConfig == nil && it.Ingress == nil { - return &ProbeTargetsValidationError{"at least one of .spec.targets.staticConfig and .spec.targets.ingress is required"} + return errors.New("at least one of .spec.targets.staticConfig and .spec.targets.ingress is required") } return nil } -// ProbeTargetsValidationError is returned by ProbeTargets.Validate() -// on semantically invalid configurations. -// +k8s:openapi-gen=false -type ProbeTargetsValidationError struct { - err string -} - -func (e *ProbeTargetsValidationError) Error() string { - return e.err -} - // ProbeTargetStaticConfig defines the set of static targets considered for probing. // +k8s:openapi-gen=true type ProbeTargetStaticConfig struct { - // The list of hosts to probe. + // static defines the list of hosts to probe. + // +optional Targets []string `json:"static,omitempty"` - // Labels assigned to all metrics scraped from the targets. + // labels defines all labels assigned to all metrics scraped from the targets. + // +optional Labels map[string]string `json:"labels,omitempty"` - // RelabelConfigs to apply to the label set of the targets before it gets + // relabelingConfigs defines relabelings to be apply to the label set of the targets before it gets // scraped. // More info: https://prometheus.io/docs/prometheus/latest/configuration/configuration/#relabel_config + // +optional RelabelConfigs []RelabelConfig `json:"relabelingConfigs,omitempty"` } @@ -209,33 +237,39 @@ type ProbeTargetStaticConfig struct { // The operator configures a target for each host/path combination of each ingress object. // +k8s:openapi-gen=true type ProbeTargetIngress struct { - // Selector to select the Ingress objects. + // selector to select the Ingress objects. + // +optional Selector metav1.LabelSelector `json:"selector,omitempty"` - // From which namespaces to select Ingress objects. + // namespaceSelector defines from which namespaces to select Ingress objects. + // +optional NamespaceSelector NamespaceSelector `json:"namespaceSelector,omitempty"` - // RelabelConfigs to apply to the label set of the target before it gets + // relabelingConfigs to apply to the label set of the target before it gets // scraped. // The original ingress address is available via the // `__tmp_prometheus_ingress_address` label. It can be used to customize the // probed URL. // The original scrape job's name is available via the `__tmp_prometheus_job_name` label. // More info: https://prometheus.io/docs/prometheus/latest/configuration/configuration/#relabel_config + // +optional RelabelConfigs []RelabelConfig `json:"relabelingConfigs,omitempty"` } // ProberSpec contains specification parameters for the Prober used for probing. // +k8s:openapi-gen=true type ProberSpec struct { - // Mandatory URL of the prober. + // url defines the mandatory URL of the prober. + // +required URL string `json:"url"` - // HTTP scheme to use for scraping. + // scheme defines the HTTP scheme to use for scraping. // `http` and `https` are the expected values unless you rewrite the `__scheme__` label via relabeling. // If empty, Prometheus uses the default value `http`. // +kubebuilder:validation:Enum=http;https + // +optional Scheme string `json:"scheme,omitempty"` - // Path to collect metrics from. + // path to collect metrics from. // Defaults to `/probe`. // +kubebuilder:default:="/probe" + // +optional Path string `json:"path,omitempty"` // +optional @@ -245,11 +279,14 @@ type ProberSpec struct { // ProbeList is a list of Probes. // +k8s:openapi-gen=true type ProbeList struct { + // TypeMeta defines the versioned schema of this representation of an object. + // +optional metav1.TypeMeta `json:",inline"` - // Standard list metadata - // More info: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#metadata + // metadata defines ListMeta as metadata for collection responses. + // +optional metav1.ListMeta `json:"metadata,omitempty"` // List of Probes + // +required Items []Probe `json:"items"` } diff --git a/vendor/github.com/prometheus-operator/prometheus-operator/pkg/apis/monitoring/v1/prometheus_types.go b/vendor/github.com/prometheus-operator/prometheus-operator/pkg/apis/monitoring/v1/prometheus_types.go index 3fe51eb4de..71427906ef 100644 --- a/vendor/github.com/prometheus-operator/prometheus-operator/pkg/apis/monitoring/v1/prometheus_types.go +++ b/vendor/github.com/prometheus-operator/prometheus-operator/pkg/apis/monitoring/v1/prometheus_types.go @@ -15,6 +15,7 @@ package v1 import ( + "errors" "fmt" "strings" @@ -53,7 +54,7 @@ const ( // RuntimeConfig configures the values for the process behavior. type RuntimeConfig struct { - // The Go garbage collection target percentage. Lowering this number may increase the CPU usage. + // goGC defines the Go garbage collection target percentage. Lowering this number may increase the CPU usage. // See: https://tip.golang.org/doc/gc-guide#GOGC // +optional // +kubebuilder:validation:Minimum=-1 @@ -102,8 +103,8 @@ type CoreV1TopologySpreadConstraint v1.TopologySpreadConstraint type TopologySpreadConstraint struct { CoreV1TopologySpreadConstraint `json:",inline"` - //+optional - // Defines what Prometheus Operator managed labels should be added to labelSelector on the topologySpreadConstraint. + // additionalLabelSelectors Defines what Prometheus Operator managed labels should be added to labelSelector on the topologySpreadConstraint. + // +optional AdditionalLabelSelectors *AdditionalLabelSelectors `json:"additionalLabelSelectors,omitempty"` } @@ -113,7 +114,7 @@ type EnableFeature string // CommonPrometheusFields are the options available to both the Prometheus server and agent. // +k8s:deepcopy-gen=true type CommonPrometheusFields struct { - // PodMetadata configures labels and annotations which are propagated to the Prometheus pods. + // podMetadata defines labels and annotations which are propagated to the Prometheus pods. // // The following items are reserved and cannot be overridden: // * "prometheus" label, set to the name of the Prometheus object. @@ -124,9 +125,10 @@ type CommonPrometheusFields struct { // * "operator.prometheus.io/name" label, set to the name of the Prometheus object. // * "operator.prometheus.io/shard" label, set to the shard number of the Prometheus object. // * "kubectl.kubernetes.io/default-container" annotation, set to "prometheus". + // +optional PodMetadata *EmbeddedObjectMetadata `json:"podMetadata,omitempty"` - // ServiceMonitors to be selected for target discovery. An empty label + // serviceMonitorSelector defines the serviceMonitors to be selected for target discovery. An empty label // selector matches all objects. A null label selector matches no objects. // // If `spec.serviceMonitorSelector`, `spec.podMonitorSelector`, `spec.probeSelector` @@ -137,13 +139,15 @@ type CommonPrometheusFields struct { // This behavior is *deprecated* and will be removed in the next major version // of the custom resource definition. It is recommended to use // `spec.additionalScrapeConfigs` instead. + // +optional ServiceMonitorSelector *metav1.LabelSelector `json:"serviceMonitorSelector,omitempty"` - // Namespaces to match for ServicedMonitors discovery. An empty label selector + // serviceMonitorNamespaceSelector defines the namespaces to match for ServicedMonitors discovery. An empty label selector // matches all namespaces. A null label selector (default value) matches the current // namespace only. + // +optional ServiceMonitorNamespaceSelector *metav1.LabelSelector `json:"serviceMonitorNamespaceSelector,omitempty"` - // PodMonitors to be selected for target discovery. An empty label selector + // podMonitorSelector defines the podMonitors to be selected for target discovery. An empty label selector // matches all objects. A null label selector matches no objects. // // If `spec.serviceMonitorSelector`, `spec.podMonitorSelector`, `spec.probeSelector` @@ -154,13 +158,15 @@ type CommonPrometheusFields struct { // This behavior is *deprecated* and will be removed in the next major version // of the custom resource definition. It is recommended to use // `spec.additionalScrapeConfigs` instead. + // +optional PodMonitorSelector *metav1.LabelSelector `json:"podMonitorSelector,omitempty"` - // Namespaces to match for PodMonitors discovery. An empty label selector + // podMonitorNamespaceSelector defines the namespaces to match for PodMonitors discovery. An empty label selector // matches all namespaces. A null label selector (default value) matches the current // namespace only. + // +optional PodMonitorNamespaceSelector *metav1.LabelSelector `json:"podMonitorNamespaceSelector,omitempty"` - // Probes to be selected for target discovery. An empty label selector + // probeSelector defines the probes to be selected for target discovery. An empty label selector // matches all objects. A null label selector matches no objects. // // If `spec.serviceMonitorSelector`, `spec.podMonitorSelector`, `spec.probeSelector` @@ -171,13 +177,15 @@ type CommonPrometheusFields struct { // This behavior is *deprecated* and will be removed in the next major version // of the custom resource definition. It is recommended to use // `spec.additionalScrapeConfigs` instead. + // +optional ProbeSelector *metav1.LabelSelector `json:"probeSelector,omitempty"` - // Namespaces to match for Probe discovery. An empty label + // probeNamespaceSelector defines the namespaces to match for Probe discovery. An empty label // selector matches all namespaces. A null label selector matches the // current namespace only. + // +optional ProbeNamespaceSelector *metav1.LabelSelector `json:"probeNamespaceSelector,omitempty"` - // ScrapeConfigs to be selected for target discovery. An empty label + // scrapeConfigSelector defines the scrapeConfigs to be selected for target discovery. An empty label // selector matches all objects. A null label selector matches no objects. // // If `spec.serviceMonitorSelector`, `spec.podMonitorSelector`, `spec.probeSelector` @@ -193,7 +201,7 @@ type CommonPrometheusFields struct { // // +optional ScrapeConfigSelector *metav1.LabelSelector `json:"scrapeConfigSelector,omitempty"` - // Namespaces to match for ScrapeConfig discovery. An empty label selector + // scrapeConfigNamespaceSelector defines the namespaces to match for ScrapeConfig discovery. An empty label selector // matches all namespaces. A null label selector matches the current // namespace only. // @@ -202,19 +210,21 @@ type CommonPrometheusFields struct { // +optional ScrapeConfigNamespaceSelector *metav1.LabelSelector `json:"scrapeConfigNamespaceSelector,omitempty"` - // Version of Prometheus being deployed. The operator uses this information + // version of Prometheus being deployed. The operator uses this information // to generate the Prometheus StatefulSet + configuration files. // // If not specified, the operator assumes the latest upstream version of // Prometheus available at the time when the version of the operator was // released. + // +optional Version string `json:"version,omitempty"` - // When a Prometheus deployment is paused, no actions except for deletion + // paused defines when a Prometheus deployment is paused, no actions except for deletion // will be performed on the underlying objects. + // +optional Paused bool `json:"paused,omitempty"` - // Container image name for Prometheus. If specified, it takes precedence + // image defines the container image name for Prometheus. If specified, it takes precedence // over the `spec.baseImage`, `spec.tag` and `spec.sha` fields. // // Specifying `spec.version` is still necessary to ensure the Prometheus @@ -226,16 +236,18 @@ type CommonPrometheusFields struct { // // +optional Image *string `json:"image,omitempty"` - // Image pull policy for the 'prometheus', 'init-config-reloader' and 'config-reloader' containers. + // imagePullPolicy defines the image pull policy for the 'prometheus', 'init-config-reloader' and 'config-reloader' containers. // See https://kubernetes.io/docs/concepts/containers/images/#image-pull-policy for more details. // +kubebuilder:validation:Enum="";Always;Never;IfNotPresent + // +optional ImagePullPolicy v1.PullPolicy `json:"imagePullPolicy,omitempty"` - // An optional list of references to Secrets in the same namespace + // imagePullSecrets defines an optional list of references to Secrets in the same namespace // to use for pulling images from registries. // See http://kubernetes.io/docs/user-guide/images#specifying-imagepullsecrets-on-a-pod + // +optional ImagePullSecrets []v1.LocalObjectReference `json:"imagePullSecrets,omitempty"` - // Number of replicas of each shard to deploy for a Prometheus deployment. + // replicas defines the number of replicas of each shard to deploy for a Prometheus deployment. // `spec.replicas` multiplied by `spec.shards` is the total number of Pods // created. // @@ -243,7 +255,7 @@ type CommonPrometheusFields struct { // +optional Replicas *int32 `json:"replicas,omitempty"` - // Number of shards to distribute the scraped targets onto. + // shards defines the number of shards to distribute the scraped targets onto. // // `spec.replicas` multiplied by `spec.shards` is the total number of Pods // being created. @@ -269,16 +281,17 @@ type CommonPrometheusFields struct { // You can also disable sharding on a specific target by setting the // `__tmp_disable_sharding` label with relabeling configuration. When // the label value isn't empty, all Prometheus shards will scrape the target. + // +optional Shards *int32 `json:"shards,omitempty"` - // Name of Prometheus external label used to denote the replica name. + // replicaExternalLabelName defines the name of Prometheus external label used to denote the replica name. // The external label will _not_ be added when the field is set to the // empty string (`""`). // // Default: "prometheus_replica" // +optional ReplicaExternalLabelName *string `json:"replicaExternalLabelName,omitempty"` - // Name of Prometheus external label used to denote the Prometheus instance + // prometheusExternalLabelName defines the name of Prometheus external label used to denote the Prometheus instance // name. The external label will _not_ be added when the field is set to // the empty string (`""`). // @@ -286,23 +299,27 @@ type CommonPrometheusFields struct { // +optional PrometheusExternalLabelName *string `json:"prometheusExternalLabelName,omitempty"` - // Log level for Prometheus and the config-reloader sidecar. + // logLevel for Prometheus and the config-reloader sidecar. // +kubebuilder:validation:Enum="";debug;info;warn;error + // +optional LogLevel string `json:"logLevel,omitempty"` - // Log format for Log level for Prometheus and the config-reloader sidecar. + // logFormat for Log level for Prometheus and the config-reloader sidecar. // +kubebuilder:validation:Enum="";logfmt;json + // +optional LogFormat string `json:"logFormat,omitempty"` - // Interval between consecutive scrapes. + // scrapeInterval defines interval between consecutive scrapes. // // Default: "30s" // +kubebuilder:default:="30s" + // +optional ScrapeInterval Duration `json:"scrapeInterval,omitempty"` - // Number of seconds to wait until a scrape request times out. + // scrapeTimeout defines the number of seconds to wait until a scrape request times out. // The value cannot be greater than the scrape interval otherwise the operator will reject the resource. + // +optional ScrapeTimeout Duration `json:"scrapeTimeout,omitempty"` - // The protocols to negotiate during a scrape. It tells clients the + // scrapeProtocols defines the protocols to negotiate during a scrape. It tells clients the // protocols supported by Prometheus in order of preference (from most to least preferred). // // If unset, Prometheus uses its default value. @@ -315,13 +332,14 @@ type CommonPrometheusFields struct { // +optional ScrapeProtocols []ScrapeProtocol `json:"scrapeProtocols,omitempty"` - // The labels to add to any time series or alerts when communicating with + // externalLabels defines the labels to add to any time series or alerts when communicating with // external systems (federation, remote storage, Alertmanager). // Labels defined by `spec.replicaExternalLabelName` and // `spec.prometheusExternalLabelName` take precedence over this list. + // +optional ExternalLabels map[string]string `json:"externalLabels,omitempty"` - // Enable Prometheus to be used as a receiver for the Prometheus remote + // enableRemoteWriteReceiver defines the Prometheus to be used as a receiver for the Prometheus remote // write protocol. // // WARNING: This is not considered an efficient way of ingesting samples. @@ -331,9 +349,10 @@ type CommonPrometheusFields struct { // For more information see https://prometheus.io/docs/prometheus/latest/querying/api/#remote-write-receiver // // It requires Prometheus >= v2.33.0. + // +optional EnableRemoteWriteReceiver bool `json:"enableRemoteWriteReceiver,omitempty"` - // Enable Prometheus to be used as a receiver for the OTLP Metrics protocol. + // enableOTLPReceiver defines the Prometheus to be used as a receiver for the OTLP Metrics protocol. // // Note that the OTLP receiver endpoint is automatically enabled if `.spec.otlpConfig` is defined. // @@ -341,7 +360,7 @@ type CommonPrometheusFields struct { // +optional EnableOTLPReceiver *bool `json:"enableOTLPReceiver,omitempty"` - // List of the protobuf message versions to accept when receiving the + // remoteWriteReceiverMessageVersions list of the protobuf message versions to accept when receiving the // remote writes. // // It requires Prometheus >= v2.54.0. @@ -351,7 +370,7 @@ type CommonPrometheusFields struct { // +optional RemoteWriteReceiverMessageVersions []RemoteWriteMessageVersion `json:"remoteWriteReceiverMessageVersions,omitempty"` - // Enable access to Prometheus feature flags. By default, no features are enabled. + // enableFeatures enables access to Prometheus feature flags. By default, no features are enabled. // // Enabling features which are disabled by default is entirely outside the // scope of what the maintainers will support and by doing so, you accept @@ -363,32 +382,37 @@ type CommonPrometheusFields struct { // +optional EnableFeatures []EnableFeature `json:"enableFeatures,omitempty"` - // The external URL under which the Prometheus service is externally + // externalUrl defines the external URL under which the Prometheus service is externally // available. This is necessary to generate correct URLs (for instance if // Prometheus is accessible behind an Ingress resource). + // +optional ExternalURL string `json:"externalUrl,omitempty"` - // The route prefix Prometheus registers HTTP handlers for. + // routePrefix defines the route prefix Prometheus registers HTTP handlers for. // // This is useful when using `spec.externalURL`, and a proxy is rewriting // HTTP routes of a request, and the actual ExternalURL is still true, but // the server serves requests under a different route prefix. For example // for use with `kubectl proxy`. + // +optional RoutePrefix string `json:"routePrefix,omitempty"` - // Storage defines the storage used by Prometheus. + // storage defines the storage used by Prometheus. + // +optional Storage *StorageSpec `json:"storage,omitempty"` - // Volumes allows the configuration of additional volumes on the output + // volumes allows the configuration of additional volumes on the output // StatefulSet definition. Volumes specified will be appended to other // volumes that are generated as a result of StorageSpec objects. + // +optional Volumes []v1.Volume `json:"volumes,omitempty"` - // VolumeMounts allows the configuration of additional VolumeMounts. + // volumeMounts allows the configuration of additional VolumeMounts. // // VolumeMounts will be appended to other VolumeMounts in the 'prometheus' // container, that are generated as a result of StorageSpec objects. + // +optional VolumeMounts []v1.VolumeMount `json:"volumeMounts,omitempty"` - // The field controls if and how PVCs are deleted during the lifecycle of a StatefulSet. + // persistentVolumeClaimRetentionPolicy defines the field controls if and how PVCs are deleted during the lifecycle of a StatefulSet. // The default behavior is all PVCs are retained. // This is an alpha field from kubernetes 1.23 until 1.26 and a beta field from 1.26. // It requires enabling the StatefulSetAutoDeletePVC feature gate. @@ -396,20 +420,24 @@ type CommonPrometheusFields struct { // +optional PersistentVolumeClaimRetentionPolicy *appsv1.StatefulSetPersistentVolumeClaimRetentionPolicy `json:"persistentVolumeClaimRetentionPolicy,omitempty"` - // Defines the configuration of the Prometheus web server. + // web defines the configuration of the Prometheus web server. + // +optional Web *PrometheusWebSpec `json:"web,omitempty"` - // Defines the resources requests and limits of the 'prometheus' container. + // resources defines the resources requests and limits of the 'prometheus' container. + // +optional Resources v1.ResourceRequirements `json:"resources,omitempty"` - // Defines on which Nodes the Pods are scheduled. + // nodeSelector defines on which Nodes the Pods are scheduled. + // +optional NodeSelector map[string]string `json:"nodeSelector,omitempty"` - // ServiceAccountName is the name of the ServiceAccount to use to run the + // serviceAccountName is the name of the ServiceAccount to use to run the // Prometheus Pods. + // +optional ServiceAccountName string `json:"serviceAccountName,omitempty"` - // AutomountServiceAccountToken indicates whether a service account token should be automatically mounted in the pod. + // automountServiceAccountToken defines whether a service account token should be automatically mounted in the pod. // If the field isn't set, the operator mounts the service account token by default. // // **Warning:** be aware that by default, Prometheus requires the service account token for Kubernetes service discovery. @@ -417,61 +445,65 @@ type CommonPrometheusFields struct { // +optional AutomountServiceAccountToken *bool `json:"automountServiceAccountToken,omitempty"` - // Secrets is a list of Secrets in the same namespace as the Prometheus + // secrets defines a list of Secrets in the same namespace as the Prometheus // object, which shall be mounted into the Prometheus Pods. // Each Secret is added to the StatefulSet definition as a volume named `secret-`. // The Secrets are mounted into /etc/prometheus/secrets/ in the 'prometheus' container. // +listType:=set + // +optional Secrets []string `json:"secrets,omitempty"` - // ConfigMaps is a list of ConfigMaps in the same namespace as the Prometheus + // configMaps defines a list of ConfigMaps in the same namespace as the Prometheus // object, which shall be mounted into the Prometheus Pods. // Each ConfigMap is added to the StatefulSet definition as a volume named `configmap-`. // The ConfigMaps are mounted into /etc/prometheus/configmaps/ in the 'prometheus' container. + // +optional ConfigMaps []string `json:"configMaps,omitempty"` - // Defines the Pods' affinity scheduling rules if specified. + // affinity defines the Pods' affinity scheduling rules if specified. // +optional Affinity *v1.Affinity `json:"affinity,omitempty"` - // Defines the Pods' tolerations if specified. + // tolerations defines the Pods' tolerations if specified. // +optional Tolerations []v1.Toleration `json:"tolerations,omitempty"` - // Defines the pod's topology spread constraints if specified. - //+optional + // topologySpreadConstraints defines the pod's topology spread constraints if specified. + // +optional TopologySpreadConstraints []TopologySpreadConstraint `json:"topologySpreadConstraints,omitempty"` - // Defines the list of remote write configurations. + // remoteWrite defines the list of remote write configurations. // +optional RemoteWrite []RemoteWriteSpec `json:"remoteWrite,omitempty"` - // Settings related to the OTLP receiver feature. + // otlp defines the settings related to the OTLP receiver feature. // It requires Prometheus >= v2.55.0. // // +optional OTLP *OTLPConfig `json:"otlp,omitempty"` - // SecurityContext holds pod-level security attributes and common container settings. + // securityContext holds pod-level security attributes and common container settings. // This defaults to the default PodSecurityContext. // +optional SecurityContext *v1.PodSecurityContext `json:"securityContext,omitempty"` - // Defines the DNS policy for the pods. + // dnsPolicy defines the DNS policy for the pods. // // +optional DNSPolicy *DNSPolicy `json:"dnsPolicy,omitempty"` - // Defines the DNS configuration for the pods. + // dnsConfig defines the DNS configuration for the pods. // // +optional DNSConfig *PodDNSConfig `json:"dnsConfig,omitempty"` - // When true, the Prometheus server listens on the loopback address + // listenLocal when true, the Prometheus server listens on the loopback address // instead of the Pod IP's address. + // + // +optional ListenLocal bool `json:"listenLocal,omitempty"` - // Indicates whether information about services should be injected into pod's environment variables + // enableServiceLinks defines whether information about services should be injected into pod's environment variables // +optional EnableServiceLinks *bool `json:"enableServiceLinks,omitempty"` - // Containers allows injecting additional containers or modifying operator + // containers allows injecting additional containers or modifying operator // generated containers. This can be used to allow adding an authentication // proxy to the Pods or to change the behavior of an operator generated // container. Containers described here modify an operator generated @@ -488,7 +520,7 @@ type CommonPrometheusFields struct { // may break at any time without notice. // +optional Containers []v1.Container `json:"containers,omitempty"` - // InitContainers allows injecting initContainers to the Pod definition. Those + // initContainers allows injecting initContainers to the Pod definition. Those // can be used to e.g. fetch secrets for injection into the Prometheus // configuration from external sources. Any errors during the execution of // an initContainer will lead to a restart of the Pod. More info: @@ -506,7 +538,7 @@ type CommonPrometheusFields struct { // +optional InitContainers []v1.Container `json:"initContainers,omitempty"` - // AdditionalScrapeConfigs allows specifying a key of a Secret containing + // additionalScrapeConfigs allows specifying a key of a Secret containing // additional Prometheus scrape configurations. Scrape configurations // specified are appended to the configurations generated by the Prometheus // Operator. Job configurations specified must have the form as specified @@ -520,7 +552,7 @@ type CommonPrometheusFields struct { // +optional AdditionalScrapeConfigs *v1.SecretKeySelector `json:"additionalScrapeConfigs,omitempty"` - // APIServerConfig allows specifying a host and auth methods to access the + // apiserverConfig allows specifying a host and auth methods to access the // Kuberntees API server. // If null, Prometheus is assumed to run inside of the cluster: it will // discover the API servers automatically and use the Pod's CA certificate @@ -528,14 +560,16 @@ type CommonPrometheusFields struct { // +optional APIServerConfig *APIServerConfig `json:"apiserverConfig,omitempty"` - // Priority class assigned to the Pods. + // priorityClassName assigned to the Pods. + // +optional PriorityClassName string `json:"priorityClassName,omitempty"` - // Port name used for the pods and governing service. + // portName used for the pods and governing service. // Default: "web" // +kubebuilder:default:="web" + // +optional PortName string `json:"portName,omitempty"` - // When true, ServiceMonitor, PodMonitor and Probe object are forbidden to + // arbitraryFSAccessThroughSMs when true, ServiceMonitor, PodMonitor and Probe object are forbidden to // reference arbitrary files on the file system of the 'prometheus' // container. // When a ServiceMonitor's endpoint specifies a `bearerTokenFile` value @@ -545,26 +579,30 @@ type CommonPrometheusFields struct { // `spec.arbitraryFSAccessThroughSM` to 'true' would prevent the attack. // Users should instead provide the credentials using the // `spec.bearerTokenSecret` field. + // +optional ArbitraryFSAccessThroughSMs ArbitraryFSAccessThroughSMsConfig `json:"arbitraryFSAccessThroughSMs,omitempty"` - // When true, Prometheus resolves label conflicts by renaming the labels in the scraped data + // overrideHonorLabels when true, Prometheus resolves label conflicts by renaming the labels in the scraped data // to “exported_” for all targets created from ServiceMonitor, PodMonitor and // ScrapeConfig objects. Otherwise the HonorLabels field of the service or pod monitor applies. - // In practice,`overrideHonorLaels:true` enforces `honorLabels:false` + // In practice,`OverrideHonorLabels:true` enforces `honorLabels:false` // for all ServiceMonitor, PodMonitor and ScrapeConfig objects. + // +optional OverrideHonorLabels bool `json:"overrideHonorLabels,omitempty"` - // When true, Prometheus ignores the timestamps for all the targets created + // overrideHonorTimestamps when true, Prometheus ignores the timestamps for all the targets created // from service and pod monitors. // Otherwise the HonorTimestamps field of the service or pod monitor applies. + // +optional OverrideHonorTimestamps bool `json:"overrideHonorTimestamps,omitempty"` - // When true, `spec.namespaceSelector` from all PodMonitor, ServiceMonitor + // ignoreNamespaceSelectors when true, `spec.namespaceSelector` from all PodMonitor, ServiceMonitor // and Probe objects will be ignored. They will only discover targets // within the namespace of the PodMonitor, ServiceMonitor and Probe // object. + // +optional IgnoreNamespaceSelectors bool `json:"ignoreNamespaceSelectors,omitempty"` - // When not empty, a label will be added to: + // enforcedNamespaceLabel when not empty, a label will be added to: // // 1. All metrics scraped from `ServiceMonitor`, `PodMonitor`, `Probe` and `ScrapeConfig` objects. // 2. All metrics generated from recording rules defined in `PrometheusRule` objects. @@ -576,9 +614,10 @@ type CommonPrometheusFields struct { // The label's name is this field's value. // The label's value is the namespace of the `ServiceMonitor`, // `PodMonitor`, `Probe`, `PrometheusRule` or `ScrapeConfig` object. + // +optional EnforcedNamespaceLabel string `json:"enforcedNamespaceLabel,omitempty"` - // When defined, enforcedSampleLimit specifies a global limit on the number + // enforcedSampleLimit when defined specifies a global limit on the number // of scraped samples that will be accepted. This overrides any // `spec.sampleLimit` set by ServiceMonitor, PodMonitor, Probe objects // unless `spec.sampleLimit` is greater than zero and less than @@ -596,7 +635,7 @@ type CommonPrometheusFields struct { // // +optional EnforcedSampleLimit *uint64 `json:"enforcedSampleLimit,omitempty"` - // When defined, enforcedTargetLimit specifies a global limit on the number + // enforcedTargetLimit when defined specifies a global limit on the number // of scraped targets. The value overrides any `spec.targetLimit` set by // ServiceMonitor, PodMonitor, Probe objects unless `spec.targetLimit` is // greater than zero and less than `spec.enforcedTargetLimit`. @@ -613,7 +652,7 @@ type CommonPrometheusFields struct { // // +optional EnforcedTargetLimit *uint64 `json:"enforcedTargetLimit,omitempty"` - // When defined, enforcedLabelLimit specifies a global limit on the number + // enforcedLabelLimit when defined specifies a global limit on the number // of labels per sample. The value overrides any `spec.labelLimit` set by // ServiceMonitor, PodMonitor, Probe objects unless `spec.labelLimit` is // greater than zero and less than `spec.enforcedLabelLimit`. @@ -629,7 +668,7 @@ type CommonPrometheusFields struct { // // +optional EnforcedLabelLimit *uint64 `json:"enforcedLabelLimit,omitempty"` - // When defined, enforcedLabelNameLengthLimit specifies a global limit on the length + // enforcedLabelNameLengthLimit when defined specifies a global limit on the length // of labels name per sample. The value overrides any `spec.labelNameLengthLimit` set by // ServiceMonitor, PodMonitor, Probe objects unless `spec.labelNameLengthLimit` is // greater than zero and less than `spec.enforcedLabelNameLengthLimit`. @@ -645,7 +684,7 @@ type CommonPrometheusFields struct { // // +optional EnforcedLabelNameLengthLimit *uint64 `json:"enforcedLabelNameLengthLimit,omitempty"` - // When not null, enforcedLabelValueLengthLimit defines a global limit on the length + // enforcedLabelValueLengthLimit when not null defines a global limit on the length // of labels value per sample. The value overrides any `spec.labelValueLengthLimit` set by // ServiceMonitor, PodMonitor, Probe objects unless `spec.labelValueLengthLimit` is // greater than zero and less than `spec.enforcedLabelValueLengthLimit`. @@ -661,7 +700,7 @@ type CommonPrometheusFields struct { // // +optional EnforcedLabelValueLengthLimit *uint64 `json:"enforcedLabelValueLengthLimit,omitempty"` - // When defined, enforcedKeepDroppedTargets specifies a global limit on the number of targets + // enforcedKeepDroppedTargets when defined specifies a global limit on the number of targets // dropped by relabeling that will be kept in memory. The value overrides // any `spec.keepDroppedTargets` set by // ServiceMonitor, PodMonitor, Probe objects unless `spec.keepDroppedTargets` is @@ -678,7 +717,7 @@ type CommonPrometheusFields struct { // // +optional EnforcedKeepDroppedTargets *uint64 `json:"enforcedKeepDroppedTargets,omitempty"` - // When defined, enforcedBodySizeLimit specifies a global limit on the size + // enforcedBodySizeLimit when defined specifies a global limit on the size // of uncompressed response body that will be accepted by Prometheus. // Targets responding with a body larger than this many bytes will cause // the scrape to fail. @@ -691,16 +730,17 @@ type CommonPrometheusFields struct { // * Scrape objects with a bodySizeLimit value less than or equal to enforcedBodySizeLimit keep their specific value. // * Scrape objects with a bodySizeLimit value greater than enforcedBodySizeLimit are set to enforcedBodySizeLimit. // + // +optional EnforcedBodySizeLimit ByteSize `json:"enforcedBodySizeLimit,omitempty"` - // Specifies the validation scheme for metric and label names. + // nameValidationScheme defines the validation scheme for metric and label names. // // It requires Prometheus >= v2.55.0. // // +optional NameValidationScheme *NameValidationSchemeOptions `json:"nameValidationScheme,omitempty"` - // Specifies the character escaping scheme that will be requested when scraping + // nameEscapingScheme defines the character escaping scheme that will be requested when scraping // for metric and label names that do not conform to the legacy Prometheus // character set. // @@ -709,7 +749,7 @@ type CommonPrometheusFields struct { // +optional NameEscapingScheme *NameEscapingSchemeOptions `json:"nameEscapingScheme,omitempty"` - // Whether to convert all scraped classic histograms into a native + // convertClassicHistogramsToNHCB defines whether to convert all scraped classic histograms into a native // histogram with custom buckets. // // It requires Prometheus >= v3.4.0. @@ -717,7 +757,7 @@ type CommonPrometheusFields struct { // +optional ConvertClassicHistogramsToNHCB *bool `json:"convertClassicHistogramsToNHCB,omitempty"` - // Whether to scrape a classic histogram that is also exposed as a native histogram. + // scrapeClassicHistograms defines whether to scrape a classic histogram that is also exposed as a native histogram. // // Notice: `scrapeClassicHistograms` corresponds to the `always_scrape_classic_histograms` field in the Prometheus configuration. // @@ -726,7 +766,7 @@ type CommonPrometheusFields struct { // +optional ScrapeClassicHistograms *bool `json:"scrapeClassicHistograms,omitempty"` - // Minimum number of seconds for which a newly created Pod should be ready + // minReadySeconds defines the minimum number of seconds for which a newly created Pod should be ready // without any of its container crashing for it to be considered available. // // If unset, pods will be considered available as soon as they are ready. @@ -735,7 +775,7 @@ type CommonPrometheusFields struct { // +optional MinReadySeconds *int32 `json:"minReadySeconds,omitempty"` - // Optional list of hosts and IPs that will be injected into the Pod's + // hostAliases defines the optional list of hosts and IPs that will be injected into the Pod's // hosts file if specified. // // +listType=map @@ -743,7 +783,7 @@ type CommonPrometheusFields struct { // +optional HostAliases []HostAlias `json:"hostAliases,omitempty"` - // AdditionalArgs allows setting additional arguments for the 'prometheus' container. + // additionalArgs allows setting additional arguments for the 'prometheus' container. // // It is intended for e.g. activating hidden flags which are not supported by // the dedicated configuration options yet. The arguments are passed as-is to the @@ -757,7 +797,7 @@ type CommonPrometheusFields struct { // +optional AdditionalArgs []Argument `json:"additionalArgs,omitempty"` - // Configures compression of the write-ahead log (WAL) using Snappy. + // walCompression defines the compression of the write-ahead log (WAL) using Snappy. // // WAL compression is enabled by default for Prometheus >= 2.20.0 // @@ -766,7 +806,7 @@ type CommonPrometheusFields struct { // +optional WALCompression *bool `json:"walCompression,omitempty"` - // List of references to PodMonitor, ServiceMonitor, Probe and PrometheusRule objects + // excludedFromEnforcement defines the list of references to PodMonitor, ServiceMonitor, Probe and PrometheusRule objects // to be excluded from enforcing a namespace label of origin. // // It is only applicable if `spec.enforcedNamespaceLabel` set to true. @@ -774,7 +814,7 @@ type CommonPrometheusFields struct { // +optional ExcludedFromEnforcement []ObjectReference `json:"excludedFromEnforcement,omitempty"` - // Use the host's network namespace if true. + // hostNetwork defines the host's network namespace if true. // // Make sure to understand the security implications if you want to enable // it (https://kubernetes.io/docs/concepts/configuration/overview/ ). @@ -782,22 +822,24 @@ type CommonPrometheusFields struct { // When hostNetwork is enabled, this will set the DNS policy to // `ClusterFirstWithHostNet` automatically (unless `.spec.DNSPolicy` is set // to a different value). + // + // +optional HostNetwork bool `json:"hostNetwork,omitempty"` - // PodTargetLabels are appended to the `spec.podTargetLabels` field of all + // podTargetLabels are appended to the `spec.podTargetLabels` field of all // PodMonitor and ServiceMonitor objects. // // +optional PodTargetLabels []string `json:"podTargetLabels,omitempty"` - // TracingConfig configures tracing in Prometheus. + // tracingConfig defines tracing in Prometheus. // // This is an *experimental feature*, it may change in any upcoming release // in a breaking way. // // +optional TracingConfig *PrometheusTracingConfig `json:"tracingConfig,omitempty"` - // BodySizeLimit defines per-scrape on response body size. + // bodySizeLimit defines per-scrape on response body size. // Only valid in Prometheus versions 2.45.0 and newer. // // Note that the global limit only applies to scrape objects that don't specify an explicit limit value. @@ -805,7 +847,7 @@ type CommonPrometheusFields struct { // // +optional BodySizeLimit *ByteSize `json:"bodySizeLimit,omitempty"` - // SampleLimit defines per-scrape limit on number of scraped samples that will be accepted. + // sampleLimit defines per-scrape limit on number of scraped samples that will be accepted. // Only valid in Prometheus versions 2.45.0 and newer. // // Note that the global limit only applies to scrape objects that don't specify an explicit limit value. @@ -813,7 +855,7 @@ type CommonPrometheusFields struct { // // +optional SampleLimit *uint64 `json:"sampleLimit,omitempty"` - // TargetLimit defines a limit on the number of scraped targets that will be accepted. + // targetLimit defines a limit on the number of scraped targets that will be accepted. // Only valid in Prometheus versions 2.45.0 and newer. // // Note that the global limit only applies to scrape objects that don't specify an explicit limit value. @@ -821,7 +863,7 @@ type CommonPrometheusFields struct { // // +optional TargetLimit *uint64 `json:"targetLimit,omitempty"` - // Per-scrape limit on number of labels that will be accepted for a sample. + // labelLimit defines per-scrape limit on number of labels that will be accepted for a sample. // Only valid in Prometheus versions 2.45.0 and newer. // // Note that the global limit only applies to scrape objects that don't specify an explicit limit value. @@ -829,7 +871,7 @@ type CommonPrometheusFields struct { // // +optional LabelLimit *uint64 `json:"labelLimit,omitempty"` - // Per-scrape limit on length of labels name that will be accepted for a sample. + // labelNameLengthLimit defines the per-scrape limit on length of labels name that will be accepted for a sample. // Only valid in Prometheus versions 2.45.0 and newer. // // Note that the global limit only applies to scrape objects that don't specify an explicit limit value. @@ -837,7 +879,7 @@ type CommonPrometheusFields struct { // // +optional LabelNameLengthLimit *uint64 `json:"labelNameLengthLimit,omitempty"` - // Per-scrape limit on length of labels value that will be accepted for a sample. + // labelValueLengthLimit defines the per-scrape limit on length of labels value that will be accepted for a sample. // Only valid in Prometheus versions 2.45.0 and newer. // // Note that the global limit only applies to scrape objects that don't specify an explicit limit value. @@ -845,7 +887,7 @@ type CommonPrometheusFields struct { // // +optional LabelValueLengthLimit *uint64 `json:"labelValueLengthLimit,omitempty"` - // Per-scrape limit on the number of targets dropped by relabeling + // keepDroppedTargets defines the per-scrape limit on the number of targets dropped by relabeling // that will be kept in memory. 0 means no limit. // // It requires Prometheus >= v2.47.0. @@ -856,18 +898,18 @@ type CommonPrometheusFields struct { // +optional KeepDroppedTargets *uint64 `json:"keepDroppedTargets,omitempty"` - // Defines the strategy used to reload the Prometheus configuration. + // reloadStrategy defines the strategy used to reload the Prometheus configuration. // If not specified, the configuration is reloaded using the /-/reload HTTP endpoint. // +optional ReloadStrategy *ReloadStrategyType `json:"reloadStrategy,omitempty"` - // Defines the maximum time that the `prometheus` container's startup probe will wait before being considered failed. The startup probe will return success after the WAL replay is complete. - // If set, the value should be greater than 60 (seconds). Otherwise it will be equal to 600 seconds (15 minutes). + // maximumStartupDurationSeconds defines the maximum time that the `prometheus` container's startup probe will wait before being considered failed. The startup probe will return success after the WAL replay is complete. + // If set, the value should be greater than 60 (seconds). Otherwise it will be equal to 900 seconds (15 minutes). // +optional // +kubebuilder:validation:Minimum=60 MaximumStartupDurationSeconds *int32 `json:"maximumStartupDurationSeconds,omitempty"` - // List of scrape classes to expose to scraping objects such as + // scrapeClasses defines the list of scrape classes to expose to scraping objects such as // PodMonitors, ServiceMonitors, Probes and ScrapeConfigs. // // This is an *experimental feature*, it may change in any upcoming release @@ -875,9 +917,10 @@ type CommonPrometheusFields struct { // // +listType=map // +listMapKey=name + // +optional ScrapeClasses []ScrapeClass `json:"scrapeClasses,omitempty"` - // Defines the service discovery role used to discover targets from + // serviceDiscoveryRole defines the service discovery role used to discover targets from // `ServiceMonitor` objects and Alertmanager endpoints. // // If set, the value should be either "Endpoints" or "EndpointSlice". @@ -886,13 +929,13 @@ type CommonPrometheusFields struct { // +optional ServiceDiscoveryRole *ServiceDiscoveryRole `json:"serviceDiscoveryRole,omitempty"` - // Defines the runtime reloadable configuration of the timeseries database(TSDB). + // tsdb defines the runtime reloadable configuration of the timeseries database(TSDB). // It requires Prometheus >= v2.39.0 or PrometheusAgent >= v2.54.0. // // +optional TSDB *TSDBSpec `json:"tsdb,omitempty"` - // File to which scrape failures are logged. + // scrapeFailureLogFile defines the file to which scrape failures are logged. // Reloading the configuration will reopen the file. // // If the filename has an empty path, e.g. 'file.log', The Prometheus Pods @@ -905,7 +948,7 @@ type CommonPrometheusFields struct { // +optional ScrapeFailureLogFile *string `json:"scrapeFailureLogFile,omitempty"` - // The name of the service name used by the underlying StatefulSet(s) as the governing service. + // serviceName defines the name of the service name used by the underlying StatefulSet(s) as the governing service. // If defined, the Service must be created before the Prometheus/PrometheusAgent resource in the same namespace and it must define a selector that matches the pod labels. // If empty, the operator will create and manage a headless service named `prometheus-operated` for Prometheus resources, // or `prometheus-agent-operated` for PrometheusAgent resources. @@ -915,11 +958,11 @@ type CommonPrometheusFields struct { // +kubebuilder:validation:MinLength=1 ServiceName *string `json:"serviceName,omitempty"` - // RuntimeConfig configures the values for the Prometheus process behavior + // runtime defines the values for the Prometheus process behavior // +optional Runtime *RuntimeConfig `json:"runtime,omitempty"` - // Optional duration in seconds the pod needs to terminate gracefully. + // terminationGracePeriodSeconds defines the optional duration in seconds the pod needs to terminate gracefully. // Value must be non-negative integer. The value zero indicates stop immediately via // the kill signal (no opportunity to shut down) which may lead to data corruption. // @@ -929,7 +972,7 @@ type CommonPrometheusFields struct { // +optional TerminationGracePeriodSeconds *int64 `json:"terminationGracePeriodSeconds,omitempty"` - // HostUsers supports the user space in Kubernetes. + // hostUsers supports the user space in Kubernetes. // // More info: https://kubernetes.io/docs/tasks/configure-pod-container/user-namespaces/ // @@ -1040,14 +1083,19 @@ func (cpf *CommonPrometheusFields) WebRoutePrefix() string { // // The Operator continuously reconciles the scrape and rules configuration and a sidecar container running in the Prometheus pods triggers a reload of the configuration when needed. type Prometheus struct { - metav1.TypeMeta `json:",inline"` + // TypeMeta defines the versioned schema of this representation of an object. + metav1.TypeMeta `json:",inline"` + // metadata defines ObjectMeta as the metadata that all persisted resources. + // +optional metav1.ObjectMeta `json:"metadata,omitempty"` - // Specification of the desired behavior of the Prometheus cluster. More info: + // spec defines the specification of the desired behavior of the Prometheus cluster. More info: // https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#spec-and-status + // +required Spec PrometheusSpec `json:"spec"` - // Most recent observed status of the Prometheus cluster. Read-only. + // status defines the most recent observed status of the Prometheus cluster. Read-only. // More info: // https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#spec-and-status + // +optional Status PrometheusStatus `json:"status,omitempty"` } @@ -1059,9 +1107,11 @@ func (l *Prometheus) DeepCopyObject() runtime.Object { // PrometheusList is a list of Prometheuses. // +k8s:openapi-gen=true type PrometheusList struct { + // TypeMeta defines the versioned schema of this representation of an object. + // +optional metav1.TypeMeta `json:",inline"` - // Standard list metadata - // More info: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#metadata + // metadata defines ListMeta as metadata for collection responses. + // +optional metav1.ListMeta `json:"metadata,omitempty"` // List of Prometheuses Items []Prometheus `json:"items"` @@ -1076,23 +1126,29 @@ func (l *PrometheusList) DeepCopyObject() runtime.Object { // https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#spec-and-status // +k8s:openapi-gen=true type PrometheusSpec struct { + // +optional CommonPrometheusFields `json:",inline"` - // Deprecated: use 'spec.image' instead. + // baseImage is deprecated: use 'spec.image' instead. + // +optional BaseImage string `json:"baseImage,omitempty"` - // Deprecated: use 'spec.image' instead. The image's tag can be specified as part of the image name. + // tag is deprecated: use 'spec.image' instead. The image's tag can be specified as part of the image name. + // +optional Tag string `json:"tag,omitempty"` - // Deprecated: use 'spec.image' instead. The image's digest can be specified as part of the image name. + // sha is deprecated: use 'spec.image' instead. The image's digest can be specified as part of the image name. + // +optional SHA string `json:"sha,omitempty"` - // How long to retain the Prometheus data. + // retention defines how long to retain the Prometheus data. // // Default: "24h" if `spec.retention` and `spec.retentionSize` are empty. + // +optional Retention Duration `json:"retention,omitempty"` - // Maximum number of bytes used by the Prometheus data. + // retentionSize defines the maximum number of bytes used by the Prometheus data. + // +optional RetentionSize ByteSize `json:"retentionSize,omitempty"` - // ShardRetentionPolicy defines the retention policy for the Prometheus shards. + // shardRetentionPolicy defines the retention policy for the Prometheus shards. // (Alpha) Using this field requires the 'PrometheusShardRetentionPolicy' feature gate to be enabled. // // The final goals for this feature can be seen at https://github.com/prometheus-operator/prometheus-operator/blob/main/Documentation/proposals/202310-shard-autoscaling.md#graceful-scale-down-of-prometheus-servers, @@ -1102,38 +1158,40 @@ type PrometheusSpec struct { // +optional ShardRetentionPolicy *ShardRetentionPolicy `json:"shardRetentionPolicy,omitempty"` - // When true, the Prometheus compaction is disabled. + // disableCompaction when true, the Prometheus compaction is disabled. // When `spec.thanos.objectStorageConfig` or `spec.objectStorageConfigFile` are defined, the operator automatically // disables block compaction to avoid race conditions during block uploads (as the Thanos documentation recommends). + // +optional DisableCompaction bool `json:"disableCompaction,omitempty"` - // Defines the configuration of the Prometheus rules' engine. + // rules defines the configuration of the Prometheus rules' engine. + // +optional Rules Rules `json:"rules,omitempty"` - // Defines the list of PrometheusRule objects to which the namespace label + // prometheusRulesExcludedFromEnforce defines the list of PrometheusRule objects to which the namespace label // enforcement doesn't apply. // This is only relevant when `spec.enforcedNamespaceLabel` is set to true. // +optional // Deprecated: use `spec.excludedFromEnforcement` instead. PrometheusRulesExcludedFromEnforce []PrometheusRuleExcludeConfig `json:"prometheusRulesExcludedFromEnforce,omitempty"` - // PrometheusRule objects to be selected for rule evaluation. An empty + // ruleSelector defines the prometheusRule objects to be selected for rule evaluation. An empty // label selector matches all objects. A null label selector matches no // objects. // +optional RuleSelector *metav1.LabelSelector `json:"ruleSelector,omitempty"` - // Namespaces to match for PrometheusRule discovery. An empty label selector + // ruleNamespaceSelector defines the namespaces to match for PrometheusRule discovery. An empty label selector // matches all namespaces. A null label selector matches the current // namespace only. // +optional RuleNamespaceSelector *metav1.LabelSelector `json:"ruleNamespaceSelector,omitempty"` - // QuerySpec defines the configuration of the Promethus query service. + // query defines the configuration of the Prometheus query service. // +optional Query *QuerySpec `json:"query,omitempty"` - // Defines the settings related to Alertmanager. + // alerting defines the settings related to Alertmanager. // +optional Alerting *AlertingSpec `json:"alerting,omitempty"` - // AdditionalAlertRelabelConfigs specifies a key of a Secret containing + // additionalAlertRelabelConfigs defines a key of a Secret containing // additional Prometheus alert relabel configurations. The alert relabel // configurations are appended to the configuration generated by the // Prometheus Operator. They must be formatted according to the official @@ -1149,7 +1207,7 @@ type PrometheusSpec struct { // Prometheus after the upgrade. // +optional AdditionalAlertRelabelConfigs *v1.SecretKeySelector `json:"additionalAlertRelabelConfigs,omitempty"` - // AdditionalAlertManagerConfigs specifies a key of a Secret containing + // additionalAlertManagerConfigs defines a key of a Secret containing // additional Prometheus Alertmanager configurations. The Alertmanager // configurations are appended to the configuration generated by the // Prometheus Operator. They must be formatted according to the official @@ -1166,11 +1224,11 @@ type PrometheusSpec struct { // +optional AdditionalAlertManagerConfigs *v1.SecretKeySelector `json:"additionalAlertManagerConfigs,omitempty"` - // Defines the list of remote read configurations. + // remoteRead defines the list of remote read configurations. // +optional RemoteRead []RemoteReadSpec `json:"remoteRead,omitempty"` - // Defines the configuration of the optional Thanos sidecar. + // thanos defines the configuration of the optional Thanos sidecar. // // +optional Thanos *ThanosSpec `json:"thanos,omitempty"` @@ -1186,30 +1244,33 @@ type PrometheusSpec struct { // Alternatively, the location can be set to a standard I/O stream, e.g. // `/dev/stdout`, to log query information to the default Prometheus log // stream. + // +optional QueryLogFile string `json:"queryLogFile,omitempty"` - // AllowOverlappingBlocks enables vertical compaction and vertical query + // allowOverlappingBlocks enables vertical compaction and vertical query // merge in Prometheus. // // Deprecated: this flag has no effect for Prometheus >= 2.39.0 where overlapping blocks are enabled by default. + // +optional AllowOverlappingBlocks bool `json:"allowOverlappingBlocks,omitempty"` - // Exemplars related settings that are runtime reloadable. + // exemplars related settings that are runtime reloadable. // It requires to enable the `exemplar-storage` feature flag to be effective. // +optional Exemplars *Exemplars `json:"exemplars,omitempty"` - // Interval between rule evaluations. + // evaluationInterval defines the interval between rule evaluations. // Default: "30s" // +kubebuilder:default:="30s" + // +optional EvaluationInterval Duration `json:"evaluationInterval,omitempty"` - // Defines the offset the rule evaluation timestamp of this particular group by the specified duration into the past. + // ruleQueryOffset defines the offset the rule evaluation timestamp of this particular group by the specified duration into the past. // It requires Prometheus >= v2.53.0. // +optional RuleQueryOffset *Duration `json:"ruleQueryOffset,omitempty"` - // Enables access to the Prometheus web admin API. + // enableAdminAPI defines access to the Prometheus web admin API. // // WARNING: Enabling the admin APIs enables mutating endpoints, to delete data, // shutdown Prometheus, and more. Enabling this should be done with care and the @@ -1218,6 +1279,7 @@ type PrometheusSpec struct { // // For more information: // https://prometheus.io/docs/prometheus/latest/querying/api/#tsdb-admin-apis + // +optional EnableAdminAPI bool `json:"enableAdminAPI,omitempty"` } @@ -1229,12 +1291,13 @@ var ( ) type RetainConfig struct { + // retentionPeriod defines the retentionPeriod for shard retention policy. // +required RetentionPeriod Duration `json:"retentionPeriod"` } type ShardRetentionPolicy struct { - // Defines the retention policy when the Prometheus shards are scaled down. + // whenScaled defines the retention policy when the Prometheus shards are scaled down. // * `Delete`, the operator will delete the pods from the scaled-down shard(s). // * `Retain`, the operator will keep the pods from the scaled-down shard(s), so the data can still be queried. // @@ -1242,45 +1305,45 @@ type ShardRetentionPolicy struct { // +kubebuilder:validation:Enum=Retain;Delete // +optional WhenScaled *WhenScaledRetentionType `json:"whenScaled,omitempty"` - // Defines the config for retention when the retention policy is set to `Retain`. + // retain defines the config for retention when the retention policy is set to `Retain`. // This field is ineffective as of now. // +optional Retain *RetainConfig `json:"retain,omitempty"` } type PrometheusTracingConfig struct { - // Client used to export the traces. Supported values are `http` or `grpc`. + // clientType defines the client used to export the traces. Supported values are `http` or `grpc`. // +kubebuilder:validation:Enum=http;grpc // +optional ClientType *string `json:"clientType"` - // Endpoint to send the traces to. Should be provided in format :. + // endpoint to send the traces to. Should be provided in format :. // +kubebuilder:validation:MinLength:=1 // +required Endpoint string `json:"endpoint"` - // Sets the probability a given trace will be sampled. Must be a float from 0 through 1. + // samplingFraction defines the probability a given trace will be sampled. Must be a float from 0 through 1. // +optional SamplingFraction *resource.Quantity `json:"samplingFraction"` - // If disabled, the client will use a secure connection. + // insecure if disabled, the client will use a secure connection. // +optional Insecure *bool `json:"insecure"` - // Key-value pairs to be used as headers associated with gRPC or HTTP requests. + // headers defines the key-value pairs to be used as headers associated with gRPC or HTTP requests. // +optional Headers map[string]string `json:"headers"` - // Compression key for supported compression types. The only supported value is `gzip`. + // compression key for supported compression types. The only supported value is `gzip`. // +kubebuilder:validation:Enum=gzip // +optional Compression *string `json:"compression"` - // Maximum time the exporter will wait for each batch export. + // timeout defines the maximum time the exporter will wait for each batch export. // +optional Timeout *Duration `json:"timeout"` - // TLS Config to use when sending traces. + // tlsConfig to use when sending traces. // +optional TLSConfig *TLSConfig `json:"tlsConfig"` } @@ -1290,40 +1353,48 @@ type PrometheusTracingConfig struct { // https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#spec-and-status // +k8s:openapi-gen=true type PrometheusStatus struct { - // Represents whether any actions on the underlying managed objects are + // paused defines whether any actions on the underlying managed objects are // being performed. Only delete actions will be performed. + // +optional Paused bool `json:"paused"` - // Total number of non-terminated pods targeted by this Prometheus deployment + // replicas defines the total number of non-terminated pods targeted by this Prometheus deployment // (their labels match the selector). + // +optional Replicas int32 `json:"replicas"` - // Total number of non-terminated pods targeted by this Prometheus deployment + // updatedReplicas defines the total number of non-terminated pods targeted by this Prometheus deployment // that have the desired version spec. + // +optional UpdatedReplicas int32 `json:"updatedReplicas"` - // Total number of available pods (ready for at least minReadySeconds) + // availableReplicas defines the total number of available pods (ready for at least minReadySeconds) // targeted by this Prometheus deployment. + // +optional AvailableReplicas int32 `json:"availableReplicas"` - // Total number of unavailable pods targeted by this Prometheus deployment. + // unavailableReplicas defines the total number of unavailable pods targeted by this Prometheus deployment. + // +optional UnavailableReplicas int32 `json:"unavailableReplicas"` - // The current state of the Prometheus deployment. + // conditions defines the current state of the Prometheus deployment. // +listType=map // +listMapKey=type // +optional Conditions []Condition `json:"conditions,omitempty"` - // The list has one entry per shard. Each entry provides a summary of the shard status. + // shardStatuses defines the list has one entry per shard. Each entry provides a summary of the shard status. // +listType=map // +listMapKey=shardID // +optional ShardStatuses []ShardStatus `json:"shardStatuses,omitempty"` - // Shards is the most recently observed number of shards. + // shards defines the most recently observed number of shards. + // +optional Shards int32 `json:"shards,omitempty"` - // The selector used to match the pods targeted by this Prometheus resource. + // selector used to match the pods targeted by this Prometheus resource. + // +optional Selector string `json:"selector,omitempty"` } // AlertingSpec defines parameters for alerting configuration of Prometheus servers. // +k8s:openapi-gen=true type AlertingSpec struct { - // Alertmanager endpoints where Prometheus should send alerts to. + // alertmanagers endpoints where Prometheus should send alerts to. + // +required Alertmanagers []AlertmanagerEndpoints `json:"alertmanagers"` } @@ -1337,39 +1408,43 @@ type AlertingSpec struct { // // +k8s:openapi-gen=true type StorageSpec struct { - // Deprecated: subPath usage will be removed in a future release. + // disableMountSubPath deprecated: subPath usage will be removed in a future release. + // +optional DisableMountSubPath bool `json:"disableMountSubPath,omitempty"` - // EmptyDirVolumeSource to be used by the StatefulSet. + // emptyDir to be used by the StatefulSet. // If specified, it takes precedence over `ephemeral` and `volumeClaimTemplate`. // More info: https://kubernetes.io/docs/concepts/storage/volumes/#emptydir + // +optional EmptyDir *v1.EmptyDirVolumeSource `json:"emptyDir,omitempty"` - // EphemeralVolumeSource to be used by the StatefulSet. + // ephemeral to be used by the StatefulSet. // This is a beta field in k8s 1.21 and GA in 1.15. // For lower versions, starting with k8s 1.19, it requires enabling the GenericEphemeralVolume feature gate. // More info: https://kubernetes.io/docs/concepts/storage/ephemeral-volumes/#generic-ephemeral-volumes + // +optional Ephemeral *v1.EphemeralVolumeSource `json:"ephemeral,omitempty"` - // Defines the PVC spec to be used by the Prometheus StatefulSets. + // volumeClaimTemplate defines the PVC spec to be used by the Prometheus StatefulSets. // The easiest way to use a volume that cannot be automatically provisioned // is to use a label selector alongside manually created PersistentVolumes. + // +optional VolumeClaimTemplate EmbeddedPersistentVolumeClaim `json:"volumeClaimTemplate,omitempty"` } // QuerySpec defines the query command line flags when starting Prometheus. // +k8s:openapi-gen=true type QuerySpec struct { - // The delta difference allowed for retrieving metrics during expression evaluations. + // lookbackDelta defines the delta difference allowed for retrieving metrics during expression evaluations. // +optional LookbackDelta *string `json:"lookbackDelta,omitempty"` - // Number of concurrent queries that can be run at once. + // maxConcurrency defines the number of concurrent queries that can be run at once. // +kubebuilder:validation:Minimum:=1 // +optional MaxConcurrency *int32 `json:"maxConcurrency,omitempty"` - // Maximum number of samples a single query can load into memory. Note that + // maxSamples defines the maximum number of samples a single query can load into memory. Note that // queries will fail if they would load more samples than this into memory, // so this also limits the number of samples a query can return. // +optional MaxSamples *int32 `json:"maxSamples,omitempty"` - // Maximum time a query may take before being aborted. + // timeout defines the maximum time a query may take before being aborted. // +optional Timeout *Duration `json:"timeout,omitempty"` } @@ -1377,13 +1452,13 @@ type QuerySpec struct { // PrometheusWebSpec defines the configuration of the Prometheus web server. // +k8s:openapi-gen=true type PrometheusWebSpec struct { + // +optional WebConfigFileFields `json:",inline"` - - // The prometheus web page title. + // pageTitle defines the prometheus web page title. // +optional PageTitle *string `json:"pageTitle,omitempty"` - // Defines the maximum number of simultaneous connections + // maxConnections defines the maximum number of simultaneous connections // A zero value means that Prometheus doesn't accept any incoming connection. // +kubebuilder:validation:Minimum:=0 // +optional @@ -1393,7 +1468,7 @@ type PrometheusWebSpec struct { // ThanosSpec defines the configuration of the Thanos sidecar. // +k8s:openapi-gen=true type ThanosSpec struct { - // Container image name for Thanos. If specified, it takes precedence over + // image defines the container image name for Thanos. If specified, it takes precedence over // the `spec.thanos.baseImage`, `spec.thanos.tag` and `spec.thanos.sha` // fields. // @@ -1407,7 +1482,7 @@ type ThanosSpec struct { // +optional Image *string `json:"image,omitempty"` - // Version of Thanos being deployed. The operator uses this information + // version of Thanos being deployed. The operator uses this information // to generate the Prometheus StatefulSet + configuration files. // // If not specified, the operator assumes the latest upstream release of @@ -1416,28 +1491,28 @@ type ThanosSpec struct { // // +optional Version *string `json:"version,omitempty"` - + // tag is deprecated: use 'image' instead. The image's tag can be specified as as part of the image name. // +optional - // Deprecated: use 'image' instead. The image's tag can be specified as as part of the image name. Tag *string `json:"tag,omitempty"` + // sha is deprecated: use 'image' instead. The image digest can be specified as part of the image name. // +optional - // Deprecated: use 'image' instead. The image digest can be specified as part of the image name. SHA *string `json:"sha,omitempty"` + // baseImage is deprecated: use 'image' instead. // +optional - // Deprecated: use 'image' instead. BaseImage *string `json:"baseImage,omitempty"` - // Defines the resources requests and limits of the Thanos sidecar. + // resources defines the resources requests and limits of the Thanos sidecar. + // +optional Resources v1.ResourceRequirements `json:"resources,omitempty"` - // Defines the Thanos sidecar's configuration to upload TSDB blocks to object storage. + // objectStorageConfig defines the Thanos sidecar's configuration to upload TSDB blocks to object storage. // // More info: https://thanos.io/tip/thanos/storage.md/ // // objectStorageConfigFile takes precedence over this field. // +optional ObjectStorageConfig *v1.SecretKeySelector `json:"objectStorageConfig,omitempty"` - // Defines the Thanos sidecar's configuration file to upload TSDB blocks to object storage. + // objectStorageConfigFile defines the Thanos sidecar's configuration file to upload TSDB blocks to object storage. // // More info: https://thanos.io/tip/thanos/storage.md/ // @@ -1445,22 +1520,25 @@ type ThanosSpec struct { // +optional ObjectStorageConfigFile *string `json:"objectStorageConfigFile,omitempty"` - // Deprecated: use `grpcListenLocal` and `httpListenLocal` instead. + // listenLocal is deprecated: use `grpcListenLocal` and `httpListenLocal` instead. + // +optional ListenLocal bool `json:"listenLocal,omitempty"` - // When true, the Thanos sidecar listens on the loopback interface instead + // grpcListenLocal defines when true, the Thanos sidecar listens on the loopback interface instead // of the Pod IP's address for the gRPC endpoints. // // It has no effect if `listenLocal` is true. + // +optional GRPCListenLocal bool `json:"grpcListenLocal,omitempty"` - // When true, the Thanos sidecar listens on the loopback interface instead + // httpListenLocal when true, the Thanos sidecar listens on the loopback interface instead // of the Pod IP's address for the HTTP endpoints. // // It has no effect if `listenLocal` is true. + // +optional HTTPListenLocal bool `json:"httpListenLocal,omitempty"` - // Defines the tracing configuration for the Thanos sidecar. + // tracingConfig defines the tracing configuration for the Thanos sidecar. // // `tracingConfigFile` takes precedence over this field. // @@ -1471,7 +1549,7 @@ type ThanosSpec struct { // // +optional TracingConfig *v1.SecretKeySelector `json:"tracingConfig,omitempty"` - // Defines the tracing configuration file for the Thanos sidecar. + // tracingConfigFile defines the tracing configuration file for the Thanos sidecar. // // This field takes precedence over `tracingConfig`. // @@ -1479,29 +1557,33 @@ type ThanosSpec struct { // // This is an *experimental feature*, it may change in any upcoming release // in a breaking way. + // +optional TracingConfigFile string `json:"tracingConfigFile,omitempty"` - // Configures the TLS parameters for the gRPC server providing the StoreAPI. + // grpcServerTlsConfig defines the TLS parameters for the gRPC server providing the StoreAPI. // // Note: Currently only the `caFile`, `certFile`, and `keyFile` fields are supported. // // +optional GRPCServerTLSConfig *TLSConfig `json:"grpcServerTlsConfig,omitempty"` - // Log level for the Thanos sidecar. + // logLevel for the Thanos sidecar. // +kubebuilder:validation:Enum="";debug;info;warn;error + // +optional LogLevel string `json:"logLevel,omitempty"` - // Log format for the Thanos sidecar. + // logFormat for the Thanos sidecar. // +kubebuilder:validation:Enum="";logfmt;json + // +optional LogFormat string `json:"logFormat,omitempty"` - // Defines the start of time range limit served by the Thanos sidecar's StoreAPI. + // minTime defines the start of time range limit served by the Thanos sidecar's StoreAPI. // The field's value should be a constant time in RFC3339 format or a time // duration relative to current time, such as -1d or 2h45m. Valid duration // units are ms, s, m, h, d, w, y. + // +optional MinTime string `json:"minTime,omitempty"` - // BlockDuration controls the size of TSDB blocks produced by Prometheus. + // blockSize controls the size of TSDB blocks produced by Prometheus. // The default value is 2h to match the upstream Prometheus defaults. // // WARNING: Changing the block duration can impact the performance and @@ -1511,23 +1593,27 @@ type ThanosSpec struct { // example, 30s * 120 = 1h. // // +kubebuilder:default:="2h" + // +optional BlockDuration Duration `json:"blockSize,omitempty"` - // ReadyTimeout is the maximum time that the Thanos sidecar will wait for + // readyTimeout defines the maximum time that the Thanos sidecar will wait for // Prometheus to start. + // +optional ReadyTimeout Duration `json:"readyTimeout,omitempty"` - // How often to retrieve the Prometheus configuration. + // getConfigInterval defines how often to retrieve the Prometheus configuration. + // +optional GetConfigInterval Duration `json:"getConfigInterval,omitempty"` - // Maximum time to wait when retrieving the Prometheus configuration. + // getConfigTimeout defines the maximum time to wait when retrieving the Prometheus configuration. + // +optional GetConfigTimeout Duration `json:"getConfigTimeout,omitempty"` - // VolumeMounts allows configuration of additional VolumeMounts for Thanos. + // volumeMounts allows configuration of additional VolumeMounts for Thanos. // VolumeMounts specified will be appended to other VolumeMounts in the // 'thanos-sidecar' container. // +optional VolumeMounts []v1.VolumeMount `json:"volumeMounts,omitempty"` - // AdditionalArgs allows setting additional arguments for the Thanos container. + // additionalArgs allows setting additional arguments for the Thanos container. // The arguments are passed as-is to the Thanos container which may cause issues // if they are invalid or not supported the given Thanos version. // In case of an argument conflict (e.g. an argument which is already set by the @@ -1541,20 +1627,20 @@ type ThanosSpec struct { // to a remote endpoint. // +k8s:openapi-gen=true type RemoteWriteSpec struct { - // The URL of the endpoint to send samples to. + // url defines the URL of the endpoint to send samples to. // +kubebuilder:validation:MinLength=1 // +required URL string `json:"url"` - // The name of the remote write queue, it must be unique if specified. The + // name of the remote write queue, it must be unique if specified. The // name is used in metrics and logging in order to differentiate queues. // // It requires Prometheus >= v2.15.0 or Thanos >= 0.24.0. // - //+optional + // +optional Name *string `json:"name,omitempty"` - // The Remote Write message's version to use when writing to the endpoint. + // messageVersion defines the Remote Write message's version to use when writing to the endpoint. // // `Version1.0` corresponds to the `prometheus.WriteRequest` protobuf message introduced in Remote Write 1.0. // `Version2.0` corresponds to the `io.prometheus.write.v2.Request` protobuf message introduced in Remote Write 2.0. @@ -1570,7 +1656,7 @@ type RemoteWriteSpec struct { // +optional MessageVersion *RemoteWriteMessageVersion `json:"messageVersion,omitempty"` - // Enables sending of exemplars over remote write. Note that + // sendExemplars enables sending of exemplars over remote write. Note that // exemplar-storage itself must be enabled using the `spec.enableFeatures` // option for exemplars to be scraped in the first place. // @@ -1579,7 +1665,7 @@ type RemoteWriteSpec struct { // +optional SendExemplars *bool `json:"sendExemplars,omitempty"` - // Enables sending of native histograms, also known as sparse histograms + // sendNativeHistograms enables sending of native histograms, also known as sparse histograms // over remote write. // // It requires Prometheus >= v2.40.0 or Thanos >= v0.30.0. @@ -1587,11 +1673,11 @@ type RemoteWriteSpec struct { // +optional SendNativeHistograms *bool `json:"sendNativeHistograms,omitempty"` - // Timeout for requests to the remote write endpoint. + // remoteTimeout defines the timeout for requests to the remote write endpoint. // +optional RemoteTimeout *Duration `json:"remoteTimeout,omitempty"` - // Custom HTTP headers to be sent along with each remote write request. + // headers defines the custom HTTP headers to be sent along with each remote write request. // Be aware that headers that are set by Prometheus itself can't be overwritten. // // It requires Prometheus >= v2.25.0 or Thanos >= v0.24.0. @@ -1599,11 +1685,11 @@ type RemoteWriteSpec struct { // +optional Headers map[string]string `json:"headers,omitempty"` - // The list of remote write relabel configurations. + // writeRelabelConfigs defines the list of remote write relabel configurations. // +optional WriteRelabelConfigs []RelabelConfig `json:"writeRelabelConfigs,omitempty"` - // OAuth2 configuration for the URL. + // oauth2 configuration for the URL. // // It requires Prometheus >= v2.27.0 or Thanos >= v0.24.0. // @@ -1611,19 +1697,20 @@ type RemoteWriteSpec struct { // +optional OAuth2 *OAuth2 `json:"oauth2,omitempty"` - // BasicAuth configuration for the URL. + // basicAuth configuration for the URL. // // Cannot be set at the same time as `sigv4`, `authorization`, `oauth2`, or `azureAd`. // // +optional BasicAuth *BasicAuth `json:"basicAuth,omitempty"` - // File from which to read bearer token for the URL. + // bearerTokenFile defines the file from which to read bearer token for the URL. // // Deprecated: this will be removed in a future release. Prefer using `authorization`. + // +optional BearerTokenFile string `json:"bearerTokenFile,omitempty"` - // Authorization section for the URL. + // authorization section for the URL. // // It requires Prometheus >= v2.26.0 or Thanos >= v0.24.0. // @@ -1632,7 +1719,7 @@ type RemoteWriteSpec struct { // +optional Authorization *Authorization `json:"authorization,omitempty"` - // Sigv4 allows to configures AWS's Signature Verification 4 for the URL. + // sigv4 defines the AWS's Signature Verification 4 for the URL. // // It requires Prometheus >= v2.26.0 or Thanos >= v0.24.0. // @@ -1641,7 +1728,7 @@ type RemoteWriteSpec struct { // +optional Sigv4 *Sigv4 `json:"sigv4,omitempty"` - // AzureAD for the URL. + // azureAd for the URL. // // It requires Prometheus >= v2.45.0 or Thanos >= v0.31.0. // @@ -1650,13 +1737,14 @@ type RemoteWriteSpec struct { // +optional AzureAD *AzureAD `json:"azureAd,omitempty"` + // bearerToken is deprecated: this will be removed in a future release. // *Warning: this field shouldn't be used because the token value appears // in clear-text. Prefer using `authorization`.* // - // Deprecated: this will be removed in a future release. + // +optional BearerToken string `json:"bearerToken,omitempty"` - // TLS Config to use for the URL. + // tlsConfig to use for the URL. // +optional TLSConfig *TLSConfig `json:"tlsConfig,omitempty"` @@ -1664,35 +1752,37 @@ type RemoteWriteSpec struct { // +optional ProxyConfig `json:",inline"` - // Configure whether HTTP requests follow HTTP 3xx redirects. + // followRedirects defines whether HTTP requests follow HTTP 3xx redirects. // // It requires Prometheus >= v2.26.0 or Thanos >= v0.24.0. // // +optional FollowRedirects *bool `json:"followRedirects,omitempty"` - // QueueConfig allows tuning of the remote write queue parameters. + // queueConfig allows tuning of the remote write queue parameters. // +optional QueueConfig *QueueConfig `json:"queueConfig,omitempty"` - // MetadataConfig configures the sending of series metadata to the remote storage. + // metadataConfig defines how to send a series metadata to the remote storage. // +optional MetadataConfig *MetadataConfig `json:"metadataConfig,omitempty"` - // Whether to enable HTTP2. + // enableHTTP2 defines whether to enable HTTP2. // +optional EnableHttp2 *bool `json:"enableHTTP2,omitempty"` + // roundRobinDNS controls the DNS resolution behavior for remote-write connections. // When enabled: - // - The remote-write mechanism will resolve the hostname via DNS. - // - It will randomly select one of the resolved IP addresses and connect to it. + // - The remote-write mechanism will resolve the hostname via DNS. + // - It will randomly select one of the resolved IP addresses and connect to it. // // When disabled (default behavior): - // - The Go standard library will handle hostname resolution. - // - It will attempt connections to each resolved IP address sequentially. + // - The Go standard library will handle hostname resolution. + // - It will attempt connections to each resolved IP address sequentially. // // Note: The connection timeout applies to the entire resolution and connection process. - // If disabled, the timeout is distributed across all connection attempts. + // + // If disabled, the timeout is distributed across all connection attempts. // // It requires Prometheus >= v3.1.0 or Thanos >= v0.38.0. // @@ -1714,77 +1804,91 @@ const ( // This object is referenced in the RemoteWriteSpec object. // +k8s:openapi-gen=true type QueueConfig struct { - // Capacity is the number of samples to buffer per shard before we start + // capacity defines the number of samples to buffer per shard before we start // dropping them. + // +optional Capacity int `json:"capacity,omitempty"` - // MinShards is the minimum number of shards, i.e. amount of concurrency. + // minShards defines the minimum number of shards, i.e. amount of concurrency. + // +optional MinShards int `json:"minShards,omitempty"` - // MaxShards is the maximum number of shards, i.e. amount of concurrency. + // maxShards defines the maximum number of shards, i.e. amount of concurrency. + // +optional MaxShards int `json:"maxShards,omitempty"` - // MaxSamplesPerSend is the maximum number of samples per send. + // maxSamplesPerSend defines the maximum number of samples per send. + // +optional MaxSamplesPerSend int `json:"maxSamplesPerSend,omitempty"` - // BatchSendDeadline is the maximum time a sample will wait in buffer. + // batchSendDeadline defines the maximum time a sample will wait in buffer. // +optional BatchSendDeadline *Duration `json:"batchSendDeadline,omitempty"` - // MaxRetries is the maximum number of times to retry a batch on recoverable errors. + // maxRetries defines the maximum number of times to retry a batch on recoverable errors. + // +optional MaxRetries int `json:"maxRetries,omitempty"` - // MinBackoff is the initial retry delay. Gets doubled for every retry. + // minBackoff defines the initial retry delay. Gets doubled for every retry. // +optional MinBackoff *Duration `json:"minBackoff,omitempty"` - // MaxBackoff is the maximum retry delay. + // maxBackoff defines the maximum retry delay. // +optional MaxBackoff *Duration `json:"maxBackoff,omitempty"` - // Retry upon receiving a 429 status code from the remote-write storage. + // retryOnRateLimit defines the retry upon receiving a 429 status code from the remote-write storage. // // This is an *experimental feature*, it may change in any upcoming release // in a breaking way. + // +optional RetryOnRateLimit bool `json:"retryOnRateLimit,omitempty"` - // SampleAgeLimit drops samples older than the limit. + // sampleAgeLimit drops samples older than the limit. // It requires Prometheus >= v2.50.0 or Thanos >= v0.32.0. // // +optional SampleAgeLimit *Duration `json:"sampleAgeLimit,omitempty"` } -// Sigv4 optionally configures AWS's Signature Verification 4 signing process to +// Sigv4 defines AWS's Signature Verification 4 signing process to // sign requests. // +k8s:openapi-gen=true type Sigv4 struct { - // Region is the AWS region. If blank, the region from the default credentials chain used. + // region defines the AWS region. If blank, the region from the default credentials chain used. + // +optional Region string `json:"region,omitempty"` - // AccessKey is the AWS API key. If not specified, the environment variable + // accessKey defines the AWS API key. If not specified, the environment variable // `AWS_ACCESS_KEY_ID` is used. // +optional AccessKey *v1.SecretKeySelector `json:"accessKey,omitempty"` - // SecretKey is the AWS API secret. If not specified, the environment + // secretKey defines the AWS API secret. If not specified, the environment // variable `AWS_SECRET_ACCESS_KEY` is used. // +optional SecretKey *v1.SecretKeySelector `json:"secretKey,omitempty"` - // Profile is the named AWS profile used to authenticate. + // profile defines the named AWS profile used to authenticate. + // +optional Profile string `json:"profile,omitempty"` - // RoleArn is the named AWS profile used to authenticate. + // roleArn defines the named AWS profile used to authenticate. + // +optional RoleArn string `json:"roleArn,omitempty"` + // useFIPSSTSEndpoint defines FIPS mode for AWS STS endpoint. + // It requires Prometheus >= v2.54.0. + // + // +optional + UseFIPSSTSEndpoint *bool `json:"useFIPSSTSEndpoint,omitempty"` } // AzureAD defines the configuration for remote write's azuread parameters. // +k8s:openapi-gen=true type AzureAD struct { - // The Azure Cloud. Options are 'AzurePublic', 'AzureChina', or 'AzureGovernment'. + // cloud defines the Azure Cloud. Options are 'AzurePublic', 'AzureChina', or 'AzureGovernment'. // +kubebuilder:validation:Enum=AzureChina;AzureGovernment;AzurePublic // +optional Cloud *string `json:"cloud,omitempty"` - // ManagedIdentity defines the Azure User-assigned Managed identity. + // managedIdentity defines the Azure User-assigned Managed identity. // Cannot be set at the same time as `oauth` or `sdk`. // +optional ManagedIdentity *ManagedIdentity `json:"managedIdentity,omitempty"` - // OAuth defines the oauth config that is being used to authenticate. + // oauth defines the oauth config that is being used to authenticate. // Cannot be set at the same time as `managedIdentity` or `sdk`. // // It requires Prometheus >= v2.48.0 or Thanos >= v0.31.0. // // +optional OAuth *AzureOAuth `json:"oauth,omitempty"` - // SDK defines the Azure SDK config that is being used to authenticate. + // sdk defines the Azure SDK config that is being used to authenticate. // See https://learn.microsoft.com/en-us/azure/developer/go/azure-sdk-authentication // Cannot be set at the same time as `oauth` or `managedIdentity`. // @@ -1796,14 +1900,14 @@ type AzureAD struct { // AzureOAuth defines the Azure OAuth settings. // +k8s:openapi-gen=true type AzureOAuth struct { - // `clientID` is the clientId of the Azure Active Directory application that is being used to authenticate. + // clientId defines the clientId of the Azure Active Directory application that is being used to authenticate. // +required // +kubebuilder:validation:MinLength=1 ClientID string `json:"clientId"` - // `clientSecret` specifies a key of a Secret containing the client secret of the Azure Active Directory application that is being used to authenticate. + // clientSecret specifies a key of a Secret containing the client secret of the Azure Active Directory application that is being used to authenticate. // +required ClientSecret v1.SecretKeySelector `json:"clientSecret"` - // `tenantId` is the tenant ID of the Azure Active Directory application that is being used to authenticate. + // tenantId is the tenant ID of the Azure Active Directory application that is being used to authenticate. // +required // +kubebuilder:validation:MinLength=1 // +kubebuilder:validation:Pattern:=^[0-9a-zA-Z-.]+$ @@ -1813,14 +1917,14 @@ type AzureOAuth struct { // ManagedIdentity defines the Azure User-assigned Managed identity. // +k8s:openapi-gen=true type ManagedIdentity struct { - // The client id + // clientId defines defines the Azure User-assigned Managed identity. // +required ClientID string `json:"clientId"` } // AzureSDK is used to store azure SDK config values. type AzureSDK struct { - // `tenantId` is the tenant ID of the azure active directory application that is being used to authenticate. + // tenantId defines the tenant ID of the azure active directory application that is being used to authenticate. // +optional // +kubebuilder:validation:Pattern:=^[0-9a-zA-Z-.]+$ TenantID *string `json:"tenantId,omitempty"` @@ -1830,37 +1934,40 @@ type AzureSDK struct { // from a remote endpoint. // +k8s:openapi-gen=true type RemoteReadSpec struct { - // The URL of the endpoint to query from. + // url defines the URL of the endpoint to query from. + // +required URL string `json:"url"` - // The name of the remote read queue, it must be unique if specified. The + // name of the remote read queue, it must be unique if specified. The // name is used in metrics and logging in order to differentiate read // configurations. // // It requires Prometheus >= v2.15.0. // + // +optional Name string `json:"name,omitempty"` - // An optional list of equality matchers which have to be present + // requiredMatchers defines an optional list of equality matchers which have to be present // in a selector to query the remote read endpoint. // +optional RequiredMatchers map[string]string `json:"requiredMatchers,omitempty"` - // Timeout for requests to the remote read endpoint. + // remoteTimeout defines the timeout for requests to the remote read endpoint. // +optional RemoteTimeout *Duration `json:"remoteTimeout,omitempty"` - // Custom HTTP headers to be sent along with each remote read request. + // headers defines the custom HTTP headers to be sent along with each remote read request. // Be aware that headers that are set by Prometheus itself can't be overwritten. // Only valid in Prometheus versions 2.26.0 and newer. // +optional Headers map[string]string `json:"headers,omitempty"` - // Whether reads should be made for queries for time ranges that + // readRecent defines whether reads should be made for queries for time ranges that // the local storage should have complete data for. + // +optional ReadRecent bool `json:"readRecent,omitempty"` - // OAuth2 configuration for the URL. + // oauth2 configuration for the URL. // // It requires Prometheus >= v2.27.0. // @@ -1868,17 +1975,18 @@ type RemoteReadSpec struct { // // +optional OAuth2 *OAuth2 `json:"oauth2,omitempty"` - // BasicAuth configuration for the URL. + // basicAuth configuration for the URL. // // Cannot be set at the same time as `authorization`, or `oauth2`. // // +optional BasicAuth *BasicAuth `json:"basicAuth,omitempty"` - // File from which to read the bearer token for the URL. + // bearerTokenFile defines the file from which to read the bearer token for the URL. // // Deprecated: this will be removed in a future release. Prefer using `authorization`. + // +optional BearerTokenFile string `json:"bearerTokenFile,omitempty"` - // Authorization section for the URL. + // authorization section for the URL. // // It requires Prometheus >= v2.26.0. // @@ -1887,13 +1995,14 @@ type RemoteReadSpec struct { // +optional Authorization *Authorization `json:"authorization,omitempty"` + // bearerToken is deprecated: this will be removed in a future release. // *Warning: this field shouldn't be used because the token value appears // in clear-text. Prefer using `authorization`.* // - // Deprecated: this will be removed in a future release. + // +optional BearerToken string `json:"bearerToken,omitempty"` - // TLS Config to use for the URL. + // tlsConfig to use for the URL. // +optional TLSConfig *TLSConfig `json:"tlsConfig,omitempty"` @@ -1901,14 +2010,14 @@ type RemoteReadSpec struct { // +optional ProxyConfig `json:",inline"` - // Configure whether HTTP requests follow HTTP 3xx redirects. + // followRedirects defines whether HTTP requests follow HTTP 3xx redirects. // // It requires Prometheus >= v2.26.0. // // +optional FollowRedirects *bool `json:"followRedirects,omitempty"` - // Whether to use the external labels as selectors for the remote read endpoint. + // filterExternalLabels defines whether to use the external labels as selectors for the remote read endpoint. // // It requires Prometheus >= v2.34.0. // @@ -1923,41 +2032,45 @@ type RemoteReadSpec struct { // // +k8s:openapi-gen=true type RelabelConfig struct { - // The source labels select values from existing labels. Their content is + // sourceLabels defines the source labels select values from existing labels. Their content is // concatenated using the configured Separator and matched against the // configured regular expression. // // +optional SourceLabels []LabelName `json:"sourceLabels,omitempty"` - // Separator is the string between concatenated SourceLabels. + // separator defines the string between concatenated SourceLabels. + // +optional Separator *string `json:"separator,omitempty"` - // Label to which the resulting string is written in a replacement. + // targetLabel defines the label to which the resulting string is written in a replacement. // // It is mandatory for `Replace`, `HashMod`, `Lowercase`, `Uppercase`, // `KeepEqual` and `DropEqual` actions. // // Regex capture groups are available. + // +optional TargetLabel string `json:"targetLabel,omitempty"` - // Regular expression against which the extracted value is matched. + // regex defines the regular expression against which the extracted value is matched. + // +optional Regex string `json:"regex,omitempty"` - // Modulus to take of the hash of the source label values. + // modulus to take of the hash of the source label values. // // Only applicable when the action is `HashMod`. + // +optional Modulus uint64 `json:"modulus,omitempty"` - // Replacement value against which a Replace action is performed if the + // replacement value against which a Replace action is performed if the // regular expression matches. // // Regex capture groups are available. // - //+optional + // +optional Replacement *string `json:"replacement,omitempty"` - // Action to perform based on the regex matching. + // action to perform based on the regex matching. // // `Uppercase` and `Lowercase` actions require Prometheus >= v2.36.0. // `DropEqual` and `KeepEqual` actions require Prometheus >= v2.41.0. @@ -1966,6 +2079,7 @@ type RelabelConfig struct { // // +kubebuilder:validation:Enum=replace;Replace;keep;Keep;drop;Drop;hashmod;HashMod;labelmap;LabelMap;labeldrop;LabelDrop;labelkeep;LabelKeep;lowercase;Lowercase;uppercase;Uppercase;keepequal;KeepEqual;dropequal;DropEqual // +kubebuilder:default=replace + // +optional Action string `json:"action,omitempty"` } @@ -1975,11 +2089,12 @@ type RelabelConfig struct { // // +k8s:openapi-gen=true type APIServerConfig struct { - // Kubernetes API address consisting of a hostname or IP address followed + // host defines the Kubernetes API address consisting of a hostname or IP address followed // by an optional port number. + // +required Host string `json:"host"` - // BasicAuth configuration for the API server. + // basicAuth configuration for the API server. // // Cannot be set at the same time as `authorization`, `bearerToken`, or // `bearerTokenFile`. @@ -1987,19 +2102,20 @@ type APIServerConfig struct { // +optional BasicAuth *BasicAuth `json:"basicAuth,omitempty"` - // File to read bearer token for accessing apiserver. + // bearerTokenFile defines the file to read bearer token for accessing apiserver. // // Cannot be set at the same time as `basicAuth`, `authorization`, or `bearerToken`. // // Deprecated: this will be removed in a future release. Prefer using `authorization`. + // +optional BearerTokenFile string `json:"bearerTokenFile,omitempty"` - // TLS Config to use for the API server. + // tlsConfig to use for the API server. // // +optional TLSConfig *TLSConfig `json:"tlsConfig,omitempty"` - // Authorization section for the API server. + // authorization section for the API server. // // Cannot be set at the same time as `basicAuth`, `bearerToken`, or // `bearerTokenFile`. @@ -2007,10 +2123,11 @@ type APIServerConfig struct { // +optional Authorization *Authorization `json:"authorization,omitempty"` - // *Warning: this field shouldn't be used because the token value appears + // bearerToken is deprecated: this will be removed in a future release. + // *Warning: this field shouldn't be used because the token value appears // in clear-text. Prefer using `authorization`.* // - // Deprecated: this will be removed in a future release. + // +optional BearerToken string `json:"bearerToken,omitempty"` // Optional ProxyConfig. @@ -2030,7 +2147,7 @@ const ( // containing Alertmanager IPs to fire alerts against. // +k8s:openapi-gen=true type AlertmanagerEndpoints struct { - // Namespace of the Endpoints object. + // namespace of the Endpoints object. // // If not set, the object will be discovered in the namespace of the // Prometheus object. @@ -2039,48 +2156,52 @@ type AlertmanagerEndpoints struct { // +optional Namespace *string `json:"namespace,omitempty"` - // Name of the Endpoints object in the namespace. + // name of the Endpoints object in the namespace. // // +kubebuilder:validation:MinLength:=1 // +required Name string `json:"name"` - // Port on which the Alertmanager API is exposed. + // port on which the Alertmanager API is exposed. + // +required Port intstr.IntOrString `json:"port"` - // Scheme to use when firing alerts. + // scheme to use when firing alerts. + // +optional Scheme string `json:"scheme,omitempty"` - // Prefix for the HTTP path alerts are pushed to. + // pathPrefix defines the prefix for the HTTP path alerts are pushed to. + // +optional PathPrefix string `json:"pathPrefix,omitempty"` - // TLS Config to use for Alertmanager. + // tlsConfig to use for Alertmanager. // // +optional TLSConfig *TLSConfig `json:"tlsConfig,omitempty"` - // BasicAuth configuration for Alertmanager. + // basicAuth configuration for Alertmanager. // // Cannot be set at the same time as `bearerTokenFile`, `authorization` or `sigv4`. // // +optional BasicAuth *BasicAuth `json:"basicAuth,omitempty"` - // File to read bearer token for Alertmanager. + // bearerTokenFile defines the file to read bearer token for Alertmanager. // // Cannot be set at the same time as `basicAuth`, `authorization`, or `sigv4`. // // Deprecated: this will be removed in a future release. Prefer using `authorization`. + // +optional BearerTokenFile string `json:"bearerTokenFile,omitempty"` - // Authorization section for Alertmanager. + // authorization section for Alertmanager. // // Cannot be set at the same time as `basicAuth`, `bearerTokenFile` or `sigv4`. // // +optional Authorization *SafeAuthorization `json:"authorization,omitempty"` - // Sigv4 allows to configures AWS's Signature Verification 4 for the URL. + // sigv4 defines AWS's Signature Verification 4 for the URL. // // It requires Prometheus >= v2.48.0. // @@ -2090,31 +2211,32 @@ type AlertmanagerEndpoints struct { Sigv4 *Sigv4 `json:"sigv4,omitempty"` // ProxyConfig + // +optional ProxyConfig `json:",inline"` - // Version of the Alertmanager API that Prometheus uses to send alerts. + // apiVersion defines the version of the Alertmanager API that Prometheus uses to send alerts. // It can be "V1" or "V2". // The field has no effect for Prometheus >= v3.0.0 because only the v2 API is supported. // // +optional APIVersion *AlertmanagerAPIVersion `json:"apiVersion,omitempty"` - // Timeout is a per-target Alertmanager timeout when pushing alerts. + // timeout defines a per-target Alertmanager timeout when pushing alerts. // // +optional Timeout *Duration `json:"timeout,omitempty"` - // Whether to enable HTTP2. + // enableHttp2 defines whether to enable HTTP2. // // +optional EnableHttp2 *bool `json:"enableHttp2,omitempty"` - // Relabel configuration applied to the discovered Alertmanagers. + // relabelings defines the relabel configuration applied to the discovered Alertmanagers. // // +optional RelabelConfigs []RelabelConfig `json:"relabelings,omitempty"` - // Relabeling configs applied before sending alerts to a specific Alertmanager. + // alertRelabelings defines the relabeling configs applied before sending alerts to a specific Alertmanager. // It requires Prometheus >= v2.51.0. // // +optional @@ -2123,26 +2245,30 @@ type AlertmanagerEndpoints struct { // +k8s:openapi-gen=true type Rules struct { - // Defines the parameters of the Prometheus rules' engine. + // alert defines the parameters of the Prometheus rules' engine. // // Any update to these parameters trigger a restart of the pods. + // +optional Alert RulesAlert `json:"alert,omitempty"` } // +k8s:openapi-gen=true type RulesAlert struct { - // Max time to tolerate prometheus outage for restoring 'for' state of + // forOutageTolerance defines the max time to tolerate prometheus outage for restoring 'for' state of // alert. + // +optional ForOutageTolerance string `json:"forOutageTolerance,omitempty"` - // Minimum duration between alert and restored 'for' state. + // forGracePeriod defines the minimum duration between alert and restored 'for' state. // // This is maintained only for alerts with a configured 'for' time greater // than the grace period. + // +optional ForGracePeriod string `json:"forGracePeriod,omitempty"` - // Minimum amount of time to wait before resending an alert to + // resendDelay defines the minimum amount of time to wait before resending an alert to // Alertmanager. + // +optional ResendDelay string `json:"resendDelay,omitempty"` } @@ -2150,13 +2276,15 @@ type RulesAlert struct { // // +k8s:openapi-gen=true type MetadataConfig struct { - // Defines whether metric metadata is sent to the remote storage or not. + // send defines whether metric metadata is sent to the remote storage or not. + // +optional Send bool `json:"send,omitempty"` - // Defines how frequently metric metadata is sent to the remote storage. + // sendInterval defines how frequently metric metadata is sent to the remote storage. + // +optional SendInterval Duration `json:"sendInterval,omitempty"` - // MaxSamplesPerSend is the maximum number of metadata samples per send. + // maxSamplesPerSend defines the maximum number of metadata samples per send. // // It requires Prometheus >= v2.29.0. // @@ -2166,23 +2294,27 @@ type MetadataConfig struct { } type ShardStatus struct { - // Identifier of the shard. + // shardID defines the identifier of the shard. // +required ShardID string `json:"shardID"` - // Total number of pods targeted by this shard. + // replicas defines the total number of pods targeted by this shard. + // +required Replicas int32 `json:"replicas"` - // Total number of non-terminated pods targeted by this shard + // updatedReplicas defines the total number of non-terminated pods targeted by this shard // that have the desired spec. + // +required UpdatedReplicas int32 `json:"updatedReplicas"` - // Total number of available pods (ready for at least minReadySeconds) + // availableReplicas defines the total number of available pods (ready for at least minReadySeconds) // targeted by this shard. + // +required AvailableReplicas int32 `json:"availableReplicas"` - // Total number of unavailable pods targeted by this shard. + // unavailableReplicas defines the Total number of unavailable pods targeted by this shard. + // +required UnavailableReplicas int32 `json:"unavailableReplicas"` } type TSDBSpec struct { - // Configures how old an out-of-order/out-of-bounds sample can be with + // outOfOrderTimeWindow defines how old an out-of-order/out-of-bounds sample can be with // respect to the TSDB max time. // // An out-of-order/out-of-bounds sample is ingested into the TSDB as long as @@ -2197,7 +2329,7 @@ type TSDBSpec struct { } type Exemplars struct { - // Maximum number of exemplars stored in memory for all series. + // maxSize defines the maximum number of exemplars stored in memory for all series. // // exemplar-storage itself must be enabled using the `spec.enableFeature` // option for exemplars to be scraped in the first place. @@ -2215,14 +2347,16 @@ type Exemplars struct { // // +k8s:openapi-gen=true type SafeAuthorization struct { - // Defines the authentication type. The value is case-insensitive. + // type defines the authentication type. The value is case-insensitive. // // "Basic" is not a supported value. // // Default: "Bearer" + // +optional Type string `json:"type,omitempty"` - // Selects a key of a Secret in the namespace that contains the credentials for authentication. + // credentials defines a key of a Secret in the namespace that contains the credentials for authentication. + // +optional Credentials *v1.SecretKeySelector `json:"credentials,omitempty"` } @@ -2233,20 +2367,22 @@ func (c *SafeAuthorization) Validate() error { } if strings.ToLower(strings.TrimSpace(c.Type)) == "basic" { - return &AuthorizationValidationError{`Authorization type cannot be set to "basic", use "basic_auth" instead`} + return errors.New("authorization type cannot be set to \"basic\", use \"basicAuth\" instead") } if c.Credentials == nil { - return &AuthorizationValidationError{"Authorization credentials are required"} + return errors.New("authorization credentials are required") } return nil } type Authorization struct { + // +optional SafeAuthorization `json:",inline"` - // File to read a secret from, mutually exclusive with `credentials`. + // credentialsFile defines the file to read a secret from, mutually exclusive with `credentials`. + // +optional CredentialsFile string `json:"credentialsFile,omitempty"` } @@ -2257,35 +2393,24 @@ func (c *Authorization) Validate() error { } if c.Credentials != nil && c.CredentialsFile != "" { - return &AuthorizationValidationError{"Authorization can not specify both Credentials and CredentialsFile"} + return errors.New("authorization can not specify both \"credentials\" and \"credentialsFile\"") } if strings.ToLower(strings.TrimSpace(c.Type)) == "basic" { - return &AuthorizationValidationError{"Authorization type cannot be set to \"basic\", use \"basic_auth\" instead"} + return errors.New("authorization type cannot be set to \"basic\", use \"basicAuth\" instead") } return nil } -// AuthorizationValidationError is returned by Authorization.Validate() -// on semantically invalid configurations. -// +k8s:openapi-gen=false -type AuthorizationValidationError struct { - err string -} - -func (e *AuthorizationValidationError) Error() string { - return e.err -} - type ScrapeClass struct { - // Name of the scrape class. + // name of the scrape class. // // +kubebuilder:validation:MinLength=1 // +required Name string `json:"name"` - // Default indicates that the scrape applies to all scrape objects that + // default defines that the scrape applies to all scrape objects that // don't configure an explicit scrape class name. // // Only one scrape class can be set as the default. @@ -2293,14 +2418,14 @@ type ScrapeClass struct { // +optional Default *bool `json:"default,omitempty"` - // The protocol to use if a scrape returns blank, unparseable, or otherwise invalid Content-Type. + // fallbackScrapeProtocol defines the protocol to use if a scrape returns blank, unparseable, or otherwise invalid Content-Type. // It will only apply if the scrape resource doesn't specify any FallbackScrapeProtocol // // It requires Prometheus >= v3.0.0. // +optional FallbackScrapeProtocol *ScrapeProtocol `json:"fallbackScrapeProtocol,omitempty"` - // TLSConfig defines the TLS settings to use for the scrape. When the + // tlsConfig defines the TLS settings to use for the scrape. When the // scrape objects define their own CA, certificate and/or key, they take // precedence over the corresponding scrape class fields. // @@ -2309,12 +2434,12 @@ type ScrapeClass struct { // +optional TLSConfig *TLSConfig `json:"tlsConfig,omitempty"` - // Authorization section for the ScrapeClass. + // authorization section for the ScrapeClass. // It will only apply if the scrape resource doesn't specify any Authorization. // +optional Authorization *Authorization `json:"authorization,omitempty"` - // Relabelings configures the relabeling rules to apply to all scrape targets. + // relabelings defines the relabeling rules to apply to all scrape targets. // // The Operator automatically adds relabelings for a few standard Kubernetes fields // like `__meta_kubernetes_namespace` and `__meta_kubernetes_service_name`. @@ -2326,7 +2451,7 @@ type ScrapeClass struct { // +optional Relabelings []RelabelConfig `json:"relabelings,omitempty"` - // MetricRelabelings configures the relabeling rules to apply to all samples before ingestion. + // metricRelabelings defines the relabeling rules to apply to all samples before ingestion. // // The Operator adds the scrape class metric relabelings defined here. // Then the Operator adds the target-specific metric relabelings defined in ServiceMonitors, PodMonitors, Probes and ScrapeConfigs. @@ -2337,7 +2462,7 @@ type ScrapeClass struct { // +optional MetricRelabelings []RelabelConfig `json:"metricRelabelings,omitempty"` - // AttachMetadata configures additional metadata to the discovered targets. + // attachMetadata defines additional metadata to the discovered targets. // When the scrape object defines its own configuration, it takes // precedence over the scrape class configuration. // @@ -2349,8 +2474,9 @@ type ScrapeClass struct { // Supported values are: // * `NoUTF8EscapingWithSuffixes` // * `UnderscoreEscapingWithSuffixes` +// * `UnderscoreEscapingWithoutSuffixes` // * `NoTranslation` -// +kubebuilder:validation:Enum=NoUTF8EscapingWithSuffixes;UnderscoreEscapingWithSuffixes;NoTranslation +// +kubebuilder:validation:Enum=NoUTF8EscapingWithSuffixes;UnderscoreEscapingWithSuffixes;NoTranslation;UnderscoreEscapingWithoutSuffixes type TranslationStrategyOption string const ( @@ -2358,20 +2484,22 @@ const ( UnderscoreEscapingWithSuffixes TranslationStrategyOption = "UnderscoreEscapingWithSuffixes" // It requires Prometheus >= v3.4.0. NoTranslation TranslationStrategyOption = "NoTranslation" + // It requires Prometheus >= v3.6.0. + UnderscoreEscapingWithoutSuffixes TranslationStrategyOption = "UnderscoreEscapingWithoutSuffixes" ) // OTLPConfig is the configuration for writing to the OTLP endpoint. // // +k8s:openapi-gen=true type OTLPConfig struct { - // Promote all resource attributes to metric labels except the ones defined in `ignoreResourceAttributes`. + // promoteAllResourceAttributes promotes all resource attributes to metric labels except the ones defined in `ignoreResourceAttributes`. // // Cannot be true when `promoteResourceAttributes` is defined. // It requires Prometheus >= v3.5.0. // +optional PromoteAllResourceAttributes *bool `json:"promoteAllResourceAttributes,omitempty"` - // List of OpenTelemetry resource attributes to ignore when `promoteAllResourceAttributes` is true. + // ignoreResourceAttributes defines the list of OpenTelemetry resource attributes to ignore when `promoteAllResourceAttributes` is true. // // It requires `promoteAllResourceAttributes` to be true. // It requires Prometheus >= v3.5.0. @@ -2381,7 +2509,7 @@ type OTLPConfig struct { // +optional IgnoreResourceAttributes []string `json:"ignoreResourceAttributes,omitempty"` - // List of OpenTelemetry Attributes that should be promoted to metric labels, defaults to none. + // promoteResourceAttributes defines the list of OpenTelemetry Attributes that should be promoted to metric labels, defaults to none. // Cannot be defined when `promoteAllResourceAttributes` is true. // // +kubebuilder:validation:MinItems=1 @@ -2390,23 +2518,29 @@ type OTLPConfig struct { // +optional PromoteResourceAttributes []string `json:"promoteResourceAttributes,omitempty"` - // Configures how the OTLP receiver endpoint translates the incoming metrics. + // translationStrategy defines how the OTLP receiver endpoint translates the incoming metrics. // // It requires Prometheus >= v3.0.0. // +optional TranslationStrategy *TranslationStrategyOption `json:"translationStrategy,omitempty"` - // Enables adding `service.name`, `service.namespace` and `service.instance.id` + // keepIdentifyingResourceAttributes enables adding `service.name`, `service.namespace` and `service.instance.id` // resource attributes to the `target_info` metric, on top of converting them into the `instance` and `job` labels. // // It requires Prometheus >= v3.1.0. // +optional KeepIdentifyingResourceAttributes *bool `json:"keepIdentifyingResourceAttributes,omitempty"` - // Configures optional translation of OTLP explicit bucket histograms into native histograms with custom buckets. + // convertHistogramsToNHCB defines optional translation of OTLP explicit bucket histograms into native histograms with custom buckets. // It requires Prometheus >= v3.4.0. // +optional ConvertHistogramsToNHCB *bool `json:"convertHistogramsToNHCB,omitempty"` + + // promoteScopeMetadata controls whether to promote OpenTelemetry scope metadata (i.e. name, version, schema URL, and attributes) to metric labels. + // As per the OpenTelemetry specification, the aforementioned scope metadata should be identifying, i.e. made into metric labels. + // It requires Prometheus >= v3.6.0. + // +optional + PromoteScopeMetadata *bool `json:"promoteScopeMetadata,omitempty"` } // Validate semantically validates the given OTLPConfig section. diff --git a/vendor/github.com/prometheus-operator/prometheus-operator/pkg/apis/monitoring/v1/prometheusrule_types.go b/vendor/github.com/prometheus-operator/prometheus-operator/pkg/apis/monitoring/v1/prometheusrule_types.go index 28d5d1549e..1534ee4ba5 100644 --- a/vendor/github.com/prometheus-operator/prometheus-operator/pkg/apis/monitoring/v1/prometheusrule_types.go +++ b/vendor/github.com/prometheus-operator/prometheus-operator/pkg/apis/monitoring/v1/prometheusrule_types.go @@ -29,15 +29,28 @@ const ( // +genclient // +k8s:openapi-gen=true // +kubebuilder:resource:categories="prometheus-operator",shortName="promrule" +// +kubebuilder:subresource:status // The `PrometheusRule` custom resource definition (CRD) defines [alerting](https://prometheus.io/docs/prometheus/latest/configuration/alerting_rules/) and [recording](https://prometheus.io/docs/prometheus/latest/configuration/recording_rules/) rules to be evaluated by `Prometheus` or `ThanosRuler` objects. // // `Prometheus` and `ThanosRuler` objects select `PrometheusRule` objects using label and namespace selectors. type PrometheusRule struct { - metav1.TypeMeta `json:",inline"` + // TypeMeta defines the versioned schema of this representation of an object. + metav1.TypeMeta `json:",inline"` + // metadata defines ObjectMeta as the metadata that all persisted resources. + // +optional metav1.ObjectMeta `json:"metadata,omitempty"` - // Specification of desired alerting rule definitions for Prometheus. + // spec defines the specification of desired alerting rule definitions for Prometheus. + // +required Spec PrometheusRuleSpec `json:"spec"` + // status defines the status subresource. It is under active development and is updated only when the + // "StatusForConfigurationResources" feature gate is enabled. + // + // Most recent observed status of the PrometheusRule. Read-only. + // More info: + // https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#spec-and-status + // +optional + Status ConfigResourceStatus `json:"status,omitempty,omitzero"` } // DeepCopyObject implements the runtime.Object interface. @@ -48,9 +61,10 @@ func (f *PrometheusRule) DeepCopyObject() runtime.Object { // PrometheusRuleSpec contains specification parameters for a Rule. // +k8s:openapi-gen=true type PrometheusRuleSpec struct { - // Content of Prometheus rule file + // groups defines the content of Prometheus rule file // +listType=map // +listMapKey=name + // +optional Groups []RuleGroup `json:"groups,omitempty"` } @@ -60,34 +74,38 @@ type PrometheusRuleSpec struct { // RuleGroup is a list of sequentially evaluated recording and alerting rules. // +k8s:openapi-gen=true type RuleGroup struct { - // Name of the rule group. + // name defines the name of the rule group. // +kubebuilder:validation:MinLength=1 + // +required Name string `json:"name"` - // Labels to add or overwrite before storing the result for its rules. + // labels define the labels to add or overwrite before storing the result for its rules. // The labels defined at the rule level take precedence. // // It requires Prometheus >= 3.0.0. // The field is ignored for Thanos Ruler. // +optional Labels map[string]string `json:"labels,omitempty"` - // Interval determines how often rules in the group are evaluated. + // interval defines how often rules in the group are evaluated. // +optional Interval *Duration `json:"interval,omitempty"` - // Defines the offset the rule evaluation timestamp of this particular group by the specified duration into the past. + // query_offset defines the offset the rule evaluation timestamp of this particular group by the specified duration into the past. // // It requires Prometheus >= v2.53.0. // It is not supported for ThanosRuler. // +optional + //nolint:kubeapilinter // The json tag doesn't meet the conventions to be compatible with Prometheus format. QueryOffset *Duration `json:"query_offset,omitempty"` - // List of alerting and recording rules. + // rules defines the list of alerting and recording rules. // +optional Rules []Rule `json:"rules,omitempty"` - // PartialResponseStrategy is only used by ThanosRuler and will + // partial_response_strategy is only used by ThanosRuler and will // be ignored by Prometheus instances. // More info: https://github.com/thanos-io/thanos/blob/main/docs/components/rule.md#partial-response // +kubebuilder:validation:Pattern="^(?i)(abort|warn)?$" + // +optional + //nolint:kubeapilinter // The json tag doesn't meet the conventions to be compatible with Prometheus format. PartialResponseStrategy string `json:"partial_response_strategy,omitempty"` - // Limit the number of alerts an alerting rule and series a recording + // limit defines the number of alerts an alerting rule and series a recording // rule can produce. // Limit is supported starting with Prometheus >= 2.31 and Thanos Ruler >= 0.24. // +optional @@ -97,36 +115,45 @@ type RuleGroup struct { // Rule describes an alerting or recording rule // See Prometheus documentation: [alerting](https://www.prometheus.io/docs/prometheus/latest/configuration/alerting_rules/) or [recording](https://www.prometheus.io/docs/prometheus/latest/configuration/recording_rules/#recording-rules) rule // +k8s:openapi-gen=true +// +kubebuilder:validation:OneOf=Record,Alert type Rule struct { - // Name of the time series to output to. Must be a valid metric name. + // record defines the name of the time series to output to. Must be a valid metric name. // Only one of `record` and `alert` must be set. + // +optional Record string `json:"record,omitempty"` - // Name of the alert. Must be a valid label value. + // alert defines the name of the alert. Must be a valid label value. // Only one of `record` and `alert` must be set. + // +optional Alert string `json:"alert,omitempty"` - // PromQL expression to evaluate. + // expr defines the PromQL expression to evaluate. + // +required Expr intstr.IntOrString `json:"expr"` - // Alerts are considered firing once they have been returned for this long. + // for defines how alerts are considered firing once they have been returned for this long. // +optional For *Duration `json:"for,omitempty"` - // KeepFiringFor defines how long an alert will continue firing after the condition that triggered it has cleared. + // keep_firing_for defines how long an alert will continue firing after the condition that triggered it has cleared. // +optional + //nolint:kubeapilinter // The json tag doesn't meet the conventions to be compatible with Prometheus format. KeepFiringFor *NonEmptyDuration `json:"keep_firing_for,omitempty"` - // Labels to add or overwrite. + // labels defines labels to add or overwrite. + // +optional Labels map[string]string `json:"labels,omitempty"` - // Annotations to add to each alert. + // annotations defines annotations to add to each alert. // Only valid for alerting rules. + // +optional Annotations map[string]string `json:"annotations,omitempty"` } // PrometheusRuleList is a list of PrometheusRules. // +k8s:openapi-gen=true type PrometheusRuleList struct { + // TypeMeta defines the versioned schema of this representation of an object. metav1.TypeMeta `json:",inline"` - // Standard list metadata - // More info: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#metadata + // metadata defines ListMeta as metadata for collection responses. + // +optional metav1.ListMeta `json:"metadata,omitempty"` // List of Rules + // +required Items []PrometheusRule `json:"items"` } diff --git a/vendor/github.com/prometheus-operator/prometheus-operator/pkg/apis/monitoring/v1/servicemonitor_types.go b/vendor/github.com/prometheus-operator/prometheus-operator/pkg/apis/monitoring/v1/servicemonitor_types.go index 250c4cdde3..90bcd79974 100644 --- a/vendor/github.com/prometheus-operator/prometheus-operator/pkg/apis/monitoring/v1/servicemonitor_types.go +++ b/vendor/github.com/prometheus-operator/prometheus-operator/pkg/apis/monitoring/v1/servicemonitor_types.go @@ -39,19 +39,23 @@ const ( // // `Prometheus` and `PrometheusAgent` objects select `ServiceMonitor` objects using label and namespace selectors. type ServiceMonitor struct { - metav1.TypeMeta `json:",inline"` + // TypeMeta defines the versioned schema of this representation of an object. + metav1.TypeMeta `json:",inline"` + // metadata defines ObjectMeta as the metadata that all persisted resources. + // +optional metav1.ObjectMeta `json:"metadata,omitempty"` - // Specification of desired Service selection for target discovery by + // spec defines the specification of desired Service selection for target discovery by // Prometheus. + // +required Spec ServiceMonitorSpec `json:"spec"` - // This Status subresource is under active development and is updated only when the + // status defines the status subresource. It is under active development and is updated only when the // "StatusForConfigurationResources" feature gate is enabled. // // Most recent observed status of the ServiceMonitor. Read-only. // More info: // https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#spec-and-status // +optional - Status ConfigResourceStatus `json:"status,omitempty"` + Status ConfigResourceStatus `json:"status,omitempty,omitzero"` } // DeepCopyObject implements the runtime.Object interface. @@ -59,10 +63,14 @@ func (l *ServiceMonitor) DeepCopyObject() runtime.Object { return l.DeepCopy() } +func (l *ServiceMonitor) Bindings() []WorkloadBinding { + return l.Status.Bindings +} + // ServiceMonitorSpec defines the specification parameters for a ServiceMonitor. // +k8s:openapi-gen=true type ServiceMonitorSpec struct { - // `jobLabel` selects the label from the associated Kubernetes `Service` + // jobLabel selects the label from the associated Kubernetes `Service` // object which will be used as the `job` label for all metrics. // // For example if `jobLabel` is set to `foo` and the Kubernetes `Service` @@ -72,28 +80,31 @@ type ServiceMonitorSpec struct { // If the value of this field is empty or if the label doesn't exist for // the given Service, the `job` label of the metrics defaults to the name // of the associated Kubernetes `Service`. + // +optional JobLabel string `json:"jobLabel,omitempty"` - // `targetLabels` defines the labels which are transferred from the + // targetLabels defines the labels which are transferred from the // associated Kubernetes `Service` object onto the ingested metrics. // // +optional TargetLabels []string `json:"targetLabels,omitempty"` - // `podTargetLabels` defines the labels which are transferred from the + // podTargetLabels defines the labels which are transferred from the // associated Kubernetes `Pod` object onto the ingested metrics. // // +optional PodTargetLabels []string `json:"podTargetLabels,omitempty"` - // List of endpoints part of this ServiceMonitor. + // endpoints defines the list of endpoints part of this ServiceMonitor. // Defines how to scrape metrics from Kubernetes [Endpoints](https://kubernetes.io/docs/concepts/services-networking/service/#endpoints) objects. // In most cases, an Endpoints object is backed by a Kubernetes [Service](https://kubernetes.io/docs/concepts/services-networking/service/) object with the same name and labels. + // +required Endpoints []Endpoint `json:"endpoints"` - // Label selector to select the Kubernetes `Endpoints` objects to scrape metrics from. + // selector defines the label selector to select the Kubernetes `Endpoints` objects to scrape metrics from. + // +required Selector metav1.LabelSelector `json:"selector"` - // Mechanism used to select the endpoints to scrape. + // selectorMechanism defines the mechanism used to select the endpoints to scrape. // By default, the selection process relies on relabel configurations to filter the discovered targets. // Alternatively, you can opt in for role selectors, which may offer better efficiency in large clusters. // Which strategy is best for your use case needs to be carefully evaluated. @@ -103,17 +114,18 @@ type ServiceMonitorSpec struct { // +optional SelectorMechanism *SelectorMechanism `json:"selectorMechanism,omitempty"` - // `namespaceSelector` defines in which namespace(s) Prometheus should discover the services. + // namespaceSelector defines in which namespace(s) Prometheus should discover the services. // By default, the services are discovered in the same namespace as the `ServiceMonitor` object but it is possible to select pods across different/all namespaces. + // +optional NamespaceSelector NamespaceSelector `json:"namespaceSelector,omitempty"` - // `sampleLimit` defines a per-scrape limit on the number of scraped samples + // sampleLimit defines a per-scrape limit on the number of scraped samples // that will be accepted. // // +optional SampleLimit *uint64 `json:"sampleLimit,omitempty"` - // `scrapeProtocols` defines the protocols to negotiate during a scrape. It tells clients the + // scrapeProtocols defines the protocols to negotiate during a scrape. It tells clients the // protocols supported by Prometheus in order of preference (from most to least preferred). // // If unset, Prometheus uses its default value. @@ -124,40 +136,41 @@ type ServiceMonitorSpec struct { // +optional ScrapeProtocols []ScrapeProtocol `json:"scrapeProtocols,omitempty"` - // The protocol to use if a scrape returns blank, unparseable, or otherwise invalid Content-Type. + // fallbackScrapeProtocol defines the protocol to use if a scrape returns blank, unparseable, or otherwise invalid Content-Type. // // It requires Prometheus >= v3.0.0. // +optional FallbackScrapeProtocol *ScrapeProtocol `json:"fallbackScrapeProtocol,omitempty"` - // `targetLimit` defines a limit on the number of scraped targets that will + // targetLimit defines a limit on the number of scraped targets that will // be accepted. // // +optional TargetLimit *uint64 `json:"targetLimit,omitempty"` - // Per-scrape limit on number of labels that will be accepted for a sample. + // labelLimit defines the per-scrape limit on number of labels that will be accepted for a sample. // // It requires Prometheus >= v2.27.0. // // +optional LabelLimit *uint64 `json:"labelLimit,omitempty"` - // Per-scrape limit on length of labels name that will be accepted for a sample. + // labelNameLengthLimit defines the per-scrape limit on length of labels name that will be accepted for a sample. // // It requires Prometheus >= v2.27.0. // // +optional LabelNameLengthLimit *uint64 `json:"labelNameLengthLimit,omitempty"` - // Per-scrape limit on length of labels value that will be accepted for a sample. + // labelValueLengthLimit defines the per-scrape limit on length of labels value that will be accepted for a sample. // // It requires Prometheus >= v2.27.0. // // +optional LabelValueLengthLimit *uint64 `json:"labelValueLengthLimit,omitempty"` + // +optional NativeHistogramConfig `json:",inline"` - // Per-scrape limit on the number of targets dropped by relabeling + // keepDroppedTargets defines the per-scrape limit on the number of targets dropped by relabeling // that will be kept in memory. 0 means no limit. // // It requires Prometheus >= v2.47.0. @@ -165,7 +178,7 @@ type ServiceMonitorSpec struct { // +optional KeepDroppedTargets *uint64 `json:"keepDroppedTargets,omitempty"` - // `attachMetadata` defines additional metadata which is added to the + // attachMetadata defines additional metadata which is added to the // discovered targets. // // It requires Prometheus >= v2.37.0. @@ -173,28 +186,39 @@ type ServiceMonitorSpec struct { // +optional AttachMetadata *AttachMetadata `json:"attachMetadata,omitempty"` - // The scrape class to apply. + // scrapeClass defines the scrape class to apply. // +optional // +kubebuilder:validation:MinLength=1 ScrapeClassName *string `json:"scrapeClass,omitempty"` - // When defined, bodySizeLimit specifies a job level limit on the size + // bodySizeLimit when defined, bodySizeLimit specifies a job level limit on the size // of uncompressed response body that will be accepted by Prometheus. // // It requires Prometheus >= v2.28.0. // // +optional BodySizeLimit *ByteSize `json:"bodySizeLimit,omitempty"` + + // serviceDiscoveryRole defines the service discovery role used to discover targets. + // + // If set, the value should be either "Endpoints" or "EndpointSlice". + // Otherwise it defaults to the value defined in the + // Prometheus/PrometheusAgent resource. + // + // +optional + ServiceDiscoveryRole *ServiceDiscoveryRole `json:"serviceDiscoveryRole,omitempty"` } // ServiceMonitorList is a list of ServiceMonitors. // +k8s:openapi-gen=true type ServiceMonitorList struct { + // TypeMeta defines the versioned schema of this representation of an object metav1.TypeMeta `json:",inline"` - // Standard list metadata - // More info: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#metadata + // metadata defines ListMeta as metadata for collection responses. + // +optional metav1.ListMeta `json:"metadata,omitempty"` // List of ServiceMonitors + // +required Items []ServiceMonitor `json:"items"` } diff --git a/vendor/github.com/prometheus-operator/prometheus-operator/pkg/apis/monitoring/v1/thanos_types.go b/vendor/github.com/prometheus-operator/prometheus-operator/pkg/apis/monitoring/v1/thanos_types.go index aaeea88d6e..434664c23b 100644 --- a/vendor/github.com/prometheus-operator/prometheus-operator/pkg/apis/monitoring/v1/thanos_types.go +++ b/vendor/github.com/prometheus-operator/prometheus-operator/pkg/apis/monitoring/v1/thanos_types.go @@ -44,25 +44,32 @@ const ( // // The resource defines via label and namespace selectors which `PrometheusRule` objects should be associated to the deployed Thanos Ruler instances. type ThanosRuler struct { - metav1.TypeMeta `json:",inline"` + // TypeMeta defines the versioned schema of this representation of an object. + metav1.TypeMeta `json:",inline"` + // metadata defines ObjectMeta as the metadata that all persisted resources. + // +optional metav1.ObjectMeta `json:"metadata,omitempty"` - // Specification of the desired behavior of the ThanosRuler cluster. More info: + // spec defines the specification of the desired behavior of the ThanosRuler cluster. More info: // https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#spec-and-status + // +required Spec ThanosRulerSpec `json:"spec"` - // Most recent observed status of the ThanosRuler cluster. Read-only. + // status defines the most recent observed status of the ThanosRuler cluster. Read-only. // More info: // https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#spec-and-status + // +optional Status ThanosRulerStatus `json:"status,omitempty"` } // ThanosRulerList is a list of ThanosRulers. // +k8s:openapi-gen=true type ThanosRulerList struct { + // TypeMeta defines the versioned schema of this representation of an object. metav1.TypeMeta `json:",inline"` - // Standard list metadata - // More info: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#metadata + // metadata defines ListMeta as metadata for collection responses. + // +optional metav1.ListMeta `json:"metadata,omitempty"` // List of Prometheuses + // +required Items []ThanosRuler `json:"items"` } @@ -70,11 +77,11 @@ type ThanosRulerList struct { // https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#spec-and-status // +k8s:openapi-gen=true type ThanosRulerSpec struct { - // Version of Thanos to be deployed. + // version of Thanos to be deployed. // +optional Version *string `json:"version,omitempty"` - // PodMetadata configures labels and annotations which are propagated to the ThanosRuler pods. + // podMetadata defines labels and annotations which are propagated to the ThanosRuler pods. // // The following items are reserved and cannot be overridden: // * "app.kubernetes.io/name" label, set to "thanos-ruler". @@ -85,70 +92,75 @@ type ThanosRulerSpec struct { // +optional PodMetadata *EmbeddedObjectMetadata `json:"podMetadata,omitempty"` - // Thanos container image URL. + // image defines Thanos container image URL. + // +optional Image string `json:"image,omitempty"` - // Image pull policy for the 'thanos', 'init-config-reloader' and 'config-reloader' containers. + // imagePullPolicy defines for the 'thanos', 'init-config-reloader' and 'config-reloader' containers. // See https://kubernetes.io/docs/concepts/containers/images/#image-pull-policy for more details. // +kubebuilder:validation:Enum="";Always;Never;IfNotPresent + // +optional ImagePullPolicy v1.PullPolicy `json:"imagePullPolicy,omitempty"` - // An optional list of references to secrets in the same namespace + // imagePullSecrets defines an optional list of references to secrets in the same namespace // to use for pulling thanos images from registries // see http://kubernetes.io/docs/user-guide/images#specifying-imagepullsecrets-on-a-pod // +optional ImagePullSecrets []v1.LocalObjectReference `json:"imagePullSecrets,omitempty"` - // When a ThanosRuler deployment is paused, no actions except for deletion + // paused defines when a ThanosRuler deployment is paused, no actions except for deletion // will be performed on the underlying objects. + // +optional Paused bool `json:"paused,omitempty"` - // Number of thanos ruler instances to deploy. + // replicas defines the number of thanos ruler instances to deploy. // +optional Replicas *int32 `json:"replicas,omitempty"` - // Define which Nodes the Pods are scheduled on. + // nodeSelector defines which Nodes the Pods are scheduled on. // +optional NodeSelector map[string]string `json:"nodeSelector,omitempty"` - // Resources defines the resource requirements for single Pods. + // resources defines the resource requirements for single Pods. // If not provided, no requests/limits will be set + // +optional Resources v1.ResourceRequirements `json:"resources,omitempty"` - // If specified, the pod's scheduling constraints. + // affinity defines when specified, the pod's scheduling constraints. // +optional Affinity *v1.Affinity `json:"affinity,omitempty"` - // If specified, the pod's tolerations. + // tolerations defines when specified, the pod's tolerations. // +optional Tolerations []v1.Toleration `json:"tolerations,omitempty"` - // If specified, the pod's topology spread constraints. + // topologySpreadConstraints defines the pod's topology spread constraints. // +optional TopologySpreadConstraints []v1.TopologySpreadConstraint `json:"topologySpreadConstraints,omitempty"` - // SecurityContext holds pod-level security attributes and common container settings. + // securityContext defines the pod-level security attributes and common container settings. // This defaults to the default PodSecurityContext. // +optional SecurityContext *v1.PodSecurityContext `json:"securityContext,omitempty"` - // Defines the DNS policy for the pods. + // dnsPolicy defines the DNS policy for the pods. // // +optional DNSPolicy *DNSPolicy `json:"dnsPolicy,omitempty"` - // Defines the DNS configuration for the pods. + // dnsConfig defines Defines the DNS configuration for the pods. // // +optional DNSConfig *PodDNSConfig `json:"dnsConfig,omitempty"` - // Indicates whether information about services should be injected into pod's environment variables + // enableServiceLinks defines whether information about services should be injected into pod's environment variables // +optional EnableServiceLinks *bool `json:"enableServiceLinks,omitempty"` - // Priority class assigned to the Pods + // priorityClassName defines the priority class assigned to the Pods + // +optional PriorityClassName string `json:"priorityClassName,omitempty"` - // The name of the service name used by the underlying StatefulSet(s) as the governing service. + // serviceName defines the name of the service name used by the underlying StatefulSet(s) as the governing service. // If defined, the Service must be created before the ThanosRuler resource in the same namespace and it must define a selector that matches the pod labels. // If empty, the operator will create and manage a headless service named `thanos-ruler-operated` for ThanosRuler resources. // When deploying multiple ThanosRuler resources in the same namespace, it is recommended to specify a different value for each. @@ -157,27 +169,26 @@ type ThanosRulerSpec struct { // +kubebuilder:validation:MinLength=1 ServiceName *string `json:"serviceName,omitempty"` - // ServiceAccountName is the name of the ServiceAccount to use to run the + // serviceAccountName defines the name of the ServiceAccount to use to run the // Thanos Ruler Pods. + // +optional ServiceAccountName string `json:"serviceAccountName,omitempty"` - // Storage spec to specify how storage shall be used. + // storage defines the specification of how storage shall be used. // +optional Storage *StorageSpec `json:"storage,omitempty"` - // Volumes allows configuration of additional volumes on the output StatefulSet definition. Volumes specified will + // volumes defines how configuration of additional volumes on the output StatefulSet definition. Volumes specified will // be appended to other volumes that are generated as a result of StorageSpec objects. // +optional Volumes []v1.Volume `json:"volumes,omitempty"` - // VolumeMounts allows configuration of additional VolumeMounts on the output StatefulSet definition. + // volumeMounts defines how the configuration of additional VolumeMounts on the output StatefulSet definition. // VolumeMounts specified will be appended to other VolumeMounts in the ruler container, // that are generated as a result of StorageSpec objects. // +optional VolumeMounts []v1.VolumeMount `json:"volumeMounts,omitempty"` - // Configures object storage. - // - // The configuration format is defined at https://thanos.io/tip/thanos/storage.md/#configuring-access-to-object-storage + // objectStorageConfig defines the configuration format is defined at https://thanos.io/tip/thanos/storage.md/#configuring-access-to-object-storage // // The operator performs no validation of the configuration. // @@ -185,7 +196,7 @@ type ThanosRulerSpec struct { // // +optional ObjectStorageConfig *v1.SecretKeySelector `json:"objectStorageConfig,omitempty"` - // Configures the path of the object storage configuration file. + // objectStorageConfigFile defines the path of the object storage configuration file. // // The configuration format is defined at https://thanos.io/tip/thanos/storage.md/#configuring-access-to-object-storage // @@ -196,11 +207,12 @@ type ThanosRulerSpec struct { // +optional ObjectStorageConfigFile *string `json:"objectStorageConfigFile,omitempty"` - // ListenLocal makes the Thanos ruler listen on loopback, so that it + // listenLocal defines the Thanos ruler listen on loopback, so that it // does not bind against the Pod IP. + // +optional ListenLocal bool `json:"listenLocal,omitempty"` - // Configures the list of Thanos Query endpoints from which to query metrics. + // queryEndpoints defines the list of Thanos Query endpoints from which to query metrics. // // For Thanos >= v0.11.0, it is recommended to use `queryConfig` instead. // @@ -209,7 +221,7 @@ type ThanosRulerSpec struct { // +optional QueryEndpoints []string `json:"queryEndpoints,omitempty"` - // Configures the list of Thanos Query endpoints from which to query metrics. + // queryConfig defines the list of Thanos Query endpoints from which to query metrics. // // The configuration format is defined at https://thanos.io/tip/components/rule.md/#query-api // @@ -222,7 +234,7 @@ type ThanosRulerSpec struct { // +optional QueryConfig *v1.SecretKeySelector `json:"queryConfig,omitempty"` - // Configures the list of Alertmanager endpoints to send alerts to. + // alertmanagersUrl defines the list of Alertmanager endpoints to send alerts to. // // For Thanos >= v0.10.0, it is recommended to use `alertmanagersConfig` instead. // @@ -230,7 +242,7 @@ type ThanosRulerSpec struct { // // +optional AlertManagersURL []string `json:"alertmanagersUrl,omitempty"` - // Configures the list of Alertmanager endpoints to send alerts to. + // alertmanagersConfig defines the list of Alertmanager endpoints to send alerts to. // // The configuration format is defined at https://thanos.io/tip/components/rule.md/#alertmanager. // @@ -243,79 +255,84 @@ type ThanosRulerSpec struct { // +optional AlertManagersConfig *v1.SecretKeySelector `json:"alertmanagersConfig,omitempty"` - // PrometheusRule objects to be selected for rule evaluation. An empty + // ruleSelector defines the PrometheusRule objects to be selected for rule evaluation. An empty // label selector matches all objects. A null label selector matches no // objects. // // +optional RuleSelector *metav1.LabelSelector `json:"ruleSelector,omitempty"` - // Namespaces to be selected for Rules discovery. If unspecified, only + // ruleNamespaceSelector defines the namespaces to be selected for Rules discovery. If unspecified, only // the same namespace as the ThanosRuler object is in is used. // // +optional RuleNamespaceSelector *metav1.LabelSelector `json:"ruleNamespaceSelector,omitempty"` - // EnforcedNamespaceLabel enforces adding a namespace label of origin for each alert + // enforcedNamespaceLabel enforces adding a namespace label of origin for each alert // and metric that is user created. The label value will always be the namespace of the object that is // being created. + // +optional EnforcedNamespaceLabel string `json:"enforcedNamespaceLabel,omitempty"` - // List of references to PrometheusRule objects + // excludedFromEnforcement defines the list of references to PrometheusRule objects // to be excluded from enforcing a namespace label of origin. // Applies only if enforcedNamespaceLabel set to true. // +optional ExcludedFromEnforcement []ObjectReference `json:"excludedFromEnforcement,omitempty"` - // PrometheusRulesExcludedFromEnforce - list of Prometheus rules to be excluded from enforcing + // prometheusRulesExcludedFromEnforce defines a list of Prometheus rules to be excluded from enforcing // of adding namespace labels. Works only if enforcedNamespaceLabel set to true. // Make sure both ruleNamespace and ruleName are set for each pair // Deprecated: use excludedFromEnforcement instead. // +optional PrometheusRulesExcludedFromEnforce []PrometheusRuleExcludeConfig `json:"prometheusRulesExcludedFromEnforce,omitempty"` - // Log level for ThanosRuler to be configured with. + // logLevel for ThanosRuler to be configured with. // +kubebuilder:validation:Enum="";debug;info;warn;error + // +optional LogLevel string `json:"logLevel,omitempty"` - // Log format for ThanosRuler to be configured with. + // logFormat for ThanosRuler to be configured with. // +kubebuilder:validation:Enum="";logfmt;json + // +optional LogFormat string `json:"logFormat,omitempty"` - // Port name used for the pods and governing service. + // portName defines the port name used for the pods and governing service. // Defaults to `web`. // +kubebuilder:default:="web" + // +optional PortName string `json:"portName,omitempty"` - // Interval between consecutive evaluations. + // evaluationInterval defines the interval between consecutive evaluations. // +kubebuilder:default:="15s" + // +optional EvaluationInterval Duration `json:"evaluationInterval,omitempty"` - // Minimum amount of time to wait before resending an alert to Alertmanager. + // resendDelay defines the minimum amount of time to wait before resending an alert to Alertmanager. // +optional ResendDelay *Duration `json:"resendDelay,omitempty"` - // Max time to tolerate prometheus outage for restoring "for" state of alert. + // ruleOutageTolerance defines the max time to tolerate prometheus outage for restoring "for" state of alert. // It requires Thanos >= v0.30.0. // +optional RuleOutageTolerance *Duration `json:"ruleOutageTolerance,omitempty"` - // The default rule group's query offset duration to use. + // ruleQueryOffset defines the default rule group's query offset duration to use. // It requires Thanos >= v0.38.0. // +optional RuleQueryOffset *Duration `json:"ruleQueryOffset,omitempty"` - // How many rules can be evaluated concurrently. + // ruleConcurrentEval defines how many rules can be evaluated concurrently. // It requires Thanos >= v0.37.0. // +kubebuilder:validation:Minimum=1 // // +optional RuleConcurrentEval *int32 `json:"ruleConcurrentEval,omitempty"` - // Minimum duration between alert and restored "for" state. + // ruleGracePeriod defines the minimum duration between alert and restored "for" state. // This is maintained only for alerts with configured "for" time greater than grace period. // It requires Thanos >= v0.30.0. // // +optional RuleGracePeriod *Duration `json:"ruleGracePeriod,omitempty"` - // Time duration ThanosRuler shall retain data for. Default is '24h', and + // retention defines the time duration ThanosRuler shall retain data for. Default is '24h', and // must match the regular expression `[0-9]+(ms|s|m|h|d|w|y)` (milliseconds // seconds minutes hours days weeks years). // @@ -323,9 +340,10 @@ type ThanosRulerSpec struct { // operates in stateless mode. // // +kubebuilder:default:="24h" + // +optional Retention Duration `json:"retention,omitempty"` - // Containers allows injecting additional containers or modifying operator generated + // containers allows injecting additional containers or modifying operator generated // containers. This can be used to allow adding an authentication proxy to a ThanosRuler pod or // to change the behavior of an operator generated container. Containers described here modify // an operator generated container if they share the same name and modifications are done via a @@ -334,7 +352,7 @@ type ThanosRulerSpec struct { // so, you accept that this behaviour may break at any time without notice. // +optional Containers []v1.Container `json:"containers,omitempty"` - // InitContainers allows adding initContainers to the pod definition. Those can be used to e.g. + // initContainers allows adding initContainers to the pod definition. Those can be used to e.g. // fetch secrets for injection into the ThanosRuler configuration from external sources. Any // errors during the execution of an initContainer will lead to a restart of the Pod. // More info: https://kubernetes.io/docs/concepts/workloads/pods/init-containers/ @@ -344,7 +362,7 @@ type ThanosRulerSpec struct { // +optional InitContainers []v1.Container `json:"initContainers,omitempty"` - // Configures tracing. + // tracingConfig defines the tracing configuration. // // The configuration format is defined at https://thanos.io/tip/thanos/tracing.md/#configuration // @@ -355,9 +373,9 @@ type ThanosRulerSpec struct { // // `tracingConfigFile` takes precedence over this field. // - //+optional + // +optional TracingConfig *v1.SecretKeySelector `json:"tracingConfig,omitempty"` - // Configures the path of the tracing configuration file. + // tracingConfigFile defines the path of the tracing configuration file. // // The configuration format is defined at https://thanos.io/tip/thanos/tracing.md/#configuration // @@ -368,10 +386,10 @@ type ThanosRulerSpec struct { // // This field takes precedence over `tracingConfig`. // - //+optional + // +optional TracingConfigFile string `json:"tracingConfigFile,omitempty"` - // Configures the external label pairs of the ThanosRuler resource. + // labels defines the external label pairs of the ThanosRuler resource. // // A default replica label `thanos_ruler_replica` will be always added as a // label with the value of the pod's name. @@ -379,7 +397,7 @@ type ThanosRulerSpec struct { // +optional Labels map[string]string `json:"labels,omitempty"` - // Configures the label names which should be dropped in Thanos Ruler + // alertDropLabels defines the label names which should be dropped in Thanos Ruler // alerts. // // The replica label `thanos_ruler_replica` will always be dropped from the alerts. @@ -387,26 +405,29 @@ type ThanosRulerSpec struct { // +optional AlertDropLabels []string `json:"alertDropLabels,omitempty"` - // The external URL the Thanos Ruler instances will be available under. This is + // externalPrefix defines the Thanos Ruler instances will be available under. This is // necessary to generate correct URLs. This is necessary if Thanos Ruler is not // served from root of a DNS name. + // +optional ExternalPrefix string `json:"externalPrefix,omitempty"` - // The route prefix ThanosRuler registers HTTP handlers for. This allows thanos UI to be served on a sub-path. + // routePrefix defines the route prefix ThanosRuler registers HTTP handlers for. This allows thanos UI to be served on a sub-path. + // +optional RoutePrefix string `json:"routePrefix,omitempty"` - // GRPCServerTLSConfig configures the gRPC server from which Thanos Querier reads + // grpcServerTlsConfig defines the gRPC server from which Thanos Querier reads // recorded rule data. // Note: Currently only the CAFile, CertFile, and KeyFile fields are supported. // Maps to the '--grpc-server-tls-*' CLI args. // +optional GRPCServerTLSConfig *TLSConfig `json:"grpcServerTlsConfig,omitempty"` - // The external Query URL the Thanos Ruler will set in the 'Source' field + // alertQueryUrl defines how Thanos Ruler will set in the 'Source' field // of all alerts. // Maps to the '--alert.query-url' CLI arg. + // +optional AlertQueryURL string `json:"alertQueryUrl,omitempty"` - // Minimum number of seconds for which a newly created pod should be ready + // minReadySeconds defines the minimum number of seconds for which a newly created pod should be ready // without any of its container crashing for it to be considered available. // // If unset, pods will be considered available as soon as they are ready. @@ -415,7 +436,7 @@ type ThanosRulerSpec struct { // +optional MinReadySeconds *int32 `json:"minReadySeconds,omitempty"` - // Configures alert relabeling in Thanos Ruler. + // alertRelabelConfigs defines the alert relabeling in Thanos Ruler. // // Alert relabel configuration must have the form as specified in the // official Prometheus documentation: @@ -427,7 +448,7 @@ type ThanosRulerSpec struct { // // +optional AlertRelabelConfigs *v1.SecretKeySelector `json:"alertRelabelConfigs,omitempty"` - // Configures the path to the alert relabeling configuration file. + // alertRelabelConfigFile defines the path to the alert relabeling configuration file. // // Alert relabel configuration must have the form as specified in the // official Prometheus documentation: @@ -440,12 +461,13 @@ type ThanosRulerSpec struct { // +optional AlertRelabelConfigFile *string `json:"alertRelabelConfigFile,omitempty"` - // Pods' hostAliases configuration + // hostAliases defines pods' hostAliases configuration // +listType=map // +listMapKey=ip + // +optional HostAliases []HostAlias `json:"hostAliases,omitempty"` - // AdditionalArgs allows setting additional arguments for the ThanosRuler container. + // additionalArgs defines how to add additional arguments for the ThanosRuler container. // It is intended for e.g. activating hidden flags which are not supported by // the dedicated configuration options yet. The arguments are passed as-is to the // ThanosRuler container which may cause issues if they are invalid or not supported @@ -456,11 +478,11 @@ type ThanosRulerSpec struct { // +optional AdditionalArgs []Argument `json:"additionalArgs,omitempty"` - // Defines the configuration of the ThanosRuler web server. + // web defines the configuration of the ThanosRuler web server. // +optional Web *ThanosRulerWebSpec `json:"web,omitempty"` - // Defines the list of remote write configurations. + // remoteWrite defines the list of remote write configurations. // // When the list isn't empty, the ruler is configured with stateless mode. // @@ -469,7 +491,7 @@ type ThanosRulerSpec struct { // +optional RemoteWrite []RemoteWriteSpec `json:"remoteWrite,omitempty"` - // Optional duration in seconds the pod needs to terminate gracefully. + // terminationGracePeriodSeconds defines the optional duration in seconds the pod needs to terminate gracefully. // Value must be non-negative integer. The value zero indicates stop immediately via // the kill signal (no opportunity to shut down) which may lead to data corruption. // @@ -479,7 +501,7 @@ type ThanosRulerSpec struct { // +optional TerminationGracePeriodSeconds *int64 `json:"terminationGracePeriodSeconds,omitempty"` - // Enable access to Thanos Ruler feature flags. By default, no features are enabled. + // enableFeatures defines how to setup Thanos Ruler feature flags. By default, no features are enabled. // // Enabling features which are disabled by default is entirely outside the // scope of what the maintainers will support and by doing so, you accept @@ -492,7 +514,7 @@ type ThanosRulerSpec struct { // +optional EnableFeatures []EnableFeature `json:"enableFeatures,omitempty"` - // HostUsers supports the user space in Kubernetes. + // hostUsers supports the user space in Kubernetes. // // More info: https://kubernetes.io/docs/tasks/configure-pod-container/user-namespaces/ // @@ -507,6 +529,7 @@ type ThanosRulerSpec struct { // ThanosRulerWebSpec defines the configuration of the ThanosRuler web server. // +k8s:openapi-gen=true type ThanosRulerWebSpec struct { + // +optional WebConfigFileFields `json:",inline"` } @@ -515,21 +538,26 @@ type ThanosRulerWebSpec struct { // https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#spec-and-status // +k8s:openapi-gen=true type ThanosRulerStatus struct { - // Represents whether any actions on the underlying managed objects are + // paused defines whether any actions on the underlying managed objects are // being performed. Only delete actions will be performed. + // +optional Paused bool `json:"paused"` - // Total number of non-terminated pods targeted by this ThanosRuler deployment + // replicas defines the total number of non-terminated pods targeted by this ThanosRuler deployment // (their labels match the selector). + // +optional Replicas int32 `json:"replicas"` - // Total number of non-terminated pods targeted by this ThanosRuler deployment + // updatedReplicas defines the total number of non-terminated pods targeted by this ThanosRuler deployment // that have the desired version spec. + // +optional UpdatedReplicas int32 `json:"updatedReplicas"` - // Total number of available pods (ready for at least minReadySeconds) + // availableReplicas defines the total number of available pods (ready for at least minReadySeconds) // targeted by this ThanosRuler deployment. + // +optional AvailableReplicas int32 `json:"availableReplicas"` - // Total number of unavailable pods targeted by this ThanosRuler deployment. + // unavailableReplicas defines the total number of unavailable pods targeted by this ThanosRuler deployment. + // +optional UnavailableReplicas int32 `json:"unavailableReplicas"` - // The current state of the ThanosRuler object. + // conditions defines the current state of the ThanosRuler object. // +listType=map // +listMapKey=type // +optional diff --git a/vendor/github.com/prometheus-operator/prometheus-operator/pkg/apis/monitoring/v1/types.go b/vendor/github.com/prometheus-operator/prometheus-operator/pkg/apis/monitoring/v1/types.go index 09182a883b..eb110df7ef 100644 --- a/vendor/github.com/prometheus-operator/prometheus-operator/pkg/apis/monitoring/v1/types.go +++ b/vendor/github.com/prometheus-operator/prometheus-operator/pkg/apis/monitoring/v1/types.go @@ -72,11 +72,11 @@ type GoDuration string // HostAlias holds the mapping between IP and hostnames that will be injected as an entry in the // pod's hosts file. type HostAlias struct { - // IP address of the host file entry. - // +kubebuilder:validation:Required + // ip defines the IP address of the host file entry. + // +required IP string `json:"ip"` - // Hostnames for the above IP address. - // +kubebuilder:validation:Required + // hostnames defines hostnames for the above IP address. + // +required Hostnames []string `json:"hostnames"` } @@ -84,31 +84,33 @@ type HostAlias struct { // PrometheusRule names and their namespaces to be ignored while enforcing // namespace label for alerts and metrics. type PrometheusRuleExcludeConfig struct { - // Namespace of the excluded PrometheusRule object. + // ruleNamespace defines the namespace of the excluded PrometheusRule object. + // +required RuleNamespace string `json:"ruleNamespace"` - // Name of the excluded PrometheusRule object. + // ruleName defines the name of the excluded PrometheusRule object. + // +required RuleName string `json:"ruleName"` } type ProxyConfig struct { - // `proxyURL` defines the HTTP proxy server to use. + // proxyUrl defines the HTTP proxy server to use. // // +kubebuilder:validation:Pattern:="^(http|https|socks5)://.+$" // +optional ProxyURL *string `json:"proxyUrl,omitempty"` - // `noProxy` is a comma-separated string that can contain IPs, CIDR notation, domain names + // noProxy defines a comma-separated string that can contain IPs, CIDR notation, domain names // that should be excluded from proxying. IP and domain names can // contain port numbers. // // It requires Prometheus >= v2.43.0, Alertmanager >= v0.25.0 or Thanos >= v0.32.0. // +optional NoProxy *string `json:"noProxy,omitempty"` - // Whether to use the proxy configuration defined by environment variables (HTTP_PROXY, HTTPS_PROXY, and NO_PROXY). + // proxyFromEnvironment defines whether to use the proxy configuration defined by environment variables (HTTP_PROXY, HTTPS_PROXY, and NO_PROXY). // // It requires Prometheus >= v2.43.0, Alertmanager >= v0.25.0 or Thanos >= v0.32.0. // +optional ProxyFromEnvironment *bool `json:"proxyFromEnvironment,omitempty"` - // ProxyConnectHeader optionally specifies headers to send to + // proxyConnectHeader optionally specifies headers to send to // proxies during CONNECT requests. // // It requires Prometheus >= v2.43.0, Alertmanager >= v0.25.0 or Thanos >= v0.32.0. @@ -168,21 +170,21 @@ func (pc *ProxyConfig) Validate() error { // ObjectReference references a PodMonitor, ServiceMonitor, Probe or PrometheusRule object. type ObjectReference struct { - // Group of the referent. When not specified, it defaults to `monitoring.coreos.com` + // group of the referent. When not specified, it defaults to `monitoring.coreos.com` // +optional // +kubebuilder:default:="monitoring.coreos.com" // +kubebuilder:validation:Enum=monitoring.coreos.com Group string `json:"group"` - // Resource of the referent. - // +kubebuilder:validation:Required + // resource of the referent. + // +required // +kubebuilder:validation:Enum=prometheusrules;servicemonitors;podmonitors;probes;scrapeconfigs Resource string `json:"resource"` - // Namespace of the referent. + // namespace of the referent. // More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/ - // +kubebuilder:validation:Required + // +required // +kubebuilder:validation:MinLength=1 Namespace string `json:"namespace"` - // Name of the referent. When not set, all resources in the namespace are matched. + // name of the referent. When not set, all resources in the namespace are matched. // +optional Name string `json:"name,omitempty"` } @@ -219,6 +221,12 @@ func (obj *ObjectReference) getGroup() string { // request by Prometheus to a malicious target. Denying the above would prevent the // attack, users can instead use the BearerTokenSecret field. type ArbitraryFSAccessThroughSMsConfig struct { + // deny prevents service monitors from accessing arbitrary files on the file system. + // When true, service monitors cannot use file-based configurations like BearerTokenFile + // that could potentially access sensitive files. When false (default), such access is allowed. + // Setting this to true enhances security by preventing potential credential theft attacks. + // + // +optional Deny bool `json:"deny,omitempty"` } @@ -226,26 +234,27 @@ type ArbitraryFSAccessThroughSMsConfig struct { // Prometheus, Alertmanager or ThanosRuler resource. // +k8s:deepcopy-gen=true type Condition struct { - // Type of the condition being reported. + // type of the condition being reported. // +required Type ConditionType `json:"type"` - // Status of the condition. + // status of the condition. // +required Status ConditionStatus `json:"status"` // lastTransitionTime is the time of the last update to the current status property. // +required LastTransitionTime metav1.Time `json:"lastTransitionTime"` - // Reason for the condition's last transition. + // reason for the condition's last transition. // +optional Reason string `json:"reason,omitempty"` - // Human-readable message indicating details for the condition's last transition. + // message defines human-readable message indicating details for the condition's last transition. // +optional Message string `json:"message,omitempty"` - // ObservedGeneration represents the .metadata.generation that the + // observedGeneration defines the .metadata.generation that the // condition was set based upon. For instance, if `.metadata.generation` is // currently 12, but the `.status.conditions[].observedGeneration` is 9, the // condition is out of date with respect to the current state of the // instance. + // +optional ObservedGeneration int64 `json:"observedGeneration,omitempty"` } @@ -290,25 +299,24 @@ const ( // EmbeddedPersistentVolumeClaim is an embedded version of k8s.io/api/core/v1.PersistentVolumeClaim. // It contains TypeMeta and a reduced ObjectMeta. type EmbeddedPersistentVolumeClaim struct { + // TypeMeta defines the versioned schema of this representation of an object. metav1.TypeMeta `json:",inline"` - - // EmbeddedMetadata contains metadata relevant to an EmbeddedResource. + // metadata defines EmbeddedMetadata contains metadata relevant to an EmbeddedResource. + // +optional EmbeddedObjectMetadata `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` - - // Defines the desired characteristics of a volume requested by a pod author. + // spec defines the specification of the characteristics of a volume requested by a pod author. // More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#persistentvolumeclaims // +optional Spec v1.PersistentVolumeClaimSpec `json:"spec,omitempty" protobuf:"bytes,2,opt,name=spec"` - + // status is deprecated: this field is never set. // +optional - // Deprecated: this field is never set. Status v1.PersistentVolumeClaimStatus `json:"status,omitempty" protobuf:"bytes,3,opt,name=status"` } // EmbeddedObjectMetadata contains a subset of the fields included in k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta // Only fields which are relevant to embedded resources are included. type EmbeddedObjectMetadata struct { - // Name must be unique within a namespace. Is required when creating resources, although + // name must be unique within a namespace. Is required when creating resources, although // some resources may allow a client to request the generation of an appropriate name // automatically. Name is primarily intended for creation idempotence and configuration // definition. @@ -317,14 +325,14 @@ type EmbeddedObjectMetadata struct { // +optional Name string `json:"name,omitempty" protobuf:"bytes,1,opt,name=name"` - // Map of string keys and values that can be used to organize and categorize + // labels define the map of string keys and values that can be used to organize and categorize // (scope and select) objects. May match selectors of replication controllers // and services. // More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/ // +optional Labels map[string]string `json:"labels,omitempty" protobuf:"bytes,11,rep,name=labels"` - // Annotations is an unstructured key value map stored with a resource that may be + // annotations defines an unstructured key value map stored with a resource that may be // set by external tools to store and retrieve arbitrary metadata. They are not // queryable and should be preserved when modifying objects. // More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/ @@ -335,56 +343,65 @@ type EmbeddedObjectMetadata struct { // WebConfigFileFields defines the file content for --web.config.file flag. // +k8s:deepcopy-gen=true type WebConfigFileFields struct { - // Defines the TLS parameters for HTTPS. + // tlsConfig defines the TLS parameters for HTTPS. + // +optional TLSConfig *WebTLSConfig `json:"tlsConfig,omitempty"` - // Defines HTTP parameters for web server. + // httpConfig defines HTTP parameters for web server. + // +optional HTTPConfig *WebHTTPConfig `json:"httpConfig,omitempty"` } // WebHTTPConfig defines HTTP parameters for web server. // +k8s:openapi-gen=true type WebHTTPConfig struct { - // Enable HTTP/2 support. Note that HTTP/2 is only supported with TLS. + // http2 enable HTTP/2 support. Note that HTTP/2 is only supported with TLS. // When TLSConfig is not configured, HTTP/2 will be disabled. // Whenever the value of the field changes, a rolling update will be triggered. + // +optional HTTP2 *bool `json:"http2,omitempty"` - // List of headers that can be added to HTTP responses. + // headers defines a list of headers that can be added to HTTP responses. + // +optional Headers *WebHTTPHeaders `json:"headers,omitempty"` } // WebHTTPHeaders defines the list of headers that can be added to HTTP responses. // +k8s:openapi-gen=true type WebHTTPHeaders struct { - // Set the Content-Security-Policy header to HTTP responses. + // contentSecurityPolicy defines the Content-Security-Policy header to HTTP responses. // Unset if blank. + // +optional ContentSecurityPolicy string `json:"contentSecurityPolicy,omitempty"` - // Set the X-Frame-Options header to HTTP responses. + // xFrameOptions defines the X-Frame-Options header to HTTP responses. // Unset if blank. Accepted values are deny and sameorigin. // https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/X-Frame-Options - //+kubebuilder:validation:Enum="";Deny;SameOrigin + // +kubebuilder:validation:Enum="";Deny;SameOrigin + // +optional XFrameOptions string `json:"xFrameOptions,omitempty"` - // Set the X-Content-Type-Options header to HTTP responses. + // xContentTypeOptions defines the X-Content-Type-Options header to HTTP responses. // Unset if blank. Accepted value is nosniff. // https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/X-Content-Type-Options - //+kubebuilder:validation:Enum="";NoSniff + // +kubebuilder:validation:Enum="";NoSniff + // +optional XContentTypeOptions string `json:"xContentTypeOptions,omitempty"` - // Set the X-XSS-Protection header to all responses. + // xXSSProtection defines the X-XSS-Protection header to all responses. // Unset if blank. // https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/X-XSS-Protection + // +optional XXSSProtection string `json:"xXSSProtection,omitempty"` - // Set the Strict-Transport-Security header to HTTP responses. + // strictTransportSecurity defines the Strict-Transport-Security header to HTTP responses. // Unset if blank. // Please make sure that you use this with care as this header might force // browsers to load Prometheus and the other applications hosted on the same // domain and subdomains over HTTPS. // https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Strict-Transport-Security + // +optional StrictTransportSecurity string `json:"strictTransportSecurity,omitempty"` } // WebTLSConfig defines the TLS parameters for HTTPS. // +k8s:openapi-gen=true type WebTLSConfig struct { - // Secret or ConfigMap containing the TLS certificate for the web server. + // cert defines the Secret or ConfigMap containing the TLS certificate for the web server. // // Either `keySecret` or `keyFile` must be defined. // @@ -392,7 +409,7 @@ type WebTLSConfig struct { // // +optional Cert SecretOrConfigMap `json:"cert,omitempty"` - // Path to the TLS certificate file in the container for the web server. + // certFile defines the path to the TLS certificate file in the container for the web server. // // Either `keySecret` or `keyFile` must be defined. // @@ -401,7 +418,7 @@ type WebTLSConfig struct { // +optional CertFile *string `json:"certFile,omitempty"` - // Secret containing the TLS private key for the web server. + // keySecret defines the secret containing the TLS private key for the web server. // // Either `cert` or `certFile` must be defined. // @@ -409,7 +426,7 @@ type WebTLSConfig struct { // // +optional KeySecret v1.SecretKeySelector `json:"keySecret,omitempty"` - // Path to the TLS private key file in the container for the web server. + // keyFile defines the path to the TLS private key file in the container for the web server. // // If defined, either `cert` or `certFile` must be defined. // @@ -418,21 +435,22 @@ type WebTLSConfig struct { // +optional KeyFile *string `json:"keyFile,omitempty"` - // Secret or ConfigMap containing the CA certificate for client certificate + // client_ca defines the Secret or ConfigMap containing the CA certificate for client certificate // authentication to the server. // // It is mutually exclusive with `clientCAFile`. // // +optional + //nolint:kubeapilinter // The json tag doesn't meet the conventions to be compatible with Prometheus format. ClientCA SecretOrConfigMap `json:"client_ca,omitempty"` - // Path to the CA certificate file for client certificate authentication to + // clientCAFile defines the path to the CA certificate file for client certificate authentication to // the server. // // It is mutually exclusive with `client_ca`. // // +optional ClientCAFile *string `json:"clientCAFile,omitempty"` - // The server policy for client TLS authentication. + // clientAuthType defines the server policy for client TLS authentication. // // For more detail on clientAuth options: // https://golang.org/pkg/crypto/tls/#ClientAuthType @@ -440,16 +458,16 @@ type WebTLSConfig struct { // +optional ClientAuthType *string `json:"clientAuthType,omitempty"` - // Minimum TLS version that is acceptable. + // minVersion defines the minimum TLS version that is acceptable. // // +optional MinVersion *string `json:"minVersion,omitempty"` - // Maximum TLS version that is acceptable. + // maxVersion defines the Maximum TLS version that is acceptable. // // +optional MaxVersion *string `json:"maxVersion,omitempty"` - // List of supported cipher suites for TLS versions up to TLS 1.2. + // cipherSuites defines the list of supported cipher suites for TLS versions up to TLS 1.2. // // If not defined, the Go default cipher suites are used. // Available cipher suites are documented in the Go documentation: @@ -458,7 +476,7 @@ type WebTLSConfig struct { // +optional CipherSuites []string `json:"cipherSuites,omitempty"` - // Controls whether the server selects the client's most preferred cipher + // preferServerCipherSuites defines whether the server selects the client's most preferred cipher // suite, or the server's most preferred cipher suite. // // If true then the server's preference, as expressed in @@ -467,7 +485,7 @@ type WebTLSConfig struct { // +optional PreferServerCipherSuites *bool `json:"preferServerCipherSuites,omitempty"` - // Elliptic curves that will be used in an ECDHE handshake, in preference + // curvePreferences defines elliptic curves that will be used in an ECDHE handshake, in preference // order. // // Available curves are documented in the Go documentation: @@ -519,10 +537,9 @@ func (c *WebTLSConfig) Validate() error { return nil } -// LabelName is a valid Prometheus label name which may only contain ASCII -// letters, numbers, as well as underscores. -// -// +kubebuilder:validation:Pattern:="^[a-zA-Z_][a-zA-Z0-9_]*$" +// LabelName is a valid Prometheus label name. +// For Prometheus 3.x, a label name is valid if it contains UTF-8 characters. +// For Prometheus 2.x, a label name is only valid if it contains ASCII characters, letters, numbers, as well as underscores. type LabelName string // Endpoint defines an endpoint serving Prometheus metrics to be scraped by @@ -530,23 +547,25 @@ type LabelName string // // +k8s:openapi-gen=true type Endpoint struct { - // Name of the Service port which this endpoint refers to. + // port defines the name of the Service port which this endpoint refers to. // // It takes precedence over `targetPort`. + // +optional Port string `json:"port,omitempty"` - // Name or number of the target port of the `Pod` object behind the + // targetPort defines the name or number of the target port of the `Pod` object behind the // Service. The port must be specified with the container's port property. // // +optional TargetPort *intstr.IntOrString `json:"targetPort,omitempty"` - // HTTP path from which to scrape for metrics. + // path defines the HTTP path from which to scrape for metrics. // // If empty, Prometheus uses the default value (e.g. `/metrics`). + // +optional Path string `json:"path,omitempty"` - // HTTP scheme to use for scraping. + // scheme defines the HTTP scheme to use for scraping. // // `http` and `https` are the expected values unless you rewrite the // `__scheme__` label via relabeling. @@ -554,34 +573,39 @@ type Endpoint struct { // If empty, Prometheus uses the default value `http`. // // +kubebuilder:validation:Enum=http;https + // +optional Scheme string `json:"scheme,omitempty"` // params define optional HTTP URL parameters. + // +optional Params map[string][]string `json:"params,omitempty"` - // Interval at which Prometheus scrapes the metrics from the target. + // interval at which Prometheus scrapes the metrics from the target. // // If empty, Prometheus uses the global scrape interval. + // +optional Interval Duration `json:"interval,omitempty"` - // Timeout after which Prometheus considers the scrape to be failed. + // scrapeTimeout defines the timeout after which Prometheus considers the scrape to be failed. // // If empty, Prometheus uses the global scrape timeout unless it is less // than the target's scrape interval value in which the latter is used. // The value cannot be greater than the scrape interval otherwise the operator will reject the resource. + // +optional ScrapeTimeout Duration `json:"scrapeTimeout,omitempty"` - // TLS configuration to use when scraping the target. + // tlsConfig defines the TLS configuration to use when scraping the target. // // +optional TLSConfig *TLSConfig `json:"tlsConfig,omitempty"` - // File to read bearer token for scraping the target. + // bearerTokenFile defines the file to read bearer token for scraping the target. // // Deprecated: use `authorization` instead. + // +optional BearerTokenFile string `json:"bearerTokenFile,omitempty"` - // `bearerTokenSecret` specifies a key of a Secret containing the bearer + // bearerTokenSecret defines a key of a Secret containing the bearer // token for scraping targets. The secret needs to be in the same namespace // as the ServiceMonitor object and readable by the Prometheus Operator. // @@ -590,7 +614,7 @@ type Endpoint struct { // Deprecated: use `authorization` instead. BearerTokenSecret *v1.SecretKeySelector `json:"bearerTokenSecret,omitempty"` - // `authorization` configures the Authorization header credentials to use when + // authorization configures the Authorization header credentials to use when // scraping the target. // // Cannot be set at the same time as `basicAuth`, or `oauth2`. @@ -598,17 +622,18 @@ type Endpoint struct { // +optional Authorization *SafeAuthorization `json:"authorization,omitempty"` - // When true, `honorLabels` preserves the metric's labels when they collide + // honorLabels defines when true the metric's labels when they collide // with the target's labels. + // +optional HonorLabels bool `json:"honorLabels,omitempty"` - // `honorTimestamps` controls whether Prometheus preserves the timestamps + // honorTimestamps defines whether Prometheus preserves the timestamps // when exposed by the target. // // +optional HonorTimestamps *bool `json:"honorTimestamps,omitempty"` - // `trackTimestampsStaleness` defines whether Prometheus tracks staleness of + // trackTimestampsStaleness defines whether Prometheus tracks staleness of // the metrics that have an explicit timestamp present in scraped data. // Has no effect if `honorTimestamps` is false. // @@ -617,7 +642,7 @@ type Endpoint struct { // +optional TrackTimestampsStaleness *bool `json:"trackTimestampsStaleness,omitempty"` - // `basicAuth` configures the Basic Authentication credentials to use when + // basicAuth defines the Basic Authentication credentials to use when // scraping the target. // // Cannot be set at the same time as `authorization`, or `oauth2`. @@ -625,7 +650,7 @@ type Endpoint struct { // +optional BasicAuth *BasicAuth `json:"basicAuth,omitempty"` - // `oauth2` configures the OAuth2 settings to use when scraping the target. + // oauth2 defines the OAuth2 settings to use when scraping the target. // // It requires Prometheus >= 2.27.0. // @@ -634,13 +659,13 @@ type Endpoint struct { // +optional OAuth2 *OAuth2 `json:"oauth2,omitempty"` - // `metricRelabelings` configures the relabeling rules to apply to the + // metricRelabelings defines the relabeling rules to apply to the // samples before ingestion. // // +optional MetricRelabelConfigs []RelabelConfig `json:"metricRelabelings,omitempty"` - // `relabelings` configures the relabeling rules to apply the target's + // relabelings defines the relabeling rules to apply the target's // metadata labels. // // The Operator automatically adds relabelings for a few standard Kubernetes fields. @@ -655,18 +680,18 @@ type Endpoint struct { // +optional ProxyConfig `json:",inline"` - // `followRedirects` defines whether the scrape requests should follow HTTP + // followRedirects defines whether the scrape requests should follow HTTP // 3xx redirects. // // +optional FollowRedirects *bool `json:"followRedirects,omitempty"` - // `enableHttp2` can be used to disable HTTP2 when scraping the target. + // enableHttp2 can be used to disable HTTP2 when scraping the target. // // +optional EnableHttp2 *bool `json:"enableHttp2,omitempty"` - // When true, the pods which are not running (e.g. either in Failed or + // filterRunning when true, the pods which are not running (e.g. either in Failed or // Succeeded state) are dropped during the target discovery. // // If unset, the filtering is enabled. @@ -678,7 +703,7 @@ type Endpoint struct { } type AttachMetadata struct { - // When set to true, Prometheus attaches node metadata to the discovered + // node when set to true, Prometheus attaches node metadata to the discovered // targets. // // The Prometheus service account must have the `list` and `watch` @@ -692,31 +717,34 @@ type AttachMetadata struct { // // +k8s:openapi-gen=true type OAuth2 struct { - // `clientId` specifies a key of a Secret or ConfigMap containing the + // clientId defines a key of a Secret or ConfigMap containing the // OAuth2 client's ID. + // +required ClientID SecretOrConfigMap `json:"clientId"` - // `clientSecret` specifies a key of a Secret containing the OAuth2 + // clientSecret defines a key of a Secret containing the OAuth2 // client's secret. + // +required ClientSecret v1.SecretKeySelector `json:"clientSecret"` - // `tokenURL` configures the URL to fetch the token from. + // tokenUrl defines the URL to fetch the token from. // // +kubebuilder:validation:MinLength=1 + // +required TokenURL string `json:"tokenUrl"` - // `scopes` defines the OAuth2 scopes used for the token request. + // scopes defines the OAuth2 scopes used for the token request. // // +optional. Scopes []string `json:"scopes,omitempty"` - // `endpointParams` configures the HTTP parameters to append to the token + // endpointParams configures the HTTP parameters to append to the token // URL. // // +optional EndpointParams map[string]string `json:"endpointParams,omitempty"` - // TLS configuration to use when connecting to the OAuth2 server. + // tlsConfig defines the TLS configuration to use when connecting to the OAuth2 server. // It requires Prometheus >= v2.43.0. // // +optional @@ -729,33 +757,25 @@ type OAuth2 struct { ProxyConfig `json:",inline"` } -type OAuth2ValidationError struct { - err string -} - -func (e *OAuth2ValidationError) Error() string { - return e.err -} - func (o *OAuth2) Validate() error { + if o == nil { + return nil + } + if o.TokenURL == "" { - return &OAuth2ValidationError{err: "OAuth2 token url must be specified"} + return errors.New("OAuth2 tokenURL must be specified") } if o.ClientID == (SecretOrConfigMap{}) { - return &OAuth2ValidationError{err: "OAuth2 client id must be specified"} + return errors.New("OAuth2 clientID must be specified") } if err := o.ClientID.Validate(); err != nil { - return &OAuth2ValidationError{ - err: fmt.Sprintf("invalid OAuth2 client id: %s", err.Error()), - } + return fmt.Errorf("invalid OAuth2 clientID: %w", err) } if err := o.TLSConfig.Validate(); err != nil { - return &OAuth2ValidationError{ - err: fmt.Sprintf("invalid OAuth2 tlsConfig: %s", err.Error()), - } + return fmt.Errorf("invalid OAuth2 tlsConfig: %w", err) } return nil @@ -765,20 +785,24 @@ func (o *OAuth2) Validate() error { // // +k8s:openapi-gen=true type BasicAuth struct { - // `username` specifies a key of a Secret containing the username for + // username defines a key of a Secret containing the username for // authentication. + // +optional Username v1.SecretKeySelector `json:"username,omitempty"` - // `password` specifies a key of a Secret containing the password for + // password defines a key of a Secret containing the password for // authentication. + // +optional Password v1.SecretKeySelector `json:"password,omitempty"` } // SecretOrConfigMap allows to specify data as a Secret or ConfigMap. Fields are mutually exclusive. type SecretOrConfigMap struct { - // Secret containing data to use for the targets. + // secret defines the Secret containing data to use for the targets. + // +optional Secret *v1.SecretKeySelector `json:"secret,omitempty"` - // ConfigMap containing data to use for the targets. + // configMap defines the ConfigMap containing data to use for the targets. + // +optional ConfigMap *v1.ConfigMapKeySelector `json:"configMap,omitempty"` } @@ -823,30 +847,33 @@ const ( // SafeTLSConfig specifies safe TLS configuration parameters. // +k8s:openapi-gen=true type SafeTLSConfig struct { - // Certificate authority used when verifying server certificates. + // ca defines the Certificate authority used when verifying server certificates. + // +optional CA SecretOrConfigMap `json:"ca,omitempty"` - // Client certificate to present when doing client-authentication. + // cert defines the Client certificate to present when doing client-authentication. + // +optional Cert SecretOrConfigMap `json:"cert,omitempty"` - // Secret containing the client key file for the targets. + // keySecret defines the Secret containing the client key file for the targets. + // +optional KeySecret *v1.SecretKeySelector `json:"keySecret,omitempty"` - // Used to verify the hostname for the targets. + // serverName is used to verify the hostname for the targets. // +optional ServerName *string `json:"serverName,omitempty"` - // Disable target certificate validation. + // insecureSkipVerify defines how to disable target certificate validation. // +optional InsecureSkipVerify *bool `json:"insecureSkipVerify,omitempty"` - // Minimum acceptable TLS version. + // minVersion defines the minimum acceptable TLS version. // // It requires Prometheus >= v2.35.0 or Thanos >= v0.28.0. // +optional MinVersion *TLSVersion `json:"minVersion,omitempty"` - // Maximum acceptable TLS version. + // maxVersion defines the maximum acceptable TLS version. // // It requires Prometheus >= v2.41.0 or Thanos >= v0.31.0. // +optional @@ -889,12 +916,16 @@ func (c *SafeTLSConfig) Validate() error { // TLSConfig extends the safe TLS configuration with file parameters. // +k8s:openapi-gen=true type TLSConfig struct { + // +optional SafeTLSConfig `json:",inline"` - // Path to the CA cert in the Prometheus container to use for the targets. + // caFile defines the path to the CA cert in the Prometheus container to use for the targets. + // +optional CAFile string `json:"caFile,omitempty"` - // Path to the client cert file in the Prometheus container for the targets. + // certFile defines the path to the client cert file in the Prometheus container for the targets. + // +optional CertFile string `json:"certFile,omitempty"` - // Path to the client key file in the Prometheus container for the targets. + // keyFile defines the path to the client key file in the Prometheus container for the targets. + // +optional KeyFile string `json:"keyFile,omitempty"` } @@ -951,10 +982,12 @@ func (c *TLSConfig) Validate() error { // selected from the current namespace. // +k8s:openapi-gen=true type NamespaceSelector struct { - // Boolean describing whether all namespaces are selected in contrast to a + // any defines the boolean describing whether all namespaces are selected in contrast to a // list restricting them. + // +optional Any bool `json:"any,omitempty"` - // List of namespace names to select from. + // matchNames defines the list of namespace names to select from. + // +optional MatchNames []string `json:"matchNames,omitempty"` // TODO(fabxc): this should embed metav1.LabelSelector eventually. @@ -965,10 +998,12 @@ type NamespaceSelector struct { // Argument as part of the AdditionalArgs list. // +k8s:openapi-gen=true type Argument struct { - // Name of the argument, e.g. "scrape.discovery-reload-interval". + // name of the argument, e.g. "scrape.discovery-reload-interval". // +kubebuilder:validation:MinLength=1 + // +required Name string `json:"name"` - // Argument value, e.g. 30s. Can be empty for name-only arguments (e.g. --storage.tsdb.no-lockfile) + // value defines the argument value, e.g. 30s. Can be empty for name-only arguments (e.g. --storage.tsdb.no-lockfile) + // +optional Value string `json:"value,omitempty"` } @@ -985,7 +1020,7 @@ const ( // NativeHistogramConfig extends the native histogram configuration settings. // +k8s:openapi-gen=true type NativeHistogramConfig struct { - // Whether to scrape a classic histogram that is also exposed as a native histogram. + // scrapeClassicHistograms defines whether to scrape a classic histogram that is also exposed as a native histogram. // It requires Prometheus >= v2.45.0. // // Notice: `scrapeClassicHistograms` corresponds to the `always_scrape_classic_histograms` field in the Prometheus configuration. @@ -993,21 +1028,21 @@ type NativeHistogramConfig struct { // +optional ScrapeClassicHistograms *bool `json:"scrapeClassicHistograms,omitempty"` - // If there are more than this many buckets in a native histogram, + // nativeHistogramBucketLimit defines ff there are more than this many buckets in a native histogram, // buckets will be merged to stay within the limit. // It requires Prometheus >= v2.45.0. // // +optional NativeHistogramBucketLimit *uint64 `json:"nativeHistogramBucketLimit,omitempty"` - // If the growth factor of one bucket to the next is smaller than this, + // nativeHistogramMinBucketFactor defines if the growth factor of one bucket to the next is smaller than this, // buckets will be merged to increase the factor sufficiently. // It requires Prometheus >= v2.50.0. // // +optional NativeHistogramMinBucketFactor *resource.Quantity `json:"nativeHistogramMinBucketFactor,omitempty"` - // Whether to convert all scraped classic histograms into a native histogram with custom buckets. + // convertClassicHistogramsToNHCB defines whether to convert all scraped classic histograms into a native histogram with custom buckets. // It requires Prometheus >= v3.0.0. // // +optional @@ -1022,12 +1057,17 @@ const ( SelectorMechanismRole SelectorMechanism = "RoleSelector" ) -// ConfigResourceStatus is the most recent observed status of the Configuration Resource (ServiceMonitor, PodMonitor and Probes). Read-only. +// ConfigResourceStatus is the most recent observed status of the Configuration Resource (ServiceMonitor, PodMonitor, Probes, ScrapeConfig, PrometheusRule or AlertmanagerConfig). Read-only. // More info: // https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#spec-and-status // +k8s:openapi-gen=true type ConfigResourceStatus struct { - // The list of workload resources (Prometheus or PrometheusAgent) which select the configuration resource. + // bindings defines the list of workload resources (Prometheus, PrometheusAgent, ThanosRuler or Alertmanager) which select the configuration resource. + // +listType=map + // +listMapKey=group + // +listMapKey=resource + // +listMapKey=name + // +listMapKey=namespace // +optional Bindings []WorkloadBinding `json:"bindings,omitempty"` } @@ -1035,52 +1075,53 @@ type ConfigResourceStatus struct { // WorkloadBinding is a link between a configuration resource and a workload resource. // +k8s:openapi-gen=true type WorkloadBinding struct { - // The group of the referenced resource. + // group defines the group of the referenced resource. // +kubebuilder:validation:Enum=monitoring.coreos.com // +required Group string `json:"group"` - // The type of resource being referenced (e.g. Prometheus or PrometheusAgent). - // +kubebuilder:validation:Enum=prometheuses;prometheusagents + // resource defines the type of resource being referenced (e.g. Prometheus, PrometheusAgent, ThanosRuler or Alertmanager). + // +kubebuilder:validation:Enum=prometheuses;prometheusagents;thanosrulers;alertmanagers // +required Resource string `json:"resource"` - // The name of the referenced object. + // name defines the name of the referenced object. // +kubebuilder:validation:MinLength=1 // +required Name string `json:"name"` - // The namespace of the referenced object. + // namespace defines the namespace of the referenced object. // +kubebuilder:validation:MinLength=1 // +required Namespace string `json:"namespace"` - // The current state of the configuration resource when bound to the referenced Prometheus object. + // conditions defines the current state of the configuration resource when bound to the referenced Workload object. // +listType=map // +listMapKey=type // +optional Conditions []ConfigResourceCondition `json:"conditions,omitempty"` } -// ConfigResourceCondition describes the status of configuration resources linked to Prometheus, PrometheusAgent, Alertmanager, or ThanosRuler. +// ConfigResourceCondition describes the status of configuration resources linked to Prometheus, PrometheusAgent, Alertmanager or ThanosRuler. // +k8s:deepcopy-gen=true type ConfigResourceCondition struct { - // Type of the condition being reported. + // type of the condition being reported. // Currently, only "Accepted" is supported. // +kubebuilder:validation:Enum=Accepted // +required Type ConditionType `json:"type"` - // Status of the condition. + // status of the condition. // +required Status ConditionStatus `json:"status"` - // LastTransitionTime is the time of the last update to the current status property. + // lastTransitionTime defines the time of the last update to the current status property. // +required LastTransitionTime metav1.Time `json:"lastTransitionTime"` - // Reason for the condition's last transition. + // reason for the condition's last transition. // +optional Reason string `json:"reason,omitempty"` - // Human-readable message indicating details for the condition's last transition. + // message defines the human-readable message indicating details for the condition's last transition. // +optional Message string `json:"message,omitempty"` - // ObservedGeneration represents the .metadata.generation that the + // observedGeneration defines the .metadata.generation that the // condition was set based upon. For instance, if `.metadata.generation` is // currently 12, but the `.status.conditions[].observedGeneration` is 9, the // condition is out of date with respect to the current state of the object. + // +optional ObservedGeneration int64 `json:"observedGeneration,omitempty"` } diff --git a/vendor/github.com/prometheus-operator/prometheus-operator/pkg/apis/monitoring/v1/zz_generated.deepcopy.go b/vendor/github.com/prometheus-operator/prometheus-operator/pkg/apis/monitoring/v1/zz_generated.deepcopy.go index a54a9eb7e2..eb0acd7412 100644 --- a/vendor/github.com/prometheus-operator/prometheus-operator/pkg/apis/monitoring/v1/zz_generated.deepcopy.go +++ b/vendor/github.com/prometheus-operator/prometheus-operator/pkg/apis/monitoring/v1/zz_generated.deepcopy.go @@ -240,7 +240,7 @@ func (in *AlertmanagerGlobalConfig) DeepCopyInto(out *AlertmanagerGlobalConfig) } if in.PagerdutyURL != nil { in, out := &in.PagerdutyURL, &out.PagerdutyURL - *out = new(string) + *out = new(URL) **out = **in } if in.TelegramConfig != nil { @@ -661,21 +661,6 @@ func (in *Authorization) DeepCopy() *Authorization { return out } -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *AuthorizationValidationError) DeepCopyInto(out *AuthorizationValidationError) { - *out = *in -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AuthorizationValidationError. -func (in *AuthorizationValidationError) DeepCopy() *AuthorizationValidationError { - if in == nil { - return nil - } - out := new(AuthorizationValidationError) - in.DeepCopyInto(out) - return out -} - // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *AzureAD) DeepCopyInto(out *AzureAD) { *out = *in @@ -1702,6 +1687,11 @@ func (in *HTTPConfig) DeepCopyInto(out *HTTPConfig) { *out = new(bool) **out = **in } + if in.EnableHTTP2 != nil { + in, out := &in.EnableHTTP2, &out.EnableHTTP2 + *out = new(bool) + **out = **in + } } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new HTTPConfig. @@ -1874,21 +1864,6 @@ func (in *OAuth2) DeepCopy() *OAuth2 { return out } -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *OAuth2ValidationError) DeepCopyInto(out *OAuth2ValidationError) { - *out = *in -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new OAuth2ValidationError. -func (in *OAuth2ValidationError) DeepCopy() *OAuth2ValidationError { - if in == nil { - return nil - } - out := new(OAuth2ValidationError) - in.DeepCopyInto(out) - return out -} - // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *OTLPConfig) DeepCopyInto(out *OTLPConfig) { *out = *in @@ -1922,6 +1897,11 @@ func (in *OTLPConfig) DeepCopyInto(out *OTLPConfig) { *out = new(bool) **out = **in } + if in.PromoteScopeMetadata != nil { + in, out := &in.PromoteScopeMetadata, &out.PromoteScopeMetadata + *out = new(bool) + **out = **in + } } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new OTLPConfig. @@ -2035,12 +2015,6 @@ func (in *PodMetricsEndpoint) DeepCopyInto(out *PodMetricsEndpoint) { (*out)[key] = outVal } } - if in.TLSConfig != nil { - in, out := &in.TLSConfig, &out.TLSConfig - *out = new(SafeTLSConfig) - (*in).DeepCopyInto(*out) - } - in.BearerTokenSecret.DeepCopyInto(&out.BearerTokenSecret) if in.HonorTimestamps != nil { in, out := &in.HonorTimestamps, &out.HonorTimestamps *out = new(bool) @@ -2051,21 +2025,6 @@ func (in *PodMetricsEndpoint) DeepCopyInto(out *PodMetricsEndpoint) { *out = new(bool) **out = **in } - if in.BasicAuth != nil { - in, out := &in.BasicAuth, &out.BasicAuth - *out = new(BasicAuth) - (*in).DeepCopyInto(*out) - } - if in.OAuth2 != nil { - in, out := &in.OAuth2, &out.OAuth2 - *out = new(OAuth2) - (*in).DeepCopyInto(*out) - } - if in.Authorization != nil { - in, out := &in.Authorization, &out.Authorization - *out = new(SafeAuthorization) - (*in).DeepCopyInto(*out) - } if in.MetricRelabelConfigs != nil { in, out := &in.MetricRelabelConfigs, &out.MetricRelabelConfigs *out = make([]RelabelConfig, len(*in)) @@ -2080,22 +2039,12 @@ func (in *PodMetricsEndpoint) DeepCopyInto(out *PodMetricsEndpoint) { (*in)[i].DeepCopyInto(&(*out)[i]) } } - in.ProxyConfig.DeepCopyInto(&out.ProxyConfig) - if in.FollowRedirects != nil { - in, out := &in.FollowRedirects, &out.FollowRedirects - *out = new(bool) - **out = **in - } - if in.EnableHttp2 != nil { - in, out := &in.EnableHttp2, &out.EnableHttp2 - *out = new(bool) - **out = **in - } if in.FilterRunning != nil { in, out := &in.FilterRunning, &out.FilterRunning *out = new(bool) **out = **in } + in.HTTPConfig.DeepCopyInto(&out.HTTPConfig) } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PodMetricsEndpoint. @@ -2114,6 +2063,7 @@ func (in *PodMonitor) DeepCopyInto(out *PodMonitor) { out.TypeMeta = in.TypeMeta in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) in.Spec.DeepCopyInto(&out.Spec) + in.Status.DeepCopyInto(&out.Status) } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PodMonitor. @@ -2246,6 +2196,7 @@ func (in *Probe) DeepCopyInto(out *Probe) { out.TypeMeta = in.TypeMeta in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) in.Spec.DeepCopyInto(&out.Spec) + in.Status.DeepCopyInto(&out.Status) } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Probe. @@ -2483,21 +2434,6 @@ func (in *ProbeTargets) DeepCopy() *ProbeTargets { return out } -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *ProbeTargetsValidationError) DeepCopyInto(out *ProbeTargetsValidationError) { - *out = *in -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ProbeTargetsValidationError. -func (in *ProbeTargetsValidationError) DeepCopy() *ProbeTargetsValidationError { - if in == nil { - return nil - } - out := new(ProbeTargetsValidationError) - in.DeepCopyInto(out) - return out -} - // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *ProberSpec) DeepCopyInto(out *ProberSpec) { *out = *in @@ -2563,6 +2499,7 @@ func (in *PrometheusRule) DeepCopyInto(out *PrometheusRule) { out.TypeMeta = in.TypeMeta in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) in.Spec.DeepCopyInto(&out.Spec) + in.Status.DeepCopyInto(&out.Status) } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PrometheusRule. @@ -3560,6 +3497,11 @@ func (in *ServiceMonitorSpec) DeepCopyInto(out *ServiceMonitorSpec) { *out = new(ByteSize) **out = **in } + if in.ServiceDiscoveryRole != nil { + in, out := &in.ServiceDiscoveryRole, &out.ServiceDiscoveryRole + *out = new(ServiceDiscoveryRole) + **out = **in + } } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ServiceMonitorSpec. @@ -3625,6 +3567,11 @@ func (in *Sigv4) DeepCopyInto(out *Sigv4) { *out = new(corev1.SecretKeySelector) (*in).DeepCopyInto(*out) } + if in.UseFIPSSTSEndpoint != nil { + in, out := &in.UseFIPSSTSEndpoint, &out.UseFIPSSTSEndpoint + *out = new(bool) + **out = **in + } } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Sigv4. diff --git a/vendor/github.com/prometheus-operator/prometheus-operator/pkg/apis/monitoring/v1alpha1/alertmanager_config_types.go b/vendor/github.com/prometheus-operator/prometheus-operator/pkg/apis/monitoring/v1alpha1/alertmanager_config_types.go index fb84dd80b0..a220c34a1c 100644 --- a/vendor/github.com/prometheus-operator/prometheus-operator/pkg/apis/monitoring/v1alpha1/alertmanager_config_types.go +++ b/vendor/github.com/prometheus-operator/prometheus-operator/pkg/apis/monitoring/v1alpha1/alertmanager_config_types.go @@ -47,18 +47,22 @@ const ( // AlertmanagerConfig configures the Prometheus Alertmanager, // specifying how alerts should be grouped, inhibited and notified to external systems. type AlertmanagerConfig struct { - metav1.TypeMeta `json:",inline"` + // TypeMeta defines the versioned schema of this representation of an object. + metav1.TypeMeta `json:",inline"` + // metadata defines ObjectMeta as the metadata that all persisted resources. + // +optional metav1.ObjectMeta `json:"metadata,omitempty"` - + // spec defines the specification of AlertmanagerConfigSpec + // +required Spec AlertmanagerConfigSpec `json:"spec"` } // AlertmanagerConfigList is a list of AlertmanagerConfig. // +k8s:openapi-gen=true type AlertmanagerConfigList struct { + // TypeMeta defines the versioned schema of this representation of an object. metav1.TypeMeta `json:",inline"` - // Standard list metadata - // More info: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#metadata + // metadata defines ListMeta as metadata for collection responses. metav1.ListMeta `json:"metadata,omitempty"` // List of AlertmanagerConfig Items []AlertmanagerConfig `json:"items"` @@ -71,61 +75,62 @@ type AlertmanagerConfigList struct { // resource (see the `.spec.alertmanagerConfigMatcherStrategy` field of the // Alertmanager CRD). type AlertmanagerConfigSpec struct { - // The Alertmanager route definition for alerts matching the resource's + // route defines the Alertmanager route definition for alerts matching the resource's // namespace. If present, it will be added to the generated Alertmanager // configuration as a first-level route. // +optional Route *Route `json:"route"` - // List of receivers. + // receivers defines the list of receivers. // +optional Receivers []Receiver `json:"receivers"` - // List of inhibition rules. The rules will only apply to alerts matching + // inhibitRules defines the list of inhibition rules. The rules will only apply to alerts matching // the resource's namespace. // +optional InhibitRules []InhibitRule `json:"inhibitRules,omitempty"` - // List of MuteTimeInterval specifying when the routes should be muted. + // muteTimeIntervals defines the list of MuteTimeInterval specifying when the routes should be muted. // +optional MuteTimeIntervals []MuteTimeInterval `json:"muteTimeIntervals,omitempty"` } // Route defines a node in the routing tree. type Route struct { - // Name of the receiver for this route. If not empty, it should be listed in + // receiver defines the name of the receiver for this route. If not empty, it should be listed in // the `receivers` field. // +optional Receiver string `json:"receiver"` - // List of labels to group by. + // groupBy defines the list of labels to group by. // Labels must not be repeated (unique list). // Special label "..." (aggregate by all possible labels), if provided, must be the only element in the list. // +optional GroupBy []string `json:"groupBy,omitempty"` - // How long to wait before sending the initial notification. + // groupWait defines how long to wait before sending the initial notification. // Must match the regular expression`^(([0-9]+)y)?(([0-9]+)w)?(([0-9]+)d)?(([0-9]+)h)?(([0-9]+)m)?(([0-9]+)s)?(([0-9]+)ms)?$` // Example: "30s" // +optional GroupWait string `json:"groupWait,omitempty"` - // How long to wait before sending an updated notification. + // groupInterval defines how long to wait before sending an updated notification. // Must match the regular expression`^(([0-9]+)y)?(([0-9]+)w)?(([0-9]+)d)?(([0-9]+)h)?(([0-9]+)m)?(([0-9]+)s)?(([0-9]+)ms)?$` // Example: "5m" // +optional GroupInterval string `json:"groupInterval,omitempty"` - // How long to wait before repeating the last notification. + // repeatInterval defines how long to wait before repeating the last notification. // Must match the regular expression`^(([0-9]+)y)?(([0-9]+)w)?(([0-9]+)d)?(([0-9]+)h)?(([0-9]+)m)?(([0-9]+)s)?(([0-9]+)ms)?$` // Example: "4h" // +optional RepeatInterval string `json:"repeatInterval,omitempty"` - // List of matchers that the alert's labels should match. For the first + // matchers defines the list of matchers that the alert's labels should match. For the first // level route, the operator removes any existing equality and regexp // matcher on the `namespace` label and adds a `namespace: ` matcher. // +optional Matchers []Matcher `json:"matchers,omitempty"` - // Boolean indicating whether an alert should continue matching subsequent + // continue defines the boolean indicating whether an alert should continue matching subsequent // sibling nodes. It will always be overridden to true for the first-level // route by the Prometheus operator. // +optional Continue bool `json:"continue,omitempty"` - // Child routes. + // routes defines the child routes. + // +optional Routes []apiextensionsv1.JSON `json:"routes,omitempty"` // Note: this comment applies to the field definition above but appears // below otherwise it gets included in the generated manifest. @@ -134,10 +139,11 @@ type Route struct { // an alternative type to circumvent the limitation. The downside is that // the Kube API can't validate the data beyond the fact that it is a valid // JSON representation. - // MuteTimeIntervals is a list of MuteTimeInterval names that will mute this route when matched, + + // muteTimeIntervals is a list of MuteTimeInterval names that will mute this route when matched, // +optional MuteTimeIntervals []string `json:"muteTimeIntervals,omitempty"` - // ActiveTimeIntervals is a list of MuteTimeInterval names when this route should be active. + // activeTimeIntervals is a list of MuteTimeInterval names when this route should be active. // +optional ActiveTimeIntervals []string `json:"activeTimeIntervals,omitempty"` } @@ -159,124 +165,139 @@ func (r *Route) ChildRoutes() ([]Route, error) { // Receiver defines one or more notification integrations. type Receiver struct { - // Name of the receiver. Must be unique across all items from the list. + // name defines the name of the receiver. Must be unique across all items from the list. // +kubebuilder:validation:MinLength=1 + // +required Name string `json:"name"` - // List of OpsGenie configurations. + // opsgenieConfigs defines the list of OpsGenie configurations. + // +optional OpsGenieConfigs []OpsGenieConfig `json:"opsgenieConfigs,omitempty"` - // List of PagerDuty configurations. + // pagerdutyConfigs defines the List of PagerDuty configurations. + // +optional PagerDutyConfigs []PagerDutyConfig `json:"pagerdutyConfigs,omitempty"` - // List of Discord configurations. + // discordConfigs defines the list of Slack configurations. // +optional DiscordConfigs []DiscordConfig `json:"discordConfigs,omitempty"` - // List of Slack configurations. + // slackConfigs defines the list of Slack configurations. + // +optional SlackConfigs []SlackConfig `json:"slackConfigs,omitempty"` - // List of webhook configurations. + // webhookConfigs defines the List of webhook configurations. + // +optional WebhookConfigs []WebhookConfig `json:"webhookConfigs,omitempty"` - // List of WeChat configurations. + // wechatConfigs defines the list of WeChat configurations. + // +optional WeChatConfigs []WeChatConfig `json:"wechatConfigs,omitempty"` - // List of Email configurations. + // emailConfigs defines the list of Email configurations. + // +optional EmailConfigs []EmailConfig `json:"emailConfigs,omitempty"` - // List of VictorOps configurations. + // victoropsConfigs defines the list of VictorOps configurations. + // +optional VictorOpsConfigs []VictorOpsConfig `json:"victoropsConfigs,omitempty"` - // List of Pushover configurations. + // pushoverConfigs defines the list of Pushover configurations. + // +optional PushoverConfigs []PushoverConfig `json:"pushoverConfigs,omitempty"` - // List of SNS configurations + // snsConfigs defines the list of SNS configurations + // +optional SNSConfigs []SNSConfig `json:"snsConfigs,omitempty"` - // List of Telegram configurations. + // telegramConfigs defines the list of Telegram configurations. + // +optional TelegramConfigs []TelegramConfig `json:"telegramConfigs,omitempty"` - // List of Webex configurations. + // webexConfigs defines the list of Webex configurations. + // +optional WebexConfigs []WebexConfig `json:"webexConfigs,omitempty"` - // List of MSTeams configurations. + // msteamsConfigs defines the list of MSTeams configurations. // It requires Alertmanager >= 0.26.0. + // +optional MSTeamsConfigs []MSTeamsConfig `json:"msteamsConfigs,omitempty"` - // List of MSTeamsV2 configurations. + // msteamsv2Configs defines the list of MSTeamsV2 configurations. // It requires Alertmanager >= 0.28.0. + // +optional MSTeamsV2Configs []MSTeamsV2Config `json:"msteamsv2Configs,omitempty"` - // List of RocketChat configurations. + // rocketchatConfigs defines the list of RocketChat configurations. // It requires Alertmanager >= 0.28.0. + // +optional RocketChatConfigs []RocketChatConfig `json:"rocketchatConfigs,omitempty"` } // PagerDutyConfig configures notifications via PagerDuty. // See https://prometheus.io/docs/alerting/latest/configuration/#pagerduty_config type PagerDutyConfig struct { - // Whether or not to notify about resolved alerts. + // sendResolved defines whether or not to notify about resolved alerts. // +optional SendResolved *bool `json:"sendResolved,omitempty"` - // The secret's key that contains the PagerDuty integration key (when using + // routingKey defines the secret's key that contains the PagerDuty integration key (when using // Events API v2). Either this field or `serviceKey` needs to be defined. // The secret needs to be in the same namespace as the AlertmanagerConfig // object and accessible by the Prometheus Operator. // +optional RoutingKey *v1.SecretKeySelector `json:"routingKey,omitempty"` - // The secret's key that contains the PagerDuty service key (when using + // serviceKey defines the secret's key that contains the PagerDuty service key (when using // integration type "Prometheus"). Either this field or `routingKey` needs to // be defined. // The secret needs to be in the same namespace as the AlertmanagerConfig // object and accessible by the Prometheus Operator. // +optional ServiceKey *v1.SecretKeySelector `json:"serviceKey,omitempty"` - // The URL to send requests to. + // url defines the URL to send requests to. // +optional URL string `json:"url,omitempty"` - // Client identification. + // client defines the client identification. // +optional Client string `json:"client,omitempty"` - // Backlink to the sender of notification. + // clientURL defines the backlink to the sender of notification. // +optional ClientURL string `json:"clientURL,omitempty"` - // Description of the incident. + // description of the incident. // +optional Description string `json:"description,omitempty"` - // Severity of the incident. + // severity of the incident. // +optional Severity string `json:"severity,omitempty"` - // The class/type of the event. + // class defines the class/type of the event. // +optional Class string `json:"class,omitempty"` - // A cluster or grouping of sources. + // group defines a cluster or grouping of sources. // +optional Group string `json:"group,omitempty"` - // The part or component of the affected system that is broken. + // component defines the part or component of the affected system that is broken. // +optional Component string `json:"component,omitempty"` - // Arbitrary key/value pairs that provide further detail about the incident. + // details defines the arbitrary key/value pairs that provide further detail about the incident. // +optional Details []KeyValue `json:"details,omitempty"` - // A list of image details to attach that provide further detail about an incident. + // pagerDutyImageConfigs defines a list of image details to attach that provide further detail about an incident. // +optional PagerDutyImageConfigs []PagerDutyImageConfig `json:"pagerDutyImageConfigs,omitempty"` - // A list of link details to attach that provide further detail about an incident. + // pagerDutyLinkConfigs defines a list of link details to attach that provide further detail about an incident. // +optional PagerDutyLinkConfigs []PagerDutyLinkConfig `json:"pagerDutyLinkConfigs,omitempty"` - // HTTP client configuration. + // httpConfig defines the HTTP client configuration. // +optional HTTPConfig *HTTPConfig `json:"httpConfig,omitempty"` - // Unique location of the affected system. + // source defines the unique location of the affected system. // +optional Source *string `yaml:"source,omitempty" json:"source,omitempty"` } // PagerDutyImageConfig attaches images to an incident type PagerDutyImageConfig struct { - // Src of the image being attached to the incident + // src of the image being attached to the incident // +optional Src string `json:"src,omitempty"` - // Optional URL; makes the image a clickable link. + // href defines the optional URL; makes the image a clickable link. // +optional Href string `json:"href,omitempty"` - // Alt is the optional alternative text for the image. + // alt is the optional alternative text for the image. // +optional Alt string `json:"alt,omitempty"` } // PagerDutyLinkConfig attaches text links to an incident type PagerDutyLinkConfig struct { - // Href is the URL of the link to be attached + // href defines the URL of the link to be attached // +optional Href string `json:"href,omitempty"` - // Text that describes the purpose of the link, and can be used as the link's text. + // alt defines the text that describes the purpose of the link, and can be used as the link's text. // +optional Text string `json:"alt,omitempty"` } @@ -284,32 +305,32 @@ type PagerDutyLinkConfig struct { // DiscordConfig configures notifications via Discord. // See https://prometheus.io/docs/alerting/latest/configuration/#discord_config type DiscordConfig struct { - // Whether or not to notify about resolved alerts. + // sendResolved defines whether or not to notify about resolved alerts. // +optional SendResolved *bool `json:"sendResolved,omitempty"` - // The secret's key that contains the Discord webhook URL. + // apiURL defines the secret's key that contains the Discord webhook URL. // The secret needs to be in the same namespace as the AlertmanagerConfig // object and accessible by the Prometheus Operator. // +required APIURL v1.SecretKeySelector `json:"apiURL"` - // The template of the message's title. + // title defines the template of the message's title. // +optional Title *string `json:"title,omitempty"` - // The template of the message's body. + // message defines the template of the message's body. // +optional Message *string `json:"message,omitempty"` - // The template of the content's body. + // content defines the template of the content's body. // +optional // +kubebuilder:validation:MinLength=1 Content *string `json:"content,omitempty"` - // The username of the message sender. + // username defines the username of the message sender. // +optional // +kubebuilder:validation:MinLength=1 Username *string `json:"username,omitempty"` - // The avatar url of the message sender. + // avatarURL defines the avatar url of the message sender. // +optional AvatarURL *URL `json:"avatarURL,omitempty"` - // HTTP client configuration. + // httpConfig defines the HTTP client configuration. // +optional HTTPConfig *HTTPConfig `json:"httpConfig,omitempty"` } @@ -317,56 +338,77 @@ type DiscordConfig struct { // SlackConfig configures notifications via Slack. // See https://prometheus.io/docs/alerting/latest/configuration/#slack_config type SlackConfig struct { - // Whether or not to notify about resolved alerts. + // sendResolved defines whether or not to notify about resolved alerts. // +optional SendResolved *bool `json:"sendResolved,omitempty"` - // The secret's key that contains the Slack webhook URL. + // apiURL defines the secret's key that contains the Slack webhook URL. // The secret needs to be in the same namespace as the AlertmanagerConfig // object and accessible by the Prometheus Operator. // +optional APIURL *v1.SecretKeySelector `json:"apiURL,omitempty"` - // The channel or user to send notifications to. + // channel defines the channel or user to send notifications to. // +optional Channel string `json:"channel,omitempty"` + // username defines the slack bot user name. // +optional Username string `json:"username,omitempty"` + // color defines the color of the left border of the Slack message attachment. + // Can be a hex color code (e.g., "#ff0000") or a predefined color name. // +optional Color string `json:"color,omitempty"` + // title defines the title text displayed in the Slack message attachment. // +optional Title string `json:"title,omitempty"` + // titleLink defines the URL that the title will link to when clicked. // +optional TitleLink string `json:"titleLink,omitempty"` + // pretext defines optional text that appears above the message attachment block. // +optional Pretext string `json:"pretext,omitempty"` + // text defines the main text content of the Slack message attachment. // +optional Text string `json:"text,omitempty"` - // A list of Slack fields that are sent with each notification. + // fields defines a list of Slack fields that are sent with each notification. // +optional Fields []SlackField `json:"fields,omitempty"` + // shortFields determines whether fields are displayed in a compact format. + // When true, fields are shown side by side when possible. // +optional ShortFields bool `json:"shortFields,omitempty"` + // footer defines small text displayed at the bottom of the message attachment. // +optional Footer string `json:"footer,omitempty"` + // fallback defines a plain-text summary of the attachment for clients that don't support attachments. // +optional Fallback string `json:"fallback,omitempty"` + // callbackId defines an identifier for the message used in interactive components. // +optional CallbackID string `json:"callbackId,omitempty"` + // iconEmoji defines the emoji to use as the bot's avatar (e.g., ":ghost:"). // +optional IconEmoji string `json:"iconEmoji,omitempty"` + // iconURL defines the URL to an image to use as the bot's avatar. // +optional IconURL string `json:"iconURL,omitempty"` + // imageURL defines the URL to an image file that will be displayed inside the message attachment. // +optional ImageURL string `json:"imageURL,omitempty"` + // thumbURL defines the URL to an image file that will be displayed as a thumbnail + // on the right side of the message attachment. // +optional ThumbURL string `json:"thumbURL,omitempty"` + // linkNames enables automatic linking of channel names and usernames in the message. + // When true, @channel and @username will be converted to clickable links. // +optional LinkNames bool `json:"linkNames,omitempty"` + // mrkdwnIn defines which fields should be parsed as Slack markdown. + // Valid values include "pretext", "text", and "fields". // +optional MrkdwnIn []string `json:"mrkdwnIn,omitempty"` - // A list of Slack actions that are sent with each notification. + // actions defines a list of Slack actions that are sent with each notification. // +optional Actions []SlackAction `json:"actions,omitempty"` - // HTTP client configuration. + // httpConfig defines the HTTP client configuration. // +optional HTTPConfig *HTTPConfig `json:"httpConfig,omitempty"` } @@ -393,18 +435,34 @@ func (sc *SlackConfig) Validate() error { // See https://api.slack.com/docs/message-attachments#action_fields and // https://api.slack.com/docs/message-buttons for more information. type SlackAction struct { + // type defines the type of interactive component. + // Common values include "button" for clickable buttons and "select" for dropdown menus. // +kubebuilder:validation:MinLength=1 + // +required Type string `json:"type"` + // text defines the user-visible label displayed on the action element. + // For buttons, this is the button text. For select menus, this is the placeholder text. // +kubebuilder:validation:MinLength=1 + // +required Text string `json:"text"` + // url defines the URL to open when the action is triggered. + // Only applicable for button-type actions. When set, clicking the button opens this URL. // +optional URL string `json:"url,omitempty"` + // style defines the visual appearance of the action element. + // Valid values include "default", "primary" (green), and "danger" (red). // +optional Style string `json:"style,omitempty"` + // name defines a unique identifier for the action within the message. + // This value is sent back to your application when the action is triggered. // +optional Name string `json:"name,omitempty"` + // value defines the payload sent when the action is triggered. + // This data is included in the callback sent to your application. // +optional Value string `json:"value,omitempty"` + // confirm defines an optional confirmation dialog that appears before the action is executed. + // When set, users must confirm their intent before the action proceeds. // +optional ConfirmField *SlackConfirmationField `json:"confirm,omitempty"` } @@ -438,12 +496,21 @@ func (sa *SlackAction) Validate() error { // See https://api.slack.com/docs/interactive-message-field-guide#confirmation_fields // for more information. type SlackConfirmationField struct { + // text defines the main message displayed in the confirmation dialog. + // This should be a clear question or statement asking the user to confirm their action. // +kubebuilder:validation:MinLength=1 + // +required Text string `json:"text"` + // title defines the title text displayed at the top of the confirmation dialog. + // When not specified, a default title will be used. // +optional Title string `json:"title,omitempty"` + // okText defines the label for the confirmation button in the dialog. + // When not specified, defaults to "Okay". This button proceeds with the action. // +optional OkText string `json:"okText,omitempty"` + // dismissText defines the label for the cancel button in the dialog. + // When not specified, defaults to "Cancel". This button cancels the action. // +optional DismissText string `json:"dismissText,omitempty"` } @@ -461,10 +528,19 @@ func (scf *SlackConfirmationField) Validate() error { // is short enough to be displayed next to other fields designated as short. // See https://api.slack.com/docs/message-attachments#fields for more information. type SlackField struct { + // title defines the label or header text displayed for this field. + // This appears as bold text above the field value in the Slack message. // +kubebuilder:validation:MinLength=1 + // +required Title string `json:"title"` + // value defines the content or data displayed for this field. + // This appears below the title and can contain plain text or Slack markdown. // +kubebuilder:validation:MinLength=1 + // +required Value string `json:"value"` + // short determines whether this field can be displayed alongside other short fields. + // When true, Slack may display this field side by side with other short fields. + // When false or not specified, the field takes the full width of the message. // +optional Short *bool `json:"short,omitempty"` } @@ -485,29 +561,29 @@ func (sf *SlackField) Validate() error { // WebhookConfig configures notifications via a generic receiver supporting the webhook payload. // See https://prometheus.io/docs/alerting/latest/configuration/#webhook_config type WebhookConfig struct { - // Whether or not to notify about resolved alerts. + // sendResolved defines whether or not to notify about resolved alerts. // +optional SendResolved *bool `json:"sendResolved,omitempty"` - // The URL to send HTTP POST requests to. `urlSecret` takes precedence over - // `url`. One of `urlSecret` and `url` should be defined. + // url defines the URL to send HTTP POST requests to. + // urlSecret takes precedence over url. One of urlSecret and url should be defined. // +optional URL *string `json:"url,omitempty"` - // The secret's key that contains the webhook URL to send HTTP requests to. - // `urlSecret` takes precedence over `url`. One of `urlSecret` and `url` - // should be defined. + // urlSecret defines the secret's key that contains the webhook URL to send HTTP requests to. + // urlSecret takes precedence over url. One of urlSecret and url should be defined. // The secret needs to be in the same namespace as the AlertmanagerConfig // object and accessible by the Prometheus Operator. // +optional URLSecret *v1.SecretKeySelector `json:"urlSecret,omitempty"` - // HTTP client configuration. + // httpConfig defines the HTTP client configuration for webhook requests. // +optional HTTPConfig *HTTPConfig `json:"httpConfig,omitempty"` - // Maximum number of alerts to be sent per webhook message. When 0, all alerts are included. + // maxAlerts defines the maximum number of alerts to be sent per webhook message. + // When 0, all alerts are included in the webhook payload. // +optional // +kubebuilder:validation:Minimum=0 MaxAlerts int32 `json:"maxAlerts,omitempty"` - // The maximum time to wait for a webhook request to complete, before failing the - // request and allowing it to be retried. + // timeout defines the maximum time to wait for a webhook request to complete, + // before failing the request and allowing it to be retried. // It requires Alertmanager >= v0.28.0. // +optional Timeout *monitoringv1.Duration `json:"timeout,omitempty"` @@ -516,52 +592,63 @@ type WebhookConfig struct { // OpsGenieConfig configures notifications via OpsGenie. // See https://prometheus.io/docs/alerting/latest/configuration/#opsgenie_config type OpsGenieConfig struct { - // Whether or not to notify about resolved alerts. + // sendResolved defines whether or not to notify about resolved alerts. // +optional SendResolved *bool `json:"sendResolved,omitempty"` - // The secret's key that contains the OpsGenie API key. + // apiKey defines the secret's key that contains the OpsGenie API key. // The secret needs to be in the same namespace as the AlertmanagerConfig // object and accessible by the Prometheus Operator. // +optional APIKey *v1.SecretKeySelector `json:"apiKey,omitempty"` - // The URL to send OpsGenie API requests to. + // apiURL defines the URL to send OpsGenie API requests to. + // When not specified, defaults to the standard OpsGenie API endpoint. // +optional APIURL string `json:"apiURL,omitempty"` - // Alert text limited to 130 characters. + // message defines the alert text limited to 130 characters. + // This appears as the main alert title in OpsGenie. // +optional Message string `json:"message,omitempty"` - // Description of the incident. + // description defines the detailed description of the incident. + // This provides additional context beyond the message field. // +optional Description string `json:"description,omitempty"` - // Backlink to the sender of the notification. + // source defines the backlink to the sender of the notification. + // This helps identify where the alert originated from. // +optional Source string `json:"source,omitempty"` - // Comma separated list of tags attached to the notifications. + // tags defines a comma separated list of tags attached to the notifications. + // These help categorize and filter alerts within OpsGenie. // +optional Tags string `json:"tags,omitempty"` - // Additional alert note. + // note defines an additional alert note. + // This provides supplementary information about the alert. // +optional Note string `json:"note,omitempty"` - // Priority level of alert. Possible values are P1, P2, P3, P4, and P5. + // priority defines the priority level of alert. + // Possible values are P1, P2, P3, P4, and P5, where P1 is highest priority. // +optional Priority string `json:"priority,omitempty"` - // Whether to update message and description of the alert in OpsGenie if it already exists + // updateAlerts defines Whether to update message and description of the alert in OpsGenie if it already exists // By default, the alert is never updated in OpsGenie, the new message only appears in activity log. // +optional UpdateAlerts *bool `json:"updateAlerts,omitempty"` - // A set of arbitrary key/value pairs that provide further detail about the incident. + // details defines a set of arbitrary key/value pairs that provide further detail about the incident. + // These appear as additional fields in the OpsGenie alert. // +optional Details []KeyValue `json:"details,omitempty"` - // List of responders responsible for notifications. + // responders defines the list of responders responsible for notifications. + // These determine who gets notified when the alert is created. // +optional Responders []OpsGenieConfigResponder `json:"responders,omitempty"` - // HTTP client configuration. + // httpConfig defines the HTTP client configuration for OpsGenie API requests. // +optional HTTPConfig *HTTPConfig `json:"httpConfig,omitempty"` - // Optional field that can be used to specify which domain alert is related to. + // entity defines an optional field that can be used to specify which domain alert is related to. + // This helps group related alerts together in OpsGenie. // +optional Entity string `json:"entity,omitempty"` - // Comma separated list of actions that will be available for the alert. + // actions defines a comma separated list of actions that will be available for the alert. + // These appear as action buttons in the OpsGenie interface. // +optional Actions string `json:"actions,omitempty"` } @@ -579,17 +666,24 @@ func (o *OpsGenieConfig) Validate() error { // OpsGenieConfigResponder defines a responder to an incident. // One of `id`, `name` or `username` has to be defined. type OpsGenieConfigResponder struct { - // ID of the responder. + // id defines the unique identifier of the responder. + // This corresponds to the responder's ID within OpsGenie. // +optional ID string `json:"id,omitempty"` - // Name of the responder. + // name defines the display name of the responder. + // This is used when the responder is identified by name rather than ID. // +optional Name string `json:"name,omitempty"` - // Username of the responder. + // username defines the username of the responder. + // This is typically used for user-type responders when identifying by username. // +optional Username string `json:"username,omitempty"` - // Type of responder. + // type defines the type of responder. + // Valid values include "user", "team", "schedule", and "escalation". + // This determines how OpsGenie interprets the other identifier fields. // +kubebuilder:validation:MinLength=1 + // +kubebuilder:validation:Enum=team;teams;user;escalation;schedule + // +required Type string `json:"type"` } @@ -620,29 +714,30 @@ func (r *OpsGenieConfigResponder) Validate() error { // HTTPConfig defines a client HTTP configuration. // See https://prometheus.io/docs/alerting/latest/configuration/#http_config type HTTPConfig struct { - // Authorization header configuration for the client. + // authorization defines the authorization header configuration for the client. // This is mutually exclusive with BasicAuth and is only available starting from Alertmanager v0.22+. // +optional Authorization *monitoringv1.SafeAuthorization `json:"authorization,omitempty"` - // BasicAuth for the client. + // basicAuth defines the basic authentication credentials for the client. // This is mutually exclusive with Authorization. If both are defined, BasicAuth takes precedence. // +optional BasicAuth *monitoringv1.BasicAuth `json:"basicAuth,omitempty"` - // OAuth2 client credentials used to fetch a token for the targets. + // oauth2 defines the OAuth2 client credentials used to fetch a token for the targets. + // This enables OAuth2 authentication flow for HTTP requests. // +optional OAuth2 *monitoringv1.OAuth2 `json:"oauth2,omitempty"` - // The secret's key that contains the bearer token to be used by the client + // bearerTokenSecret defines the secret's key that contains the bearer token to be used by the client // for authentication. // The secret needs to be in the same namespace as the AlertmanagerConfig // object and accessible by the Prometheus Operator. // +optional BearerTokenSecret *v1.SecretKeySelector `json:"bearerTokenSecret,omitempty"` - // TLS configuration for the client. + // tlsConfig defines the TLS configuration for the client. + // This includes settings for certificates, CA validation, and TLS protocol options. // +optional TLSConfig *monitoringv1.SafeTLSConfig `json:"tlsConfig,omitempty"` - // Optional proxy URL. - // + // proxyURL defines an optional proxy URL for HTTP requests. // If defined, this field takes precedence over `proxyUrl`. // // +optional @@ -650,33 +745,37 @@ type HTTPConfig struct { monitoringv1.ProxyConfig `json:",inline"` - // FollowRedirects specifies whether the client should follow HTTP 3xx redirects. + // followRedirects specifies whether the client should follow HTTP 3xx redirects. + // When true, the client will automatically follow redirect responses. // +optional FollowRedirects *bool `json:"followRedirects,omitempty"` + + // enableHttp2 can be used to disable HTTP2. + // + // +optional + EnableHTTP2 *bool `json:"enableHttp2,omitempty"` } // WebexConfig configures notification via Cisco Webex // See https://prometheus.io/docs/alerting/latest/configuration/#webex_config type WebexConfig struct { - // Whether to notify about resolved alerts. + // sendResolved defines whether or not to notify about resolved alerts. // +optional SendResolved *bool `json:"sendResolved,omitempty"` - // The Webex Teams API URL i.e. https://webexapis.com/v1/messages - // Provide if different from the default API URL. + // apiURL defines the Webex Teams API URL i.e. https://webexapis.com/v1/messages // +optional APIURL *URL `json:"apiURL,omitempty"` - // The HTTP client's configuration. - // You must supply the bot token via the `httpConfig.authorization` field. + // httpConfig defines the HTTP client's configuration. // +optional HTTPConfig *HTTPConfig `json:"httpConfig,omitempty"` - // Message template + // message defines the message template // +optional Message *string `json:"message,omitempty"` - // ID of the Webex Teams room where to send the messages. + // roomID defines the ID of the Webex Teams room where to send the messages. // +kubebuilder:validation:MinLength=1 // +required RoomID string `json:"roomID"` @@ -685,82 +784,109 @@ type WebexConfig struct { // WeChatConfig configures notifications via WeChat. // See https://prometheus.io/docs/alerting/latest/configuration/#wechat_config type WeChatConfig struct { - // Whether or not to notify about resolved alerts. + // sendResolved defines whether or not to notify about resolved alerts. // +optional SendResolved *bool `json:"sendResolved,omitempty"` - // The secret's key that contains the WeChat API key. + // apiSecret defines the secret's key that contains the WeChat API key. // The secret needs to be in the same namespace as the AlertmanagerConfig // object and accessible by the Prometheus Operator. // +optional APISecret *v1.SecretKeySelector `json:"apiSecret,omitempty"` - // The WeChat API URL. + // apiURL defines the WeChat API URL. + // When not specified, defaults to the standard WeChat Work API endpoint. // +optional APIURL string `json:"apiURL,omitempty"` - // The corp id for authentication. + // corpID defines the corp id for authentication. + // This is the unique identifier for your WeChat Work organization. // +optional CorpID string `json:"corpID,omitempty"` + // agentID defines the application agent ID within WeChat Work. + // This identifies which WeChat Work application will send the notifications. // +optional AgentID string `json:"agentID,omitempty"` + // toUser defines the target user(s) to receive the notification. + // Can be a single user ID or multiple user IDs separated by '|'. // +optional ToUser string `json:"toUser,omitempty"` + // toParty defines the target department(s) to receive the notification. + // Can be a single department ID or multiple department IDs separated by '|'. // +optional ToParty string `json:"toParty,omitempty"` + // toTag defines the target tag(s) to receive the notification. + // Can be a single tag ID or multiple tag IDs separated by '|'. // +optional ToTag string `json:"toTag,omitempty"` - // API request data as defined by the WeChat API. + // message defines the API request data as defined by the WeChat API. + // This contains the actual notification content to be sent. + // +optional Message string `json:"message,omitempty"` + // messageType defines the type of message to send. + // Valid values include "text", "markdown", and other WeChat Work supported message types. // +optional MessageType string `json:"messageType,omitempty"` - // HTTP client configuration. + // httpConfig defines the HTTP client configuration for WeChat API requests. // +optional HTTPConfig *HTTPConfig `json:"httpConfig,omitempty"` } // EmailConfig configures notifications via Email. type EmailConfig struct { - // Whether or not to notify about resolved alerts. + // sendResolved defines whether or not to notify about resolved alerts. // +optional SendResolved *bool `json:"sendResolved,omitempty"` - // The email address to send notifications to. + // to defines the email address to send notifications to. + // This is the recipient address for alert notifications. // +optional To string `json:"to,omitempty"` - // The sender address. + // from defines the sender address for email notifications. + // This appears as the "From" field in the email header. // +optional From string `json:"from,omitempty"` - // The hostname to identify to the SMTP server. + // hello defines the hostname to identify to the SMTP server. + // This is used in the SMTP HELO/EHLO command during the connection handshake. // +optional Hello string `json:"hello,omitempty"` - // The SMTP host and port through which emails are sent. E.g. example.com:25 + // smarthost defines the SMTP host and port through which emails are sent. + // Format should be "hostname:port", e.g. "smtp.example.com:587". // +optional Smarthost string `json:"smarthost,omitempty"` - // The username to use for authentication. + // authUsername defines the username to use for SMTP authentication. + // This is used for SMTP AUTH when the server requires authentication. // +optional AuthUsername string `json:"authUsername,omitempty"` - // The secret's key that contains the password to use for authentication. + // authPassword defines the secret's key that contains the password to use for authentication. // The secret needs to be in the same namespace as the AlertmanagerConfig // object and accessible by the Prometheus Operator. + // +optional AuthPassword *v1.SecretKeySelector `json:"authPassword,omitempty"` - // The secret's key that contains the CRAM-MD5 secret. + // authSecret defines the secret's key that contains the CRAM-MD5 secret. + // This is used for CRAM-MD5 authentication mechanism. // The secret needs to be in the same namespace as the AlertmanagerConfig // object and accessible by the Prometheus Operator. + // +optional AuthSecret *v1.SecretKeySelector `json:"authSecret,omitempty"` - // The identity to use for authentication. + // authIdentity defines the identity to use for SMTP authentication. + // This is typically used with PLAIN authentication mechanism. // +optional AuthIdentity string `json:"authIdentity,omitempty"` - // Further headers email header key/value pairs. Overrides any headers - // previously set by the notification implementation. + // headers defines additional email header key/value pairs. + // These override any headers previously set by the notification implementation. + // +optional Headers []KeyValue `json:"headers,omitempty"` - // The HTML body of the email notification. + // html defines the HTML body of the email notification. + // This allows for rich formatting in the email content. // +optional HTML *string `json:"html,omitempty"` - // The text body of the email notification. + // text defines the plain text body of the email notification. + // This provides a fallback for email clients that don't support HTML. // +optional Text *string `json:"text,omitempty"` - // The SMTP TLS requirement. + // requireTLS defines the SMTP TLS requirement. // Note that Go does not support unencrypted connections to remote SMTP endpoints. // +optional RequireTLS *bool `json:"requireTLS,omitempty"` - // TLS configuration + // tlsConfig defines the TLS configuration for SMTP connections. + // This includes settings for certificates, CA validation, and TLS protocol options. // +optional TLSConfig *monitoringv1.SafeTLSConfig `json:"tlsConfig,omitempty"` } @@ -768,36 +894,43 @@ type EmailConfig struct { // VictorOpsConfig configures notifications via VictorOps. // See https://prometheus.io/docs/alerting/latest/configuration/#victorops_config type VictorOpsConfig struct { - // Whether or not to notify about resolved alerts. + // sendResolved defines whether or not to notify about resolved alerts. // +optional SendResolved *bool `json:"sendResolved,omitempty"` - // The secret's key that contains the API key to use when talking to the VictorOps API. + // apiKey defines the secret's key that contains the API key to use when talking to the VictorOps API. // The secret needs to be in the same namespace as the AlertmanagerConfig // object and accessible by the Prometheus Operator. // +optional APIKey *v1.SecretKeySelector `json:"apiKey,omitempty"` - // The VictorOps API URL. + // apiUrl defines the VictorOps API URL. + // When not specified, defaults to the standard VictorOps API endpoint. // +optional APIURL string `json:"apiUrl,omitempty"` - // A key used to map the alert to a team. + // routingKey defines a key used to map the alert to a team. + // This determines which VictorOps team will receive the alert notification. // +optional RoutingKey string `json:"routingKey"` - // Describes the behavior of the alert (CRITICAL, WARNING, INFO). + // messageType describes the behavior of the alert. + // Valid values are "CRITICAL", "WARNING", and "INFO". // +optional MessageType string `json:"messageType,omitempty"` - // Contains summary of the alerted problem. + // entityDisplayName contains a summary of the alerted problem. + // This appears as the main title or identifier for the incident. // +optional EntityDisplayName string `json:"entityDisplayName,omitempty"` - // Contains long explanation of the alerted problem. + // stateMessage contains a long explanation of the alerted problem. + // This provides detailed context about the incident. // +optional StateMessage string `json:"stateMessage,omitempty"` - // The monitoring tool the state message is from. + // monitoringTool defines the monitoring tool the state message is from. + // This helps identify the source system that generated the alert. // +optional MonitoringTool string `json:"monitoringTool,omitempty"` - // Additional custom fields for notification. + // customFields defines additional custom fields for notification. + // These provide extra metadata that will be included with the VictorOps incident. // +optional CustomFields []KeyValue `json:"customFields,omitempty"` - // The HTTP client's configuration. + // httpConfig defines the HTTP client's configuration for VictorOps API requests. // +optional HTTPConfig *HTTPConfig `json:"httpConfig,omitempty"` } @@ -805,69 +938,80 @@ type VictorOpsConfig struct { // PushoverConfig configures notifications via Pushover. // See https://prometheus.io/docs/alerting/latest/configuration/#pushover_config type PushoverConfig struct { - // Whether or not to notify about resolved alerts. + // sendResolved defines whether or not to notify about resolved alerts. // +optional SendResolved *bool `json:"sendResolved,omitempty"` - // The secret's key that contains the recipient user's user key. + // userKey defines the secret's key that contains the recipient user's user key. // The secret needs to be in the same namespace as the AlertmanagerConfig // object and accessible by the Prometheus Operator. // Either `userKey` or `userKeyFile` is required. // +optional UserKey *v1.SecretKeySelector `json:"userKey,omitempty"` - // The user key file that contains the recipient user's user key. + // userKeyFile defines the user key file that contains the recipient user's user key. // Either `userKey` or `userKeyFile` is required. // It requires Alertmanager >= v0.26.0. // +optional UserKeyFile *string `json:"userKeyFile,omitempty"` - // The secret's key that contains the registered application's API token, see https://pushover.net/apps. + // token defines the secret's key that contains the registered application's API token. + // See https://pushover.net/apps for application registration. // The secret needs to be in the same namespace as the AlertmanagerConfig // object and accessible by the Prometheus Operator. // Either `token` or `tokenFile` is required. // +optional Token *v1.SecretKeySelector `json:"token,omitempty"` - // The token file that contains the registered application's API token, see https://pushover.net/apps. + // tokenFile defines the token file that contains the registered application's API token. + // See https://pushover.net/apps for application registration. // Either `token` or `tokenFile` is required. // It requires Alertmanager >= v0.26.0. // +optional TokenFile *string `json:"tokenFile,omitempty"` - // Notification title. + // title defines the notification title displayed in the Pushover message. + // This appears as the bold header text in the notification. // +optional Title string `json:"title,omitempty"` - // Notification message. + // message defines the notification message content. + // This is the main body text of the Pushover notification. // +optional Message string `json:"message,omitempty"` - // A supplementary URL shown alongside the message. + // url defines a supplementary URL shown alongside the message. + // This creates a clickable link within the Pushover notification. // +optional URL string `json:"url,omitempty"` - // A title for supplementary URL, otherwise just the URL is shown + // urlTitle defines a title for the supplementary URL. + // If not specified, the raw URL is shown instead. // +optional URLTitle string `json:"urlTitle,omitempty"` - // The time to live definition for the alert notification + // ttl defines the time to live for the alert notification. + // This determines how long the notification remains active before expiring. // +optional TTL *monitoringv1.Duration `json:"ttl,omitempty"` - // The name of a device to send the notification to + // device defines the name of a specific device to send the notification to. + // If not specified, the notification is sent to all user's devices. // +optional Device *string `json:"device,omitempty"` - // The name of one of the sounds supported by device clients to override the user's default sound choice + // sound defines the name of one of the sounds supported by device clients. + // This overrides the user's default sound choice for this notification. // +optional Sound string `json:"sound,omitempty"` - // Priority, see https://pushover.net/api#priority + // priority defines the notification priority level. + // See https://pushover.net/api#priority for valid values and behavior. // +optional Priority string `json:"priority,omitempty"` - // How often the Pushover servers will send the same notification to the user. - // Must be at least 30 seconds. + // retry defines how often the Pushover servers will send the same notification to the user. + // Must be at least 30 seconds. Only applies to priority 2 notifications. // +kubebuilder:validation:Pattern=`^(([0-9]+)y)?(([0-9]+)w)?(([0-9]+)d)?(([0-9]+)h)?(([0-9]+)m)?(([0-9]+)s)?(([0-9]+)ms)?$` // +optional Retry string `json:"retry,omitempty"` - // How long your notification will continue to be retried for, unless the user - // acknowledges the notification. + // expire defines how long your notification will continue to be retried for, + // unless the user acknowledges the notification. Only applies to priority 2 notifications. // +kubebuilder:validation:Pattern=`^(([0-9]+)y)?(([0-9]+)w)?(([0-9]+)d)?(([0-9]+)h)?(([0-9]+)m)?(([0-9]+)s)?(([0-9]+)ms)?$` // +optional Expire string `json:"expire,omitempty"` - // Whether notification message is HTML or plain text. + // html defines whether notification message is HTML or plain text. + // When true, the message can include HTML formatting tags. // +optional HTML bool `json:"html,omitempty"` - // HTTP client configuration. + // httpConfig defines the HTTP client configuration for Pushover API requests. // +optional HTTPConfig *HTTPConfig `json:"httpConfig,omitempty"` } @@ -875,38 +1019,42 @@ type PushoverConfig struct { // SNSConfig configures notifications via AWS SNS. // See https://prometheus.io/docs/alerting/latest/configuration/#sns_configs type SNSConfig struct { - // Whether or not to notify about resolved alerts. + // sendResolved defines whether or not to notify about resolved alerts. // +optional SendResolved *bool `json:"sendResolved,omitempty"` - // The SNS API URL i.e. https://sns.us-east-2.amazonaws.com. + // apiURL defines the SNS API URL, e.g. https://sns.us-east-2.amazonaws.com. // If not specified, the SNS API URL from the SNS SDK will be used. // +optional ApiURL string `json:"apiURL,omitempty"` - // Configures AWS's Signature Verification 4 signing process to sign requests. + // sigv4 configures AWS's Signature Verification 4 signing process to sign requests. + // This includes AWS credentials and region configuration for authentication. // +optional Sigv4 *monitoringv1.Sigv4 `json:"sigv4,omitempty"` - // SNS topic ARN, i.e. arn:aws:sns:us-east-2:698519295917:My-Topic + // topicARN defines the SNS topic ARN, e.g. arn:aws:sns:us-east-2:698519295917:My-Topic. // If you don't specify this value, you must specify a value for the PhoneNumber or TargetARN. // +optional TopicARN string `json:"topicARN,omitempty"` - // Subject line when the message is delivered to email endpoints. + // subject defines the subject line when the message is delivered to email endpoints. + // This field is only used when sending to email subscribers of an SNS topic. // +optional Subject string `json:"subject,omitempty"` - // Phone number if message is delivered via SMS in E.164 format. + // phoneNumber defines the phone number if message is delivered via SMS in E.164 format. // If you don't specify this value, you must specify a value for the TopicARN or TargetARN. // +optional PhoneNumber string `json:"phoneNumber,omitempty"` - // The mobile platform endpoint ARN if message is delivered via mobile notifications. - // If you don't specify this value, you must specify a value for the topic_arn or PhoneNumber. + // targetARN defines the mobile platform endpoint ARN if message is delivered via mobile notifications. + // If you don't specify this value, you must specify a value for the TopicARN or PhoneNumber. // +optional TargetARN string `json:"targetARN,omitempty"` - // The message content of the SNS notification. + // message defines the message content of the SNS notification. + // This is the actual notification text that will be sent to subscribers. // +optional Message string `json:"message,omitempty"` - // SNS message attributes. + // attributes defines SNS message attributes as key-value pairs. + // These provide additional metadata that can be used for message filtering and routing. // +optional Attributes map[string]string `json:"attributes,omitempty"` - // HTTP client configuration. + // httpConfig defines the HTTP client configuration for SNS API requests. // +optional HTTPConfig *HTTPConfig `json:"httpConfig,omitempty"` } @@ -914,46 +1062,49 @@ type SNSConfig struct { // TelegramConfig configures notifications via Telegram. // See https://prometheus.io/docs/alerting/latest/configuration/#telegram_config type TelegramConfig struct { - // Whether to notify about resolved alerts. + // sendResolved defines whether or not to notify about resolved alerts. // +optional SendResolved *bool `json:"sendResolved,omitempty"` - // The Telegram API URL i.e. https://api.telegram.org. - // If not specified, default API URL will be used. + // apiURL defines the Telegram API URL, e.g. https://api.telegram.org. + // If not specified, the default Telegram API URL will be used. // +optional APIURL string `json:"apiURL,omitempty"` - // Telegram bot token. It is mutually exclusive with `botTokenFile`. + // botToken defines the Telegram bot token. It is mutually exclusive with `botTokenFile`. // The secret needs to be in the same namespace as the AlertmanagerConfig // object and accessible by the Prometheus Operator. - // // Either `botToken` or `botTokenFile` is required. - // - //+optional + // +optional BotToken *v1.SecretKeySelector `json:"botToken,omitempty"` - // File to read the Telegram bot token from. It is mutually exclusive with `botToken`. + // botTokenFile defines the file to read the Telegram bot token from. + // It is mutually exclusive with `botToken`. // Either `botToken` or `botTokenFile` is required. - // // It requires Alertmanager >= v0.26.0. - // // +optional BotTokenFile *string `json:"botTokenFile,omitempty"` - // The Telegram chat ID. + // chatID defines the Telegram chat ID where messages will be sent. + // This can be a user ID, group ID, or channel ID (with @ prefix for public channels). // +required ChatID int64 `json:"chatID,omitempty"` - // The Telegram Group Topic ID. + // messageThreadID defines the Telegram Group Topic ID for threaded messages. + // This allows sending messages to specific topics within Telegram groups. // It requires Alertmanager >= 0.26.0. // +optional MessageThreadID *int64 `json:"messageThreadID,omitempty"` - // Message template + // message defines the message template for the Telegram notification. + // This is the content that will be sent to the specified chat. // +optional Message string `json:"message,omitempty"` - // Disable telegram notifications + // disableNotifications controls whether Telegram notifications are sent silently. + // When true, users will receive the message without notification sounds. // +optional DisableNotifications *bool `json:"disableNotifications,omitempty"` - // Parse mode for telegram message + // parseMode defines the parse mode for telegram message formatting. + // Valid values are "MarkdownV2", "Markdown", and "HTML". + // This determines how text formatting is interpreted in the message. //+kubebuilder:validation:Enum=MarkdownV2;Markdown;HTML // +optional ParseMode string `json:"parseMode,omitempty"` - // HTTP client configuration. + // httpConfig defines the HTTP client configuration for Telegram API requests. // +optional HTTPConfig *HTTPConfig `json:"httpConfig,omitempty"` } @@ -961,46 +1112,53 @@ type TelegramConfig struct { // MSTeamsConfig configures notifications via Microsoft Teams. // It requires Alertmanager >= 0.26.0. type MSTeamsConfig struct { - // Whether to notify about resolved alerts. + // sendResolved defines whether or not to notify about resolved alerts. // +optional SendResolved *bool `json:"sendResolved,omitempty"` - // MSTeams webhook URL. - // +kubebuilder:validation:Required + // webhookUrl defines the MSTeams webhook URL for sending notifications. + // This is the incoming webhook URL configured in your Teams channel. + // +required WebhookURL v1.SecretKeySelector `json:"webhookUrl"` - // Message title template. + // title defines the message title template for Teams notifications. + // This appears as the main heading of the Teams message card. // +optional Title *string `json:"title,omitempty"` - // Message summary template. + // summary defines the message summary template for Teams notifications. + // This provides a brief overview that appears in Teams notification previews. // It requires Alertmanager >= 0.27.0. // +optional Summary *string `json:"summary,omitempty"` - // Message body template. + // text defines the message body template for Teams notifications. + // This contains the detailed content of the Teams message. // +optional Text *string `json:"text,omitempty"` - // HTTP client configuration. + // httpConfig defines the HTTP client configuration for Teams webhook requests. // +optional HTTPConfig *HTTPConfig `json:"httpConfig,omitempty"` } -// MSTeamsV2Config configures notifications via Microsoft Teams using the new message format with adaptive cards as required by flows +// MSTeamsV2Config configures notifications via Microsoft Teams using the new message format with adaptive cards as required by flows. // See https://prometheus.io/docs/alerting/latest/configuration/#msteamsv2_config // It requires Alertmanager >= 0.28.0. type MSTeamsV2Config struct { - // Whether to notify about resolved alerts. + // sendResolved defines whether or not to notify about resolved alerts. // +optional SendResolved *bool `json:"sendResolved,omitempty"` - // MSTeams incoming webhook URL. + // webhookURL defines the MSTeams incoming webhook URL for adaptive card notifications. + // This webhook must support the newer adaptive cards format required by Teams flows. // +optional WebhookURL *v1.SecretKeySelector `json:"webhookURL,omitempty"` - // Message title template. + // title defines the message title template for adaptive card notifications. + // This appears as the main heading in the Teams adaptive card. // +kubebuilder:validation:MinLength=1 // +optional Title *string `json:"title,omitempty"` - // Message body template. + // text defines the message body template for adaptive card notifications. + // This contains the detailed content displayed in the Teams adaptive card format. // +kubebuilder:validation:MinLength=1 // +optional Text *string `json:"text,omitempty"` - // HTTP client configuration. + // httpConfig defines the HTTP client configuration for Teams webhook requests. // +optional HTTPConfig *HTTPConfig `json:"httpConfig,omitempty"` } @@ -1008,96 +1166,117 @@ type MSTeamsV2Config struct { // RocketChatConfig configures notifications via RocketChat. // It requires Alertmanager >= 0.28.0. type RocketChatConfig struct { - // Whether to notify about resolved alerts. + // sendResolved defines whether or not to notify about resolved alerts. // +optional SendResolved *bool `json:"sendResolved,omitempty"` - // The API URL for RocketChat. + // apiURL defines the API URL for RocketChat. // Defaults to https://open.rocket.chat/ if not specified. // +optional APIURL *URL `json:"apiURL,omitempty"` - // The channel to send alerts to. + // channel defines the channel to send alerts to. + // This can be a channel name (e.g., "#alerts") or a direct message recipient. // +kubebuilder:validation:MinLength=1 // +optional Channel *string `json:"channel,omitempty"` - // The sender token. + // token defines the sender token for RocketChat authentication. + // This is the personal access token or bot token used to authenticate API requests. // +required Token v1.SecretKeySelector `json:"token,omitempty"` - // The sender token ID. + // tokenID defines the sender token ID for RocketChat authentication. + // This is the user ID associated with the token used for API requests. // +required TokenID v1.SecretKeySelector `json:"tokenID,omitempty"` - // The message color. + // color defines the message color displayed in RocketChat. + // This appears as a colored bar alongside the message. // +kubebuilder:validation:MinLength=1 // +optional Color *string `json:"color,omitempty"` - // If provided, the avatar will be displayed as an emoji. + // emoji defines the emoji to be displayed as an avatar. + // If provided, this emoji will be used instead of the default avatar or iconURL. // +kubebuilder:validation:MinLength=1 // +optional Emoji *string `json:"emoji,omitempty"` - // Icon URL for the message. + // iconURL defines the icon URL for the message avatar. + // This displays a custom image as the message sender's avatar. // +optional IconURL *URL `json:"iconURL,omitempty"` - // The message text to send, it is optional because of attachments. + // text defines the message text to send. + // This is optional because attachments can be used instead of or alongside text. // +kubebuilder:validation:MinLength=1 // +optional Text *string `json:"text,omitempty"` - // The message title. + // title defines the message title displayed prominently in the message. + // This appears as bold text at the top of the message attachment. // +kubebuilder:validation:MinLength=1 // +optional Title *string `json:"title,omitempty"` - // The title link for the message. + // titleLink defines the URL that the title will link to when clicked. + // This makes the message title clickable in the RocketChat interface. // +kubebuilder:validation:MinLength=1 // +optional TitleLink *string `json:"titleLink,omitempty"` - // Additional fields for the message. + // fields defines additional fields for the message attachment. + // These appear as structured key-value pairs within the message. // +kubebuilder:validation:MinItems=1 // +optional Fields []RocketChatFieldConfig `json:"fields,omitempty"` - // Whether to use short fields. + // shortFields defines whether to use short fields in the message layout. + // When true, fields may be displayed side by side to save space. // +optional ShortFields *bool `json:"shortFields,omitempty"` - // Image URL for the message. + // imageURL defines the image URL to display within the message. + // This embeds an image directly in the message attachment. // +optional ImageURL *URL `json:"imageURL,omitempty"` - // Thumbnail URL for the message. + // thumbURL defines the thumbnail URL for the message. + // This displays a small thumbnail image alongside the message content. // +optional ThumbURL *URL `json:"thumbURL,omitempty"` - // Whether to enable link names. + // linkNames defines whether to enable automatic linking of usernames and channels. + // When true, @username and #channel references become clickable links. // +optional LinkNames *bool `json:"linkNames,omitempty"` - // Actions to include in the message. + // actions defines interactive actions to include in the message. + // These appear as buttons that users can click to trigger responses. // +kubebuilder:validation:MinItems=1 // +optional Actions []RocketChatActionConfig `json:"actions,omitempty"` - // HTTP client configuration. + // httpConfig defines the HTTP client configuration for RocketChat API requests. // +optional HTTPConfig *HTTPConfig `json:"httpConfig,omitempty"` } // RocketChatFieldConfig defines additional fields for RocketChat messages. type RocketChatFieldConfig struct { - // The title of this field. + // title defines the title of this field. + // This appears as bold text labeling the field content. // +kubebuilder:validation:MinLength=1 // +optional Title *string `json:"title,omitempty"` - // The value of this field, displayed underneath the title value. + // value defines the value of this field, displayed underneath the title. + // This contains the actual data or content for the field. // +kubebuilder:validation:MinLength=1 // +optional Value *string `json:"value,omitempty"` - // Whether this field should be a short field. + // short defines whether this field should be a short field. + // When true, the field may be displayed inline with other short fields to save space. // +optional Short *bool `json:"short,omitempty"` } // RocketChatActionConfig defines actions for RocketChat messages. type RocketChatActionConfig struct { - // The button text. + // text defines the button text displayed to users. + // This is the label that appears on the interactive button. // +kubebuilder:validation:MinLength=1 // +optional Text *string `json:"text,omitempty"` - // The URL the button links to. + // url defines the URL the button links to when clicked. + // This creates a clickable button that opens the specified URL. // +optional URL *URL `json:"url,omitempty"` - // The message to send when the button is clicked. + // msg defines the message to send when the button is clicked. + // This allows the button to post a predefined message to the channel. // +kubebuilder:validation:MinLength=1 // +optional Msg *string `json:"msg,omitempty"` @@ -1107,43 +1286,55 @@ type RocketChatActionConfig struct { // alerts are already firing. // See https://prometheus.io/docs/alerting/latest/configuration/#inhibit_rule type InhibitRule struct { - // Matchers that have to be fulfilled in the alerts to be muted. The - // operator enforces that the alert matches the resource's namespace. + // targetMatch defines matchers that have to be fulfilled in the alerts to be muted. + // The operator enforces that the alert matches the resource's namespace. + // When these conditions are met, matching alerts will be inhibited (silenced). + // +optional TargetMatch []Matcher `json:"targetMatch,omitempty"` - // Matchers for which one or more alerts have to exist for the inhibition - // to take effect. The operator enforces that the alert matches the - // resource's namespace. + // sourceMatch defines matchers for which one or more alerts have to exist for the inhibition + // to take effect. The operator enforces that the alert matches the resource's namespace. + // These are the "trigger" alerts that cause other alerts to be inhibited. + // +optional SourceMatch []Matcher `json:"sourceMatch,omitempty"` - // Labels that must have an equal value in the source and target alert for - // the inhibition to take effect. + // equal defines labels that must have an equal value in the source and target alert + // for the inhibition to take effect. This ensures related alerts are properly grouped. + // +optional Equal []string `json:"equal,omitempty"` } // KeyValue defines a (key, value) tuple. type KeyValue struct { - // Key of the tuple. + // key defines the key of the tuple. + // This is the identifier or name part of the key-value pair. // +kubebuilder:validation:MinLength=1 + // +required Key string `json:"key"` - // Value of the tuple. + // value defines the value of the tuple. + // This is the data or content associated with the key. + // +required Value string `json:"value"` } // Matcher defines how to match on alert's labels. type Matcher struct { - // Label to match. + // name defines the label to match. + // This specifies which alert label should be evaluated. // +kubebuilder:validation:MinLength=1 + // +required Name string `json:"name"` - // Label value to match. + // value defines the label value to match. + // This is the expected value for the specified label. // +optional Value string `json:"value"` - // Match operation available with AlertManager >= v0.22.0 and - // takes precedence over Regex (deprecated) if non-empty. + // matchType defines the match operation available with AlertManager >= v0.22.0. + // Takes precedence over Regex (deprecated) if non-empty. + // Valid values: "=" (equality), "!=" (inequality), "=~" (regex match), "!~" (regex non-match). // +kubebuilder:validation:Enum=!=;=;=~;!~ // +optional MatchType MatchType `json:"matchType,omitempty"` - // Whether to match on equality (false) or regular-expression (true). - // +optional + // regex defines whether to match on equality (false) or regular-expression (true). // Deprecated: for AlertManager >= v0.22.0, `matchType` should be used instead. + // +optional Regex bool `json:"regex,omitempty"` } @@ -1221,28 +1412,29 @@ func openMetricsEscape(s string) string { // MuteTimeInterval specifies the periods in time when notifications will be muted type MuteTimeInterval struct { - // Name of the time interval - // +kubebuilder:validation:Required + // name of the time interval + // +required Name string `json:"name,omitempty"` - // TimeIntervals is a list of TimeInterval + // timeIntervals defines a list of TimeInterval + // +optional TimeIntervals []TimeInterval `json:"timeIntervals,omitempty"` } // TimeInterval describes intervals of time type TimeInterval struct { - // Times is a list of TimeRange + // times defines a list of TimeRange // +optional Times []TimeRange `json:"times,omitempty"` - // Weekdays is a list of WeekdayRange + // weekdays defines a list of WeekdayRange // +optional Weekdays []WeekdayRange `json:"weekdays,omitempty"` - // DaysOfMonth is a list of DayOfMonthRange + // daysOfMonth defines a list of DayOfMonthRange // +optional DaysOfMonth []DayOfMonthRange `json:"daysOfMonth,omitempty"` - // Months is a list of MonthRange + // months defines a list of MonthRange // +optional Months []MonthRange `json:"months,omitempty"` - // Years is a list of YearRange + // years defines a list of YearRange // +optional Years []YearRange `json:"years,omitempty"` } @@ -1253,9 +1445,11 @@ type Time string // TimeRange defines a start and end time in 24hr format type TimeRange struct { - // StartTime is the start time in 24hr format. + // startTime defines the start time in 24hr format. + // +optional StartTime Time `json:"startTime,omitempty"` - // EndTime is the end time in 24hr format. + // endTime defines the end time in 24hr format. + // +optional EndTime Time `json:"endTime,omitempty"` } @@ -1266,13 +1460,15 @@ type WeekdayRange string // DayOfMonthRange is an inclusive range of days of the month beginning at 1 type DayOfMonthRange struct { - // Start of the inclusive range + // start of the inclusive range // +kubebuilder:validation:Minimum=-31 // +kubebuilder:validation:Maximum=31 + // +optional Start int `json:"start,omitempty"` - // End of the inclusive range + // end of the inclusive range // +kubebuilder:validation:Minimum=-31 // +kubebuilder:validation:Maximum=31 + // +optional End int `json:"end,omitempty"` } diff --git a/vendor/github.com/prometheus-operator/prometheus-operator/pkg/apis/monitoring/v1alpha1/prometheusagent_types.go b/vendor/github.com/prometheus-operator/prometheus-operator/pkg/apis/monitoring/v1alpha1/prometheusagent_types.go index daee3cfd53..5172a5ce8e 100644 --- a/vendor/github.com/prometheus-operator/prometheus-operator/pkg/apis/monitoring/v1alpha1/prometheusagent_types.go +++ b/vendor/github.com/prometheus-operator/prometheus-operator/pkg/apis/monitoring/v1alpha1/prometheusagent_types.go @@ -57,14 +57,19 @@ func (l *PrometheusAgent) GetStatus() monitoringv1.PrometheusStatus { // // The CRD is very similar to the `Prometheus` CRD except for features which aren't available in agent mode like rule evaluation, persistent storage and Thanos sidecar. type PrometheusAgent struct { - metav1.TypeMeta `json:",inline"` + // TypeMeta defines the versioned schema of this representation of an object. + metav1.TypeMeta `json:",inline"` + // metadata defines ObjectMeta as the metadata that all persisted resources. + // +optional metav1.ObjectMeta `json:"metadata,omitempty"` - // Specification of the desired behavior of the Prometheus agent. More info: + // spec defines the specification of the desired behavior of the Prometheus agent. More info: // https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#spec-and-status + // +required Spec PrometheusAgentSpec `json:"spec"` - // Most recent observed status of the Prometheus cluster. Read-only. + // status defines the most recent observed status of the Prometheus cluster. Read-only. // More info: // https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#spec-and-status + // +optional Status monitoringv1.PrometheusStatus `json:"status,omitempty"` } @@ -76,9 +81,9 @@ func (l *PrometheusAgent) DeepCopyObject() runtime.Object { // PrometheusAgentList is a list of Prometheus agents. // +k8s:openapi-gen=true type PrometheusAgentList struct { + // TypeMeta defines the versioned schema of this representation of an object. metav1.TypeMeta `json:",inline"` - // Standard list metadata - // More info: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#metadata + // metadata defines ListMeta as metadata for collection responses. metav1.ListMeta `json:"metadata,omitempty"` // List of Prometheus agents Items []PrometheusAgent `json:"items"` @@ -99,7 +104,7 @@ func (l *PrometheusAgentList) DeepCopyObject() runtime.Object { // +kubebuilder:validation:XValidation:rule="!(has(self.mode) && self.mode == 'DaemonSet' && has(self.scrapeConfigSelector))",message="scrapeConfigSelector cannot be set when mode is DaemonSet" // +kubebuilder:validation:XValidation:rule="!(has(self.mode) && self.mode == 'DaemonSet' && has(self.probeSelector))",message="probeSelector cannot be set when mode is DaemonSet" type PrometheusAgentSpec struct { - // Mode defines how the Prometheus operator deploys the PrometheusAgent pod(s). + // mode defines how the Prometheus operator deploys the PrometheusAgent pod(s). // // (Alpha) Using this field requires the `PrometheusAgentDaemonSet` feature gate to be enabled. // diff --git a/vendor/github.com/prometheus-operator/prometheus-operator/pkg/apis/monitoring/v1alpha1/scrapeconfig_types.go b/vendor/github.com/prometheus-operator/prometheus-operator/pkg/apis/monitoring/v1alpha1/scrapeconfig_types.go index 858b8ba86f..2ffa81e9df 100644 --- a/vendor/github.com/prometheus-operator/prometheus-operator/pkg/apis/monitoring/v1alpha1/scrapeconfig_types.go +++ b/vendor/github.com/prometheus-operator/prometheus-operator/pkg/apis/monitoring/v1alpha1/scrapeconfig_types.go @@ -38,10 +38,10 @@ type SDFile string // NamespaceDiscovery is the configuration for discovering // Kubernetes namespaces. type NamespaceDiscovery struct { - // Includes the namespace in which the Prometheus pod runs to the list of watched namespaces. + // ownNamespace includes the namespace in which the Prometheus pod runs to the list of watched namespaces. // +optional IncludeOwnNamespace *bool `json:"ownNamespace,omitempty"` - // List of namespaces where to watch for resources. + // names defines a list of namespaces where to watch for resources. // If empty and `ownNamespace` isn't true, Prometheus watches for resources in all namespaces. // +listType=set // +optional @@ -49,7 +49,7 @@ type NamespaceDiscovery struct { } type AttachMetadata struct { - // Attaches node metadata to discovered targets. + // node attaches node metadata to discovered targets. // When set to true, Prometheus must have the `get` permission on the // `Nodes` objects. // Only valid for Pod, Endpoint and Endpointslice roles. @@ -60,11 +60,11 @@ type AttachMetadata struct { // Filter name and value pairs to limit the discovery process to a subset of available resources. type Filter struct { - // Name of the Filter. + // name of the Filter. // +kubebuilder:vaidation:MinLength=1 // +required Name string `json:"name"` - // Value to filter on. + // values defines values to filter on. // // +kubebuilder:validation:MinItems=1 // +kubebuilder:validation:items:MinLength=1 @@ -91,16 +91,16 @@ const ( // K8SSelectorConfig is Kubernetes Selector Config type K8SSelectorConfig struct { - // Role specifies the type of Kubernetes resource to limit the service discovery to. + // role defines the type of Kubernetes resource to limit the service discovery to. // Accepted values are: Node, Pod, Endpoints, EndpointSlice, Service, Ingress. // +required Role KubernetesRole `json:"role"` - // An optional label selector to limit the service discovery to resources with specific labels and label values. + // label defines an optional label selector to limit the service discovery to resources with specific labels and label values. // e.g: `node.kubernetes.io/instance-type=master` // +kubebuilder:validation:MinLength=1 // +optional Label *string `json:"label,omitempty"` - // An optional field selector to limit the service discovery to resources which have fields with specific values. + // field defines an optional field selector to limit the service discovery to resources which have fields with specific values. // e.g: `metadata.name=foobar` // +kubebuilder:validation:MinLength=1 // +optional @@ -111,14 +111,27 @@ type K8SSelectorConfig struct { // +k8s:openapi-gen=true // +kubebuilder:resource:categories="prometheus-operator",shortName="scfg" // +kubebuilder:storageversion +// +kubebuilder:subresource:status // ScrapeConfig defines a namespaced Prometheus scrape_config to be aggregated across // multiple namespaces into the Prometheus configuration. type ScrapeConfig struct { - metav1.TypeMeta `json:",inline"` + // TypeMeta defines the versioned schema of this representation of an object. + metav1.TypeMeta `json:",inline"` + // metadata defines ObjectMeta as the metadata that all persisted resources. + // +optional metav1.ObjectMeta `json:"metadata,omitempty"` - + // spec defines the specification of ScrapeConfigSpec. + // +required Spec ScrapeConfigSpec `json:"spec"` + // status defines the status subresource. It is under active development and is updated only when the + // "StatusForConfigurationResources" feature gate is enabled. + // + // Most recent observed status of the ScrapeConfig. Read-only. + // More info: + // https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#spec-and-status + // +optional + Status v1.ConfigResourceStatus `json:"status,omitempty,omitzero"` } // DeepCopyObject implements the runtime.Object interface. @@ -126,14 +139,20 @@ func (l *ScrapeConfig) DeepCopyObject() runtime.Object { return l.DeepCopy() } +func (l *ScrapeConfig) Bindings() []v1.WorkloadBinding { + return l.Status.Bindings +} + // ScrapeConfigList is a list of ScrapeConfigs. // +k8s:openapi-gen=true type ScrapeConfigList struct { + // TypeMeta defines the versioned schema of this representation of an object. metav1.TypeMeta `json:",inline"` - // Standard list metadata - // More info: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#metadata + // metadata defines ListMeta as metadata for collection responses. + // +optional metav1.ListMeta `json:"metadata,omitempty"` // List of ScrapeConfigs + // +required Items []ScrapeConfig `json:"items"` } @@ -145,7 +164,7 @@ func (l *ScrapeConfigList) DeepCopyObject() runtime.Object { // ScrapeConfigSpec is a specification of the desired configuration for a scrape configuration. // +k8s:openapi-gen=true type ScrapeConfigSpec struct { - // The value of the `job` label assigned to the scraped metrics by default. + // jobName defines the value of the `job` label assigned to the scraped metrics by default. // // The `job_name` field in the rendered scrape configuration is always controlled by the // operator to prevent duplicate job names, which Prometheus does not allow. Instead the @@ -154,94 +173,94 @@ type ScrapeConfigSpec struct { // +kubebuilder:validation:MinLength=1 // +optional JobName *string `json:"jobName,omitempty"` - // StaticConfigs defines a list of static targets with a common label set. + // staticConfigs defines a list of static targets with a common label set. // +optional StaticConfigs []StaticConfig `json:"staticConfigs,omitempty"` - // FileSDConfigs defines a list of file service discovery configurations. + // fileSDConfigs defines a list of file service discovery configurations. // +optional FileSDConfigs []FileSDConfig `json:"fileSDConfigs,omitempty"` - // HTTPSDConfigs defines a list of HTTP service discovery configurations. + // httpSDConfigs defines a list of HTTP service discovery configurations. // +optional HTTPSDConfigs []HTTPSDConfig `json:"httpSDConfigs,omitempty"` - // KubernetesSDConfigs defines a list of Kubernetes service discovery configurations. + // kubernetesSDConfigs defines a list of Kubernetes service discovery configurations. // +optional KubernetesSDConfigs []KubernetesSDConfig `json:"kubernetesSDConfigs,omitempty"` - // ConsulSDConfigs defines a list of Consul service discovery configurations. + // consulSDConfigs defines a list of Consul service discovery configurations. // +optional ConsulSDConfigs []ConsulSDConfig `json:"consulSDConfigs,omitempty"` - //DNSSDConfigs defines a list of DNS service discovery configurations. + // dnsSDConfigs defines a list of DNS service discovery configurations. // +optional DNSSDConfigs []DNSSDConfig `json:"dnsSDConfigs,omitempty"` - // EC2SDConfigs defines a list of EC2 service discovery configurations. + // ec2SDConfigs defines a list of EC2 service discovery configurations. // +optional EC2SDConfigs []EC2SDConfig `json:"ec2SDConfigs,omitempty"` - // AzureSDConfigs defines a list of Azure service discovery configurations. + // azureSDConfigs defines a list of Azure service discovery configurations. // +optional AzureSDConfigs []AzureSDConfig `json:"azureSDConfigs,omitempty"` - // GCESDConfigs defines a list of GCE service discovery configurations. + // gceSDConfigs defines a list of GCE service discovery configurations. // +optional GCESDConfigs []GCESDConfig `json:"gceSDConfigs,omitempty"` - // OpenStackSDConfigs defines a list of OpenStack service discovery configurations. + // openstackSDConfigs defines a list of OpenStack service discovery configurations. // +optional OpenStackSDConfigs []OpenStackSDConfig `json:"openstackSDConfigs,omitempty"` - // DigitalOceanSDConfigs defines a list of DigitalOcean service discovery configurations. + // digitalOceanSDConfigs defines a list of DigitalOcean service discovery configurations. // +optional DigitalOceanSDConfigs []DigitalOceanSDConfig `json:"digitalOceanSDConfigs,omitempty"` - // KumaSDConfigs defines a list of Kuma service discovery configurations. + // kumaSDConfigs defines a list of Kuma service discovery configurations. // +optional KumaSDConfigs []KumaSDConfig `json:"kumaSDConfigs,omitempty"` - // EurekaSDConfigs defines a list of Eureka service discovery configurations. + // eurekaSDConfigs defines a list of Eureka service discovery configurations. // +optional EurekaSDConfigs []EurekaSDConfig `json:"eurekaSDConfigs,omitempty"` - // DockerSDConfigs defines a list of Docker service discovery configurations. + // dockerSDConfigs defines a list of Docker service discovery configurations. // +optional DockerSDConfigs []DockerSDConfig `json:"dockerSDConfigs,omitempty"` - // LinodeSDConfigs defines a list of Linode service discovery configurations. + // linodeSDConfigs defines a list of Linode service discovery configurations. // +optional LinodeSDConfigs []LinodeSDConfig `json:"linodeSDConfigs,omitempty"` - // HetznerSDConfigs defines a list of Hetzner service discovery configurations. + // hetznerSDConfigs defines a list of Hetzner service discovery configurations. // +optional HetznerSDConfigs []HetznerSDConfig `json:"hetznerSDConfigs,omitempty"` - // NomadSDConfigs defines a list of Nomad service discovery configurations. + // nomadSDConfigs defines a list of Nomad service discovery configurations. // +optional NomadSDConfigs []NomadSDConfig `json:"nomadSDConfigs,omitempty"` - // DockerswarmSDConfigs defines a list of Dockerswarm service discovery configurations. + // dockerSwarmSDConfigs defines a list of Dockerswarm service discovery configurations. // +optional DockerSwarmSDConfigs []DockerSwarmSDConfig `json:"dockerSwarmSDConfigs,omitempty"` - // PuppetDBSDConfigs defines a list of PuppetDB service discovery configurations. + // puppetDBSDConfigs defines a list of PuppetDB service discovery configurations. // +optional PuppetDBSDConfigs []PuppetDBSDConfig `json:"puppetDBSDConfigs,omitempty"` - // LightsailSDConfigs defines a list of Lightsail service discovery configurations. + // lightSailSDConfigs defines a list of Lightsail service discovery configurations. // +optional LightSailSDConfigs []LightSailSDConfig `json:"lightSailSDConfigs,omitempty"` - // OVHCloudSDConfigs defines a list of OVHcloud service discovery configurations. + // ovhcloudSDConfigs defines a list of OVHcloud service discovery configurations. // +optional OVHCloudSDConfigs []OVHCloudSDConfig `json:"ovhcloudSDConfigs,omitempty"` - // ScalewaySDConfigs defines a list of Scaleway instances and baremetal service discovery configurations. + // scalewaySDConfigs defines a list of Scaleway instances and baremetal service discovery configurations. // +optional ScalewaySDConfigs []ScalewaySDConfig `json:"scalewaySDConfigs,omitempty"` - // IonosSDConfigs defines a list of IONOS service discovery configurations. + // ionosSDConfigs defines a list of IONOS service discovery configurations. // +optional IonosSDConfigs []IonosSDConfig `json:"ionosSDConfigs,omitempty"` - // RelabelConfigs defines how to rewrite the target's labels before scraping. + // relabelings defines how to rewrite the target's labels before scraping. // Prometheus Operator automatically adds relabelings for a few standard Kubernetes fields. // The original scrape job's name is available via the `__tmp_prometheus_job_name` label. // More info: https://prometheus.io/docs/prometheus/latest/configuration/configuration/#relabel_config // +kubebuilder:validation:MinItems:=1 // +optional RelabelConfigs []v1.RelabelConfig `json:"relabelings,omitempty"` - // MetricsPath HTTP path to scrape for metrics. If empty, Prometheus uses the default value (e.g. /metrics). + // metricsPath defines the HTTP path to scrape for metrics. If empty, Prometheus uses the default value (e.g. /metrics). // +kubebuilder:validation:MinLength:=1 // +optional MetricsPath *string `json:"metricsPath,omitempty"` - // ScrapeInterval is the interval between consecutive scrapes. + // scrapeInterval defines the interval between consecutive scrapes. // +optional ScrapeInterval *v1.Duration `json:"scrapeInterval,omitempty"` - // ScrapeTimeout is the number of seconds to wait until a scrape request times out. + // scrapeTimeout defines the number of seconds to wait until a scrape request times out. // The value cannot be greater than the scrape interval otherwise the operator will reject the resource. // +optional ScrapeTimeout *v1.Duration `json:"scrapeTimeout,omitempty"` - // The protocols to negotiate during a scrape. It tells clients the + // scrapeProtocols defines the protocols to negotiate during a scrape. It tells clients the // protocols supported by Prometheus in order of preference (from most to least preferred). // // If unset, Prometheus uses its default value. @@ -252,102 +271,104 @@ type ScrapeConfigSpec struct { // +kubebuilder:validation:MinItems:=1 // +optional ScrapeProtocols []v1.ScrapeProtocol `json:"scrapeProtocols,omitempty"` - // The protocol to use if a scrape returns blank, unparseable, or otherwise invalid Content-Type. + // fallbackScrapeProtocol defines the protocol to use if a scrape returns blank, unparseable, or otherwise invalid Content-Type. // // It requires Prometheus >= v3.0.0. // +optional FallbackScrapeProtocol *v1.ScrapeProtocol `json:"fallbackScrapeProtocol,omitempty"` - // HonorTimestamps controls whether Prometheus respects the timestamps present in scraped data. + // honorTimestamps defines whether Prometheus preserves the timestamps + // when exposed by the target. // +optional HonorTimestamps *bool `json:"honorTimestamps,omitempty"` - // TrackTimestampsStaleness whether Prometheus tracks staleness of + // trackTimestampsStaleness defines whether Prometheus tracks staleness of // the metrics that have an explicit timestamp present in scraped data. // Has no effect if `honorTimestamps` is false. // It requires Prometheus >= v2.48.0. // // +optional TrackTimestampsStaleness *bool `json:"trackTimestampsStaleness,omitempty"` - // HonorLabels chooses the metric's labels on collisions with target labels. + // honorLabels defines when true the metric's labels when they collide + // with the target's labels. // +optional HonorLabels *bool `json:"honorLabels,omitempty"` - // Optional HTTP URL parameters + // params defines optional HTTP URL parameters // +mapType:=atomic // +optional Params map[string][]string `json:"params,omitempty"` - // Configures the protocol scheme used for requests. + // scheme defines the protocol scheme used for requests. // If empty, Prometheus uses HTTP by default. // +kubebuilder:validation:Enum=HTTP;HTTPS // +optional Scheme *string `json:"scheme,omitempty"` - // When false, Prometheus will request uncompressed response from the scraped target. + // enableCompression when false, Prometheus will request uncompressed response from the scraped target. // // It requires Prometheus >= v2.49.0. // // If unset, Prometheus uses true by default. // +optional EnableCompression *bool `json:"enableCompression,omitempty"` - // Whether to enable HTTP2. + // enableHTTP2 defines whether to enable HTTP2. // +optional EnableHTTP2 *bool `json:"enableHTTP2,omitempty"` - // BasicAuth information to use on every scrape request. + // basicAuth defines information to use on every scrape request. // +optional BasicAuth *v1.BasicAuth `json:"basicAuth,omitempty"` - // Authorization header to use on every scrape request. + // authorization defines the header to use on every scrape request. // +optional Authorization *v1.SafeAuthorization `json:"authorization,omitempty"` - // OAuth2 configuration to use on every scrape request. + // oauth2 defines the configuration to use on every scrape request. // +optional OAuth2 *v1.OAuth2 `json:"oauth2,omitempty"` - // TLS configuration to use on every scrape request + // tlsConfig defines the TLS configuration to use on every scrape request // +optional TLSConfig *v1.SafeTLSConfig `json:"tlsConfig,omitempty"` - // SampleLimit defines per-scrape limit on number of scraped samples that will be accepted. + // sampleLimit defines per-scrape limit on number of scraped samples that will be accepted. // +optional SampleLimit *uint64 `json:"sampleLimit,omitempty"` - // TargetLimit defines a limit on the number of scraped targets that will be accepted. + // targetLimit defines a limit on the number of scraped targets that will be accepted. // +optional TargetLimit *uint64 `json:"targetLimit,omitempty"` - // Per-scrape limit on number of labels that will be accepted for a sample. + // labelLimit defines the per-scrape limit on number of labels that will be accepted for a sample. // Only valid in Prometheus versions 2.27.0 and newer. // +optional LabelLimit *uint64 `json:"labelLimit,omitempty"` - // Per-scrape limit on length of labels name that will be accepted for a sample. + // labelNameLengthLimit defines the per-scrape limit on length of labels name that will be accepted for a sample. // Only valid in Prometheus versions 2.27.0 and newer. // +optional LabelNameLengthLimit *uint64 `json:"labelNameLengthLimit,omitempty"` - // Per-scrape limit on length of labels value that will be accepted for a sample. + // labelValueLengthLimit defines the per-scrape limit on length of labels value that will be accepted for a sample. // Only valid in Prometheus versions 2.27.0 and newer. // +optional LabelValueLengthLimit *uint64 `json:"labelValueLengthLimit,omitempty"` v1.NativeHistogramConfig `json:",inline"` - // Per-scrape limit on the number of targets dropped by relabeling + // keepDroppedTargets defines the per-scrape limit on the number of targets dropped by relabeling // that will be kept in memory. 0 means no limit. // // It requires Prometheus >= v2.47.0. // // +optional KeepDroppedTargets *uint64 `json:"keepDroppedTargets,omitempty"` - // MetricRelabelConfigs to apply to samples before ingestion. + // metricRelabelings defines the metricRelabelings to apply to samples before ingestion. // +kubebuilder:validation:MinItems:=1 // +optional MetricRelabelConfigs []v1.RelabelConfig `json:"metricRelabelings,omitempty"` // ProxyConfig allows customizing the proxy behaviour for this scrape config. // +optional v1.ProxyConfig `json:",inline"` - // Specifies the validation scheme for metric and label names. + // nameValidationScheme defines the validation scheme for metric and label names. // // It requires Prometheus >= v3.0.0. // // +optional NameValidationScheme *v1.NameValidationSchemeOptions `json:"nameValidationScheme,omitempty"` - // Metric name escaping mode to request through content negotiation. + // nameEscapingScheme defines the metric name escaping mode to request through content negotiation. // // It requires Prometheus >= v3.4.0. // // +optional NameEscapingScheme *v1.NameEscapingSchemeOptions `json:"nameEscapingScheme,omitempty"` - // The scrape class to apply. + // scrapeClass defines the scrape class to apply. // +kubebuilder:validation:MinLength=1 // +optional ScrapeClassName *string `json:"scrapeClass,omitempty"` @@ -357,12 +378,12 @@ type ScrapeConfigSpec struct { // See https://prometheus.io/docs/prometheus/latest/configuration/configuration/#scrape_config // +k8s:openapi-gen=true type StaticConfig struct { - // List of targets for this static configuration. + // targets defines the list of targets for this static configuration. // +kubebuilder:validation:MinItems:=1 // +listType=set // +required Targets []Target `json:"targets"` - // Labels assigned to all metrics scraped from the targets. + // labels defines labels assigned to all metrics scraped from the targets. // +mapType:=atomic // +optional Labels map[string]string `json:"labels,omitempty"` @@ -372,7 +393,7 @@ type StaticConfig struct { // See https://prometheus.io/docs/prometheus/latest/configuration/configuration/#file_sd_config // +k8s:openapi-gen=true type FileSDConfig struct { - // List of files to be used for file discovery. Recommendation: use absolute paths. While relative paths work, the + // files defines the list of files to be used for file discovery. Recommendation: use absolute paths. While relative paths work, the // prometheus-operator project makes no guarantees about the working directory where the configuration file is // stored. // Files must be mounted using Prometheus.ConfigMaps or Prometheus.Secrets. @@ -380,7 +401,8 @@ type FileSDConfig struct { // +listType=set // +required Files []SDFile `json:"files"` - // RefreshInterval configures the refresh interval at which Prometheus will reload the content of the files. + // refreshInterval defines the time after which the provided names are refreshed. + // If not set, Prometheus uses its default value. // +optional RefreshInterval *v1.Duration `json:"refreshInterval,omitempty"` } @@ -389,36 +411,36 @@ type FileSDConfig struct { // See https://prometheus.io/docs/prometheus/latest/configuration/configuration/#http_sd_config // +k8s:openapi-gen=true type HTTPSDConfig struct { - // URL from which the targets are fetched. + // url defines the URL from which the targets are fetched. // +kubebuilder:validation:MinLength:=1 // +kubebuilder:validation:Pattern:="^http(s)?://.+$" // +required URL string `json:"url"` - // RefreshInterval configures the refresh interval at which Prometheus will re-query the - // endpoint to update the target list. + // refreshInterval defines the time after which the provided names are refreshed. + // If not set, Prometheus uses its default value. // +optional RefreshInterval *v1.Duration `json:"refreshInterval,omitempty"` - // BasicAuth information to authenticate against the target HTTP endpoint. + // basicAuth defines information to use on every scrape request. // More info: https://prometheus.io/docs/operating/configuration/#endpoints // Cannot be set at the same time as `authorization`, or `oAuth2`. // +optional BasicAuth *v1.BasicAuth `json:"basicAuth,omitempty"` - // Authorization header configuration to authenticate against the target HTTP endpoint. + // authorization defines the authorization header configuration to authenticate against the target HTTP endpoint. // Cannot be set at the same time as `oAuth2`, or `basicAuth`. // +optional Authorization *v1.SafeAuthorization `json:"authorization,omitempty"` - // Optional OAuth 2.0 configuration to authenticate against the target HTTP endpoint. + // oauth2 defines the optional OAuth 2.0 configuration to authenticate against the target HTTP endpoint. // Cannot be set at the same time as `authorization`, or `basicAuth`. // +optional OAuth2 *v1.OAuth2 `json:"oauth2,omitempty"` v1.ProxyConfig `json:",inline"` - // TLS configuration applying to the target HTTP endpoint. + // tlsConfig defines the TLS configuration applying to the target HTTP endpoint. // +optional TLSConfig *v1.SafeTLSConfig `json:"tlsConfig,omitempty"` - // Configure whether HTTP requests follow HTTP 3xx redirects. + // followRedirects defines whether HTTP requests follow HTTP 3xx redirects. // +optional FollowRedirects *bool `json:"followRedirects,omitempty"` - // Whether to enable HTTP2. + // enableHTTP2 defines whether to enable HTTP2. // +optional EnableHTTP2 *bool `json:"enableHTTP2,omitempty"` } @@ -427,7 +449,7 @@ type HTTPSDConfig struct { // See https://prometheus.io/docs/prometheus/latest/configuration/configuration/#kubernetes_sd_config // +k8s:openapi-gen=true type KubernetesSDConfig struct { - // The API server address consisting of a hostname or IP address followed + // apiServer defines the API server address consisting of a hostname or IP address followed // by an optional port number. // If left empty, Prometheus is assumed to run inside // of the cluster. It will discover API servers automatically and use the pod's @@ -435,44 +457,44 @@ type KubernetesSDConfig struct { // +kubebuilder:validation:MinLength=1 // +optional APIServer *string `json:"apiServer,omitempty"` - // Role of the Kubernetes entities that should be discovered. + // role defines the Kubernetes role of the entities that should be discovered. // Role `Endpointslice` requires Prometheus >= v2.21.0 // +required Role KubernetesRole `json:"role"` - // Optional namespace discovery. If omitted, Prometheus discovers targets across all namespaces. + // namespaces defines the namespace discovery. If omitted, Prometheus discovers targets across all namespaces. // +optional Namespaces *NamespaceDiscovery `json:"namespaces,omitempty"` - // Optional metadata to attach to discovered targets. + // attachMetadata defines the metadata to attach to discovered targets. // It requires Prometheus >= v2.35.0 when using the `Pod` role and // Prometheus >= v2.37.0 for `Endpoints` and `Endpointslice` roles. // +optional AttachMetadata *AttachMetadata `json:"attachMetadata,omitempty"` - // Selector to select objects. + // selectors defines the selector to select objects. // It requires Prometheus >= v2.17.0 // +optional // +listType=map // +listMapKey=role Selectors []K8SSelectorConfig `json:"selectors,omitempty"` - // BasicAuth information to use on every scrape request. + // basicAuth defines information to use on every scrape request. // Cannot be set at the same time as `authorization`, or `oauth2`. // +optional BasicAuth *v1.BasicAuth `json:"basicAuth,omitempty"` - // Authorization header to use on every scrape request. + // authorization defines the authorization header to use on every scrape request. // Cannot be set at the same time as `basicAuth`, or `oauth2`. // +optional Authorization *v1.SafeAuthorization `json:"authorization,omitempty"` - // Optional OAuth 2.0 configuration. + // oauth2 defines the optional OAuth 2.0 configuration to authenticate against the target HTTP endpoint. // Cannot be set at the same time as `authorization`, or `basicAuth`. // +optional OAuth2 *v1.OAuth2 `json:"oauth2,omitempty"` v1.ProxyConfig `json:",inline"` - // Configure whether HTTP requests follow HTTP 3xx redirects. + // followRedirects defines whether HTTP requests follow HTTP 3xx redirects. // +optional FollowRedirects *bool `json:"followRedirects,omitempty"` - // Whether to enable HTTP2. + // enableHTTP2 defines whether to enable HTTP2. // +optional EnableHTTP2 *bool `json:"enableHTTP2,omitempty"` - // TLS configuration to connect to the Kubernetes API. + // tlsConfig defines the TLS configuration to connect to the Kubernetes API. // +optional TLSConfig *v1.SafeTLSConfig `json:"tlsConfig,omitempty"` } @@ -481,94 +503,91 @@ type KubernetesSDConfig struct { // See https://prometheus.io/docs/prometheus/latest/configuration/configuration/#consul_sd_config // +k8s:openapi-gen=true type ConsulSDConfig struct { - // Consul server address. A valid string consisting of a hostname or IP followed by an optional port number. + // server defines the consul server address. A valid string consisting of a hostname or IP followed by an optional port number. // +kubebuilder:validation:MinLength=1 // +required Server string `json:"server"` - // Prefix for URIs for when consul is behind an API gateway (reverse proxy). + // pathPrefix defines the prefix for URIs for when consul is behind an API gateway (reverse proxy). // // It requires Prometheus >= 2.45.0. // +kubebuilder:validation:MinLength=1 // +optional PathPrefix *string `json:"pathPrefix,omitempty"` - // Consul ACL TokenRef, if not provided it will use the ACL from the local Consul Agent. + // tokenRef defines the consul ACL TokenRef, if not provided it will use the ACL from the local Consul Agent. // +optional TokenRef *corev1.SecretKeySelector `json:"tokenRef,omitempty"` - // Consul Datacenter name, if not provided it will use the local Consul Agent Datacenter. + // datacenter defines the consul Datacenter name, if not provided it will use the local Consul Agent Datacenter. // +kubebuilder:validation:MinLength=1 // +optional Datacenter *string `json:"datacenter,omitempty"` - // Namespaces are only supported in Consul Enterprise. + // namespace are only supported in Consul Enterprise. // // It requires Prometheus >= 2.28.0. // +kubebuilder:validation:MinLength=1 // +optional Namespace *string `json:"namespace,omitempty"` - // Admin Partitions are only supported in Consul Enterprise. + // partition defines the admin Partitions are only supported in Consul Enterprise. // +kubebuilder:validation:MinLength=1 // +optional Partition *string `json:"partition,omitempty"` - // HTTP Scheme default "http" + // scheme defines the HTTP Scheme default "http" // +kubebuilder:validation:Enum=HTTP;HTTPS // +optional Scheme *string `json:"scheme,omitempty"` - // A list of services for which targets are retrieved. If omitted, all services are scraped. + // services defines a list of services for which targets are retrieved. If omitted, all services are scraped. // +listType:=set // +optional Services []string `json:"services,omitempty"` - // An optional list of tags used to filter nodes for a given service. Services must contain all tags in the list. + // tags defines an optional list of tags used to filter nodes for a given service. Services must contain all tags in the list. // Starting with Consul 1.14, it is recommended to use `filter` with the `ServiceTags` selector instead. // +listType:=set // +optional Tags []string `json:"tags,omitempty"` - // The string by which Consul tags are joined into the tag label. + // tagSeparator defines the string by which Consul tags are joined into the tag label. // If unset, Prometheus uses its default value. // +kubebuilder:validation:MinLength=1 // +optional TagSeparator *string `json:"tagSeparator,omitempty"` - // Node metadata key/value pairs to filter nodes for a given service. + // nodeMeta defines the node metadata key/value pairs to filter nodes for a given service. // Starting with Consul 1.14, it is recommended to use `filter` with the `NodeMeta` selector instead. // +mapType:=atomic // +optional NodeMeta map[string]string `json:"nodeMeta,omitempty"` - // Filter expression used to filter the catalog results. + // filter defines the filter expression used to filter the catalog results. // See https://www.consul.io/api-docs/catalog#list-services // It requires Prometheus >= 3.0.0. // +kubebuilder:validation:MinLength=1 // +optional Filter *string `json:"filter,omitempty"` - // Allow stale Consul results (see https://www.consul.io/api/features/consistency.html). Will reduce load on Consul. + // allowStale Consul results (see https://www.consul.io/api/features/consistency.html). Will reduce load on Consul. // If unset, Prometheus uses its default value. // +optional AllowStale *bool `json:"allowStale,omitempty"` - // The time after which the provided names are refreshed. - // On large setup it might be a good idea to increase this value because the catalog will change all the time. - // If unset, Prometheus uses its default value. + // refreshInterval defines the time after which the provided names are refreshed. + // If not set, Prometheus uses its default value. // +optional RefreshInterval *v1.Duration `json:"refreshInterval,omitempty"` - // Optional BasicAuth information to authenticate against the Consul Server. + // basicAuth defines the information to authenticate against the Consul Server. // More info: https://prometheus.io/docs/operating/configuration/#endpoints // Cannot be set at the same time as `authorization`, or `oauth2`. // +optional BasicAuth *v1.BasicAuth `json:"basicAuth,omitempty"` - // Optional Authorization header configuration to authenticate against the Consul Server. + // authorization defines the header configuration to authenticate against the Consul Server. // Cannot be set at the same time as `basicAuth`, or `oauth2`. // +optional Authorization *v1.SafeAuthorization `json:"authorization,omitempty"` - // Optional OAuth2.0 configuration. - // Cannot be set at the same time as `basicAuth`, or `authorization`. + // oauth2 defines the optional OAuth 2.0 configuration to authenticate against the target HTTP endpoint. + // Cannot be set at the same time as `authorization`, or `basicAuth`. // +optional OAuth2 *v1.OAuth2 `json:"oauth2,omitempty"` v1.ProxyConfig `json:",inline"` - // Configure whether HTTP requests follow HTTP 3xx redirects. - // If unset, Prometheus uses its default value. + // followRedirects defines whether HTTP requests follow HTTP 3xx redirects. // +optional FollowRedirects *bool `json:"followRedirects,omitempty"` - // Whether to enable HTTP2. - // If unset, Prometheus uses its default value. + // enableHTTP2 defines whether to enable HTTP2. // +optional EnableHttp2 *bool `json:"enableHTTP2,omitempty"` - // TLS configuration to connect to the Consul API. + // tlsConfig defines the TLS configuration to connect to the Consul API. // +optional TLSConfig *v1.SafeTLSConfig `json:"tlsConfig,omitempty"` } @@ -589,16 +608,16 @@ const ( // See https://prometheus.io/docs/prometheus/latest/configuration/configuration/#dns_sd_config // +k8s:openapi-gen=true type DNSSDConfig struct { - // A list of DNS domain names to be queried. + // names defines a list of DNS domain names to be queried. // +kubebuilder:validation:MinItems:=1 // +kubebuilder:validation:items:MinLength=1 // +required Names []string `json:"names"` - // RefreshInterval configures the time after which the provided names are refreshed. + // refreshInterval defines the time after which the provided names are refreshed. // If not set, Prometheus uses its default value. // +optional RefreshInterval *v1.Duration `json:"refreshInterval,omitempty"` - // The type of DNS query to perform. One of SRV, A, AAAA, MX or NS. + // type defines the type of DNS query to perform. One of SRV, A, AAAA, MX or NS. // If not set, Prometheus uses its default value. // // When set to NS, it requires Prometheus >= v2.49.0. @@ -606,7 +625,7 @@ type DNSSDConfig struct { // // +optional Type *DNSRecordType `json:"type,omitempty"` - // The port number used if the query type is not SRV + // port defines the port to scrape metrics from. If using the public IP address, this must // Ignored for SRV records // +kubebuilder:validation:Minimum=0 // +kubebuilder:validation:Maximum=65535 @@ -624,30 +643,31 @@ type DNSSDConfig struct { // // +k8s:openapi-gen=true type EC2SDConfig struct { - // The AWS region. + // region defines the AWS region. // +kubebuilder:validation:MinLength=1 // +optional Region *string `json:"region,omitempty"` - // AccessKey is the AWS API key. + // accessKey defines the AWS API key. // +optional AccessKey *corev1.SecretKeySelector `json:"accessKey,omitempty"` - // SecretKey is the AWS API secret. + // secretKey defines the AWS API secret. // +optional SecretKey *corev1.SecretKeySelector `json:"secretKey,omitempty"` - // AWS Role ARN, an alternative to using AWS API keys. + // roleARN defines an alternative to using AWS API keys. // +kubebuilder:validation:MinLength=1 // +optional RoleARN *string `json:"roleARN,omitempty"` - // The port to scrape metrics from. If using the public IP address, this must + // port defines the port to scrape metrics from. If using the public IP address, this must // instead be specified in the relabeling rule. // +kubebuilder:validation:Minimum=0 // +kubebuilder:validation:Maximum=65535 // +optional Port *int32 `json:"port,omitempty"` - // RefreshInterval configures the refresh interval at which Prometheus will re-read the instance list. + // refreshInterval defines the time after which the provided names are refreshed. + // If not set, Prometheus uses its default value. // +optional RefreshInterval *v1.Duration `json:"refreshInterval,omitempty"` - // Filters can be used optionally to filter the instance list by other criteria. + // filters can be used optionally to filter the instance list by other criteria. // Available filter criteria can be found here: // https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_DescribeInstances.html // Filter API documentation: https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_Filter.html @@ -655,15 +675,15 @@ type EC2SDConfig struct { // +optional Filters Filters `json:"filters,omitempty"` v1.ProxyConfig `json:",inline"` - // TLS configuration to connect to the AWS EC2 API. + // tlsConfig defines the TLS configuration to connect to the Consul API. // It requires Prometheus >= v2.41.0 // +optional TLSConfig *v1.SafeTLSConfig `json:"tlsConfig,omitempty"` - // Configure whether HTTP requests follow HTTP 3xx redirects. + // followRedirects defines whether HTTP requests follow HTTP 3xx redirects. // It requires Prometheus >= v2.41.0 // +optional FollowRedirects *bool `json:"followRedirects,omitempty"` - // Whether to enable HTTP2. + // enableHTTP2 defines whether to enable HTTP2. // It requires Prometheus >= v2.41.0 // +optional EnableHTTP2 *bool `json:"enableHTTP2,omitempty"` @@ -682,68 +702,68 @@ const ( // See https://prometheus.io/docs/prometheus/latest/configuration/configuration/#azure_sd_config // +k8s:openapi-gen=true type AzureSDConfig struct { - // The Azure environment. + // environment defines the Azure environment. // +kubebuilder:validation:MinLength=1 // +optional Environment *string `json:"environment,omitempty"` - // # The authentication method, either `OAuth` or `ManagedIdentity` or `SDK`. + // authenticationMethod defines the authentication method, either `OAuth` or `ManagedIdentity` or `SDK`. // See https://docs.microsoft.com/en-us/azure/active-directory/managed-identities-azure-resources/overview // SDK authentication method uses environment variables by default. // See https://learn.microsoft.com/en-us/azure/developer/go/azure-sdk-authentication // +optional AuthenticationMethod *AuthenticationMethodType `json:"authenticationMethod,omitempty"` - // The subscription ID. Always required. + // subscriptionID defines subscription ID. Always required. // +kubebuilder:validation:MinLength=1 // +required SubscriptionID string `json:"subscriptionID"` - // Optional tenant ID. Only required with the OAuth authentication method. + // tenantID defines tenant ID. Only required with the OAuth authentication method. // +kubebuilder:validation:MinLength=1 // +optional TenantID *string `json:"tenantID,omitempty"` - // Optional client ID. Only required with the OAuth authentication method. + // clientID defines client ID. Only required with the OAuth authentication method. // +kubebuilder:validation:MinLength=1 // +optional ClientID *string `json:"clientID,omitempty"` - // Optional client secret. Only required with the OAuth authentication method. + // clientSecret defines client secret. Only required with the OAuth authentication method. // +optional ClientSecret *corev1.SecretKeySelector `json:"clientSecret,omitempty"` - // Optional resource group name. Limits discovery to this resource group. + // resourceGroup defines resource group name. Limits discovery to this resource group. // Requires Prometheus v2.35.0 and above // +kubebuilder:validation:MinLength=1 // +optional ResourceGroup *string `json:"resourceGroup,omitempty"` - // RefreshInterval configures the refresh interval at which Prometheus will re-read the instance list. + // refreshInterval defines the time after which the provided names are refreshed. + // If not set, Prometheus uses its default value. // +optional RefreshInterval *v1.Duration `json:"refreshInterval,omitempty"` - // The port to scrape metrics from. If using the public IP address, this must + // port defines the port to scrape metrics from. If using the public IP address, this must // instead be specified in the relabeling rule. // +kubebuilder:validation:Minimum=0 // +kubebuilder:validation:Maximum=65535 // +optional Port *int32 `json:"port,omitempty"` - // BasicAuth information to authenticate against the target HTTP endpoint. + // basicAuth defines the information to authenticate against the target HTTP endpoint. // More info: https://prometheus.io/docs/operating/configuration/#endpoints // Cannot be set at the same time as `authorization`, or `oAuth2`. // +optional BasicAuth *v1.BasicAuth `json:"basicAuth,omitempty"` - // Authorization header configuration to authenticate against the target HTTP endpoint. + // authorization defines the authorization header configuration to authenticate against the target HTTP endpoint. // Cannot be set at the same time as `oAuth2`, or `basicAuth`. // +optional Authorization *v1.SafeAuthorization `json:"authorization,omitempty"` - // Optional OAuth 2.0 configuration to authenticate against the target HTTP endpoint. - // Cannot be set at the same time as `authorization`, or `basicAuth`. + // oauth2 defines the configuration to use on every scrape request. // +optional OAuth2 *v1.OAuth2 `json:"oauth2,omitempty"` // ProxyConfig allows customizing the proxy behaviour for this scrape config. // +optional v1.ProxyConfig `json:",inline"` - // Configure whether HTTP requests follow HTTP 3xx redirects. + // followRedirects defines whether HTTP requests follow HTTP 3xx redirects. // +optional FollowRedirects *bool `json:"followRedirects,omitempty"` - // Whether to enable HTTP2. + // enableHTTP2 defines whether to enable HTTP2. // +optional EnableHTTP2 *bool `json:"enableHTTP2,omitempty"` - // TLS configuration applying to the target HTTP endpoint. + // tlsConfig defies the TLS configuration applying to the target HTTP endpoint. // +optional TLSConfig *v1.SafeTLSConfig `json:"tlsConfig,omitempty"` } @@ -763,30 +783,31 @@ type AzureSDConfig struct { // environment variable is set to /etc/prometheus/secrets//. // +k8s:openapi-gen=true type GCESDConfig struct { - // The Google Cloud Project ID + // project defines the Google Cloud Project ID // +kubebuilder:validation:MinLength:=1 // +required Project string `json:"project"` - // The zone of the scrape targets. If you need multiple zones use multiple GCESDConfigs. + // zone defines the zone of the scrape targets. If you need multiple zones use multiple GCESDConfigs. // +kubebuilder:validation:MinLength:=1 // +required Zone string `json:"zone"` - // Filter can be used optionally to filter the instance list by other criteria + // filter defines the filter that can be used optionally to filter the instance list by other criteria // Syntax of this filter is described in the filter query parameter section: // https://cloud.google.com/compute/docs/reference/latest/instances/list // +kubebuilder:validation:MinLength:=1 // +optional Filter *string `json:"filter,omitempty"` - // RefreshInterval configures the refresh interval at which Prometheus will re-read the instance list. + // refreshInterval defines the time after which the provided names are refreshed. + // If not set, Prometheus uses its default value. // +optional RefreshInterval *v1.Duration `json:"refreshInterval,omitempty"` - // The port to scrape metrics from. If using the public IP address, this must + // port defines the port to scrape metrics from. If using the public IP address, this must // instead be specified in the relabeling rule. // +kubebuilder:validation:Minimum=0 // +kubebuilder:validation:Maximum=65535 // +optional Port *int32 `json:"port,omitempty"` - // The tag separator is used to separate the tags on concatenation + // tagSeparator defines the tag separator is used to separate the tags on concatenation // +kubebuilder:validation:MinLength:=1 // +optional TagSeparator *string `json:"tagSeparator,omitempty"` @@ -805,88 +826,89 @@ const ( // See https://prometheus.io/docs/prometheus/latest/configuration/configuration/#openstack_sd_config // +k8s:openapi-gen=true type OpenStackSDConfig struct { - // The OpenStack role of entities that should be discovered. + // role defines the OpenStack role of entities that should be discovered. // // Note: The `LoadBalancer` role requires Prometheus >= v3.2.0. // // +required Role OpenStackRole `json:"role"` - // The OpenStack Region. + // region defines the OpenStack Region. // +kubebuilder:validation:MinLength:=1 // +required Region string `json:"region"` - // IdentityEndpoint specifies the HTTP endpoint that is required to work with + // identityEndpoint defines the HTTP endpoint that is required to work with // the Identity API of the appropriate version. // +kubebuilder:validation:Pattern:=`^http(s)?:\/\/.+$` // +optional IdentityEndpoint *string `json:"identityEndpoint,omitempty"` - // Username is required if using Identity V2 API. Consult with your provider's + // username defines the username required if using Identity V2 API. Consult with your provider's // control panel to discover your account's username. // In Identity V3, either userid or a combination of username // and domainId or domainName are needed // +kubebuilder:validation:MinLength:=1 // +optional Username *string `json:"username,omitempty"` - // UserID + // userid defines the OpenStack userid. // +kubebuilder:validation:MinLength:=1 // +optional UserID *string `json:"userid,omitempty"` - // Password for the Identity V2 and V3 APIs. Consult with your provider's + // password defines the password for the Identity V2 and V3 APIs. Consult with your provider's // control panel to discover your account's preferred method of authentication. // +optional Password *corev1.SecretKeySelector `json:"password,omitempty"` - // At most one of domainId and domainName must be provided if using username + // domainName defines at most one of domainId and domainName that must be provided if using username // with Identity V3. Otherwise, either are optional. // +kubebuilder:validation:MinLength:=1 // +optional DomainName *string `json:"domainName,omitempty"` - // DomainID + // domainID defines The OpenStack domainID. // +kubebuilder:validation:MinLength:=1 // +optional DomainID *string `json:"domainID,omitempty"` - // The ProjectId and ProjectName fields are optional for the Identity V2 API. + // projectName defines an optional field for the Identity V2 API. // Some providers allow you to specify a ProjectName instead of the ProjectId. // Some require both. Your provider's authentication policies will determine // how these fields influence authentication. // +kubebuilder:validation:MinLength:=1 // +optional ProjectName *string `json:"projectName,omitempty"` - // ProjectID + // projectID defines the OpenStack projectID. // +kubebuilder:validation:MinLength:=1 // +optional ProjectID *string `json:"projectID,omitempty"` - // The ApplicationCredentialID or ApplicationCredentialName fields are + // applicationCredentialName defines the ApplicationCredentialID or ApplicationCredentialName fields are // required if using an application credential to authenticate. Some providers // allow you to create an application credential to authenticate rather than a // password. // +kubebuilder:validation:MinLength:=1 // +optional ApplicationCredentialName *string `json:"applicationCredentialName,omitempty"` - // ApplicationCredentialID + // applicationCredentialId defines the OpenStack applicationCredentialId. // +optional ApplicationCredentialID *string `json:"applicationCredentialId,omitempty"` - // The applicationCredentialSecret field is required if using an application + // applicationCredentialSecret defines the required field if using an application // credential to authenticate. // +optional ApplicationCredentialSecret *corev1.SecretKeySelector `json:"applicationCredentialSecret,omitempty"` - // Whether the service discovery should list all instances for all projects. + // allTenants defines whether the service discovery should list all instances for all projects. // It is only relevant for the 'instance' role and usually requires admin permissions. // +optional AllTenants *bool `json:"allTenants,omitempty"` - // Refresh interval to re-read the instance list. + // refreshInterval defines the time after which the provided names are refreshed. + // If not set, Prometheus uses its default value. // +optional RefreshInterval *v1.Duration `json:"refreshInterval,omitempty"` - // The port to scrape metrics from. If using the public IP address, this must + // port defines the port to scrape metrics from. If using the public IP address, this must // instead be specified in the relabeling rule. // +kubebuilder:validation:Minimum=0 // +kubebuilder:validation:Maximum=65535 // +optional Port *int32 `json:"port,omitempty"` - // Availability of the endpoint to connect to. + // availability defines the availability of the endpoint to connect to. // +kubebuilder:validation:Enum=Public;public;Admin;admin;Internal;internal // +optional Availability *string `json:"availability,omitempty"` - // TLS configuration applying to the target HTTP endpoint. + // tlsConfig defines the TLS configuration applying to the target HTTP endpoint. // +optional TLSConfig *v1.SafeTLSConfig `json:"tlsConfig,omitempty"` } @@ -896,32 +918,32 @@ type OpenStackSDConfig struct { // See https://prometheus.io/docs/prometheus/latest/configuration/configuration/#digitalocean_sd_config // +k8s:openapi-gen=true type DigitalOceanSDConfig struct { - // Authorization header configuration to authenticate against the DigitalOcean API. + // authorization defines the header configuration to authenticate against the DigitalOcean API. // Cannot be set at the same time as `oauth2`. // +optional Authorization *v1.SafeAuthorization `json:"authorization,omitempty"` - // Optional OAuth 2.0 configuration. - // Cannot be set at the same time as `authorization`. + // oauth2 defines the configuration to use on every scrape request. // +optional OAuth2 *v1.OAuth2 `json:"oauth2,omitempty"` // ProxyConfig allows customizing the proxy behaviour for this scrape config. // +optional v1.ProxyConfig `json:",inline"` - // Configure whether HTTP requests follow HTTP 3xx redirects. + // followRedirects defines whether HTTP requests follow HTTP 3xx redirects. // +optional FollowRedirects *bool `json:"followRedirects,omitempty"` - // Whether to enable HTTP2. + // enableHTTP2 defines whether to enable HTTP2. // +optional EnableHTTP2 *bool `json:"enableHTTP2,omitempty"` - // TLS configuration applying to the target HTTP endpoint. + // tlsConfig defines the TLS configuration to connect to the Consul API. // +optional TLSConfig *v1.SafeTLSConfig `json:"tlsConfig,omitempty"` - // The port to scrape metrics from. + // port defines the port to scrape metrics from. If using the public IP address, this must // +kubebuilder:validation:Minimum=0 // +kubebuilder:validation:Maximum=65535 // +optional Port *int32 `json:"port,omitempty"` - // Refresh interval to re-read the instance list. + // refreshInterval defines the time after which the provided names are refreshed. + // If not set, Prometheus uses its default value. // +optional RefreshInterval *v1.Duration `json:"refreshInterval,omitempty"` } @@ -930,39 +952,41 @@ type DigitalOceanSDConfig struct { // See https://prometheus.io/docs/prometheus/latest/configuration/configuration/#kuma_sd_config // +k8s:openapi-gen=true type KumaSDConfig struct { - // Address of the Kuma Control Plane's MADS xDS server. - // +kubebuilder:validation:MinLength=1 + // server defines the address of the Kuma Control Plane's MADS xDS server. // +required - Server string `json:"server"` - // Client id is used by Kuma Control Plane to compute Monitoring Assignment for specific Prometheus backend. + Server URL `json:"server"` + // clientID is used by Kuma Control Plane to compute Monitoring Assignment for specific Prometheus backend. + // It requires Prometheus >= v2.50.0. + // +kubebuilder:validation:MinLength=1 // +optional ClientID *string `json:"clientID,omitempty"` - // The time to wait between polling update requests. + // refreshInterval defines the time after which the provided names are refreshed. + // If not set, Prometheus uses its default value. // +optional RefreshInterval *v1.Duration `json:"refreshInterval,omitempty"` - // The time after which the monitoring assignments are refreshed. + // fetchTimeout defines the time after which the monitoring assignments are refreshed. // +optional FetchTimeout *v1.Duration `json:"fetchTimeout,omitempty"` // ProxyConfig allows customizing the proxy behaviour for this scrape config. // +optional v1.ProxyConfig `json:",inline"` - // TLS configuration to use on every scrape request + // tlsConfig defines the TLS configuration to connect to the Consul API. // +optional TLSConfig *v1.SafeTLSConfig `json:"tlsConfig,omitempty"` - // BasicAuth information to use on every scrape request. + // basicAuth defines information to use on every scrape request. // +optional BasicAuth *v1.BasicAuth `json:"basicAuth,omitempty"` - // Authorization header to use on every scrape request. + // authorization defines the header configuration to authenticate against the DigitalOcean API. + // Cannot be set at the same time as `oauth2`. // +optional Authorization *v1.SafeAuthorization `json:"authorization,omitempty"` - // Optional OAuth 2.0 configuration. - // Cannot be set at the same time as `authorization`, or `basicAuth`. + // oauth2 defines the configuration to use on every scrape request. // +optional OAuth2 *v1.OAuth2 `json:"oauth2,omitempty"` - // Configure whether HTTP requests follow HTTP 3xx redirects. + // followRedirects defines whether HTTP requests follow HTTP 3xx redirects. // +optional FollowRedirects *bool `json:"followRedirects,omitempty"` - // Whether to enable HTTP2. + // enableHTTP2 defines whether to enable HTTP2. // +optional EnableHTTP2 *bool `json:"enableHTTP2,omitempty"` } @@ -972,33 +996,35 @@ type KumaSDConfig struct { // See https://prometheus.io/docs/prometheus/latest/configuration/configuration/#eureka_sd_config // +k8s:openapi-gen=true type EurekaSDConfig struct { - // The URL to connect to the Eureka server. + // server defines the URL to connect to the Eureka server. + // +kubebuilder:validation:Pattern:="^http(s)?://.+$" // +kubebuilder:validation:MinLength=1 // +required Server string `json:"server"` - // BasicAuth information to use on every scrape request. + // basicAuth defines the BasicAuth information to use on every scrape request. // +optional BasicAuth *v1.BasicAuth `json:"basicAuth,omitempty"` - // Authorization header to use on every scrape request. + // authorization defines the header configuration to authenticate against the DigitalOcean API. + // Cannot be set at the same time as `oauth2`. // +optional Authorization *v1.SafeAuthorization `json:"authorization,omitempty"` - // Optional OAuth 2.0 configuration. - // Cannot be set at the same time as `authorization` or `basic_auth`. + // oauth2 defines the configuration to use on every scrape request. // +optional OAuth2 *v1.OAuth2 `json:"oauth2,omitempty"` - // TLS configuration applying to the target HTTP endpoint. + // tlsConfig defines the TLS configuration to connect to the Consul API. // +optional TLSConfig *v1.SafeTLSConfig `json:"tlsConfig,omitempty"` // ProxyConfig allows customizing the proxy behaviour for this scrape config. // +optional v1.ProxyConfig `json:",inline"` - // Configure whether HTTP requests follow HTTP 3xx redirects. + // followRedirects defines whether HTTP requests follow HTTP 3xx redirects. // +optional FollowRedirects *bool `json:"followRedirects,omitempty"` - // Whether to enable HTTP2. + // enableHTTP2 defines whether to enable HTTP2. // +optional EnableHTTP2 *bool `json:"enableHTTP2,omitempty"` - // Refresh interval to re-read the instance list. + // refreshInterval defines the time after which the provided names are refreshed. + // If not set, Prometheus uses its default value. // +optional RefreshInterval *v1.Duration `json:"refreshInterval,omitempty"` } @@ -1009,52 +1035,52 @@ type EurekaSDConfig struct { // See https://prometheus.io/docs/prometheus/latest/configuration/configuration/#docker_sd_config // +k8s:openapi-gen=true type DockerSDConfig struct { - // Address of the docker daemon + // host defines the address of the docker daemon // +kubebuilder:validation:MinLength=1 // +required Host string `json:"host"` // ProxyConfig allows customizing the proxy behaviour for this scrape config. // +optional v1.ProxyConfig `json:",inline"` - // TLS configuration applying to the target HTTP endpoint. - // +optional + // tlsConfig defines the TLS configuration to connect to the Consul API. + // +optionals TLSConfig *v1.SafeTLSConfig `json:"tlsConfig,omitempty"` - // The port to scrape metrics from. + // port defines the port to scrape metrics from. If using the public IP address, this must // +kubebuilder:validation:Minimum=0 // +kubebuilder:validation:Maximum=65535 // +optional Port *int32 `json:"port,omitempty"` - // The host to use if the container is in host networking mode. + // hostNetworkingHost defines the host to use if the container is in host networking mode. // +kubebuilder:validation:MinLength=1 // +optional HostNetworkingHost *string `json:"hostNetworkingHost,omitempty"` - // Configure whether to match the first network if the container has multiple networks defined. + // matchFirstNetwork defines whether to match the first network if the container has multiple networks defined. // If unset, Prometheus uses true by default. // It requires Prometheus >= v2.54.1. // // +optional MatchFirstNetwork *bool `json:"matchFirstNetwork,omitempty"` - // Optional filters to limit the discovery process to a subset of the available resources. + // filters defines filters to limit the discovery process to a subset of the available resources. // +optional Filters Filters `json:"filters,omitempty"` - // Time after which the container is refreshed. + // refreshInterval defines the time after which the provided names are refreshed. + // If not set, Prometheus uses its default value. // +optional RefreshInterval *v1.Duration `json:"refreshInterval,omitempty"` - // BasicAuth information to use on every scrape request. + // basicAuth defines information to use on every scrape request. // +optional BasicAuth *v1.BasicAuth `json:"basicAuth,omitempty"` - // Authorization header configuration to authenticate against the Docker API. + // authorization defines the header configuration to authenticate against the DigitalOcean API. // Cannot be set at the same time as `oauth2`. // +optional Authorization *v1.SafeAuthorization `json:"authorization,omitempty"` - // Optional OAuth 2.0 configuration. - // Cannot be set at the same time as `authorization`. + // oauth2 defines the configuration to use on every scrape request. // +optional OAuth2 *v1.OAuth2 `json:"oauth2,omitempty"` - // Configure whether HTTP requests follow HTTP 3xx redirects. + // followRedirects defines whether HTTP requests follow HTTP 3xx redirects. // +optional FollowRedirects *bool `json:"followRedirects,omitempty"` - // Whether to enable HTTP2. + // enableHTTP2 defines whether to enable HTTP2. // +optional EnableHTTP2 *bool `json:"enableHTTP2,omitempty"` } @@ -1064,41 +1090,42 @@ type DockerSDConfig struct { // See https://prometheus.io/docs/prometheus/latest/configuration/configuration/#hetzner_sd_config // +k8s:openapi-gen=true type HetznerSDConfig struct { - // The Hetzner role of entities that should be discovered. + // role defines the Hetzner role of entities that should be discovered. // +kubebuilder:validation:Enum=hcloud;Hcloud;robot;Robot // +required Role string `json:"role"` - // BasicAuth information to use on every scrape request, required when role is robot. - // Role hcloud does not support basic auth. + // basicAuth defines information to use on every scrape request. // +optional BasicAuth *v1.BasicAuth `json:"basicAuth,omitempty"` - // Authorization header configuration, required when role is hcloud. - // Role robot does not support bearer token authentication. + // authorization defines the header configuration to authenticate against the DigitalOcean API. + // Cannot be set at the same time as `oauth2`. // +optional Authorization *v1.SafeAuthorization `json:"authorization,omitempty"` - // Optional OAuth 2.0 configuration. - // Cannot be used at the same time as `basic_auth` or `authorization`. + // oauth2 defines the configuration to use on every scrape request. // +optional OAuth2 *v1.OAuth2 `json:"oauth2,omitempty"` // ProxyConfig allows customizing the proxy behaviour for this scrape config. // +optional v1.ProxyConfig `json:",inline"` - // Configure whether HTTP requests follow HTTP 3xx redirects. + // followRedirects defines whether HTTP requests follow HTTP 3xx redirects. // +optional FollowRedirects *bool `json:"followRedirects,omitempty"` - // Whether to enable HTTP2. + // enableHTTP2 defines whether to enable HTTP2. // +optional EnableHTTP2 *bool `json:"enableHTTP2,omitempty"` - // TLS configuration to use on every scrape request. + // tlsConfig defines the TLS configuration to connect to the Consul API. // +optional TLSConfig *v1.SafeTLSConfig `json:"tlsConfig,omitempty"` - // The port to scrape metrics from. + // port defines the port to scrape metrics from. If using the public IP address, this must + // +kubebuilder:validation:Minimum=0 + // +kubebuilder:validation:Maximum=65535 // +optional - Port *int `json:"port,omitempty"` - // The time after which the servers are refreshed. + Port *int32 `json:"port,omitempty"` + // refreshInterval defines the time after which the provided names are refreshed. + // If not set, Prometheus uses its default value. // +optional RefreshInterval *v1.Duration `json:"refreshInterval,omitempty"` - // Label selector used to filter the servers when fetching them from the API. + // labelSelector defines the label selector used to filter the servers when fetching them from the API. // It requires Prometheus >= v3.5.0. // +kubebuilder:validation:MinLength=1 // +optional @@ -1109,41 +1136,51 @@ type HetznerSDConfig struct { // See https://prometheus.io/docs/prometheus/latest/configuration/configuration/#nomad_sd_config // +k8s:openapi-gen=true type NomadSDConfig struct { - // The information to access the Nomad API. It is to be defined + // allowStale defines the information to access the Nomad API. It is to be defined // as the Nomad documentation requires. // +optional AllowStale *bool `json:"allowStale,omitempty"` + // namespace defines the Nomad namespace to query for service discovery. + // When specified, only resources within this namespace will be discovered. // +optional Namespace *string `json:"namespace,omitempty"` + // refreshInterval defines the time after which the provided names are refreshed. + // If not set, Prometheus uses its default value. // +optional RefreshInterval *v1.Duration `json:"refreshInterval,omitempty"` + // region defines the Nomad region to query for service discovery. + // When specified, only resources within this region will be discovered. // +optional Region *string `json:"region,omitempty"` + // server defines the Nomad server address to connect to for service discovery. + // This should be the full URL including protocol (e.g., "https://nomad.example.com:4646"). // +kubebuilder:validation:MinLength=1 // +required Server string `json:"server"` + // tagSeparator defines the separator used to join multiple tags. + // This determines how Nomad service tags are concatenated into Prometheus labels. // +optional TagSeparator *string `json:"tagSeparator,omitempty"` - // BasicAuth information to use on every scrape request. + // basicAuth defines information to use on every scrape request. // +optional BasicAuth *v1.BasicAuth `json:"basicAuth,omitempty"` - // Authorization header to use on every scrape request. + // authorization defines the header configuration to authenticate against the DigitalOcean API. + // Cannot be set at the same time as `oauth2`. // +optional Authorization *v1.SafeAuthorization `json:"authorization,omitempty"` - // Optional OAuth 2.0 configuration. - // Cannot be set at the same time as `authorization` or `basic_auth`. + // oauth2 defines the configuration to use on every scrape request. // +optional OAuth2 *v1.OAuth2 `json:"oauth2,omitempty"` - // TLS configuration applying to the target HTTP endpoint. + // tlsConfig defines the TLS configuration to connect to the Consul API. // +optional TLSConfig *v1.SafeTLSConfig `json:"tlsConfig,omitempty"` // ProxyConfig allows customizing the proxy behaviour for this scrape config. // +optional v1.ProxyConfig `json:",inline"` - // Configure whether HTTP requests follow HTTP 3xx redirects. + // followRedirects defines whether HTTP requests follow HTTP 3xx redirects. // +optional FollowRedirects *bool `json:"followRedirects,omitempty"` - // Whether to enable HTTP2. + // enableHTTP2 defines whether to enable HTTP2. // +optional EnableHTTP2 *bool `json:"enableHTTP2,omitempty"` } @@ -1161,23 +1198,30 @@ const ( // See https://prometheus.io/docs/prometheus/latest/configuration/configuration/#ovhcloud_sd_config // +k8s:openapi-gen=true type OVHCloudSDConfig struct { - // Access key to use. https://api.ovh.com. + // applicationKey defines the access key to use for OVHCloud API authentication. + // This is obtained from the OVHCloud API credentials at https://api.ovh.com. // +kubebuilder:validation:MinLength=1 // +required ApplicationKey string `json:"applicationKey"` + // applicationSecret defines the secret key for OVHCloud API authentication. + // This contains the application secret obtained during OVHCloud API credential creation. // +required ApplicationSecret corev1.SecretKeySelector `json:"applicationSecret"` + // consumerKey defines the consumer key for OVHCloud API authentication. + // This is the third component of OVHCloud's three-key authentication system. // +required ConsumerKey corev1.SecretKeySelector `json:"consumerKey"` - // Service of the targets to retrieve. Must be `VPS` or `DedicatedServer`. - // +kubebuilder:validation:Enum=VPS;DedicatedServer + // service defines the service type of the targets to retrieve. + // Must be either `VPS` or `DedicatedServer` to specify which OVHCloud resources to discover. // +required Service OVHService `json:"service"` - // Custom endpoint to be used. + // endpoint defines a custom API endpoint to be used. + // When not specified, defaults to the standard OVHCloud API endpoint for the region. // +kubebuilder:validation:MinLength=1 // +optional Endpoint *string `json:"endpoint,omitempty"` - // Refresh interval to re-read the resources list. + // refreshInterval defines the time after which the provided names are refreshed. + // If not set, Prometheus uses its default value. // +optional RefreshInterval *v1.Duration `json:"refreshInterval,omitempty"` } @@ -1186,21 +1230,21 @@ type OVHCloudSDConfig struct { // See https://prometheus.io/docs/prometheus/latest/configuration/configuration/#dockerswarm_sd_config // +k8s:openapi-gen=true type DockerSwarmSDConfig struct { - // Address of the Docker daemon + // host defines the address of the Docker daemon // +kubebuilder:validation:Pattern="^[a-zA-Z][a-zA-Z0-9+.-]*://.+$" // +required Host string `json:"host"` - // Role of the targets to retrieve. Must be `Services`, `Tasks`, or `Nodes`. + // role of the targets to retrieve. Must be `Services`, `Tasks`, or `Nodes`. // +kubebuilder:validation:Enum=Services;Tasks;Nodes // +required Role string `json:"role"` - // The port to scrape metrics from, when `role` is nodes, and for discovered + // port defines the port to scrape metrics from. If using the public IP address, this must // tasks and services that don't have published ports. // +kubebuilder:validation:Minimum=0 // +kubebuilder:validation:Maximum=65535 // +optional Port *int32 `json:"port,omitempty"` - // Optional filters to limit the discovery process to a subset of available + // filters defines the filters to limit the discovery process to a subset of available // resources. // The available filters are listed in the upstream documentation: // Services: https://docs.docker.com/engine/api/v1.40/#operation/ServiceList @@ -1208,27 +1252,29 @@ type DockerSwarmSDConfig struct { // Nodes: https://docs.docker.com/engine/api/v1.40/#operation/NodeList // +optional Filters Filters `json:"filters,omitempty"` - // The time after which the service discovery data is refreshed. + // refreshInterval defines the time after which the provided names are refreshed. + // If not set, Prometheus uses its default value. // +optional RefreshInterval *v1.Duration `json:"refreshInterval,omitempty"` - // Optional HTTP basic authentication information. + // basicAuth defines information to use on every scrape request. // +optional BasicAuth *v1.BasicAuth `json:"basicAuth,omitempty"` - // Authorization header configuration to authenticate against the target HTTP endpoint. + // authorization defines the header configuration to authenticate against the DigitalOcean API. + // Cannot be set at the same time as `oauth2`. // +optional Authorization *v1.SafeAuthorization `json:"authorization,omitempty"` - // Optional OAuth 2.0 configuration. + // oauth2 defines the optional OAuth 2.0 configuration to authenticate against the target HTTP endpoint. // Cannot be set at the same time as `authorization`, or `basicAuth`. // +optional OAuth2 *v1.OAuth2 `json:"oauth2,omitempty"` v1.ProxyConfig `json:",inline"` - // TLS configuration to use on every scrape request + // tlsConfig defines the TLS configuration to connect to the Consul API. // +optional TLSConfig *v1.SafeTLSConfig `json:"tlsConfig,omitempty"` - // Configure whether HTTP requests follow HTTP 3xx redirects. + // followRedirects defines whether HTTP requests follow HTTP 3xx redirects. // +optional FollowRedirects *bool `json:"followRedirects,omitempty"` - // Whether to enable HTTP2. + // enableHTTP2 defines whether to enable HTTP2. // +optional EnableHTTP2 *bool `json:"enableHTTP2,omitempty"` } @@ -1237,37 +1283,39 @@ type DockerSwarmSDConfig struct { // See https://prometheus.io/docs/prometheus/latest/configuration/configuration/#linode_sd_config // +k8s:openapi-gen=true type LinodeSDConfig struct { - // Optional region to filter on. + // region defines the region to filter on. // +kubebuilder:validation:MinLength=1 // +optional Region *string `json:"region,omitempty"` - // Default port to scrape metrics from. + // port defines the port to scrape metrics from. If using the public IP address, this must // +kubebuilder:validation:Minimum=0 // +kubebuilder:validation:Maximum=65535 // +optional Port *int32 `json:"port,omitempty"` - // The string by which Linode Instance tags are joined into the tag label. + // tagSeparator defines the string by which Linode Instance tags are joined into the tag label.el. // +kubebuilder:validation:MinLength=1 // +optional TagSeparator *string `json:"tagSeparator,omitempty"` - // Time after which the linode instances are refreshed. + // refreshInterval defines the time after which the provided names are refreshed. + // If not set, Prometheus uses its default value. // +optional RefreshInterval *v1.Duration `json:"refreshInterval,omitempty"` - // Authorization header configuration. + // authorization defines the header configuration to authenticate against the DigitalOcean API. + // Cannot be set at the same time as `oauth2`. // +optional Authorization *v1.SafeAuthorization `json:"authorization,omitempty"` - // Optional OAuth 2.0 configuration. - // Cannot be used at the same time as `authorization`. + // oauth2 defines the optional OAuth 2.0 configuration to authenticate against the target HTTP endpoint. + // Cannot be set at the same time as `authorization`, or `basicAuth`. // +optional OAuth2 *v1.OAuth2 `json:"oauth2,omitempty"` v1.ProxyConfig `json:",inline"` - // Configure whether HTTP requests follow HTTP 3xx redirects. + // followRedirects defines whether HTTP requests follow HTTP 3xx redirects. // +optional FollowRedirects *bool `json:"followRedirects,omitempty"` - // TLS configuration applying to the target HTTP endpoint. + // tlsConfig defines the TLS configuration to connect to the Consul API. // +optional TLSConfig *v1.SafeTLSConfig `json:"tlsConfig,omitempty"` - // Whether to enable HTTP2. + // enableHTTP2 defines whether to enable HTTP2. // +optional EnableHTTP2 *bool `json:"enableHTTP2,omitempty"` } @@ -1275,48 +1323,50 @@ type LinodeSDConfig struct { // PuppetDBSDConfig configurations allow retrieving scrape targets from PuppetDB resources. // See https://prometheus.io/docs/prometheus/latest/configuration/configuration/#puppetdb_sd_config type PuppetDBSDConfig struct { - // The URL of the PuppetDB root query endpoint. + // url defines the URL of the PuppetDB root query endpoint. // +kubebuilder:validation:MinLength:=1 // +kubebuilder:validation:Pattern:="^http(s)?://.+$" // +required URL string `json:"url"` - // Puppet Query Language (PQL) query. Only resources are supported. + // query defines the Puppet Query Language (PQL) query. Only resources are supported. // https://puppet.com/docs/puppetdb/latest/api/query/v4/pql.html // +kubebuilder:validation:MinLength=1 // +required Query string `json:"query"` - // Whether to include the parameters as meta labels. + // includeParameters defines whether to include the parameters as meta labels. // Note: Enabling this exposes parameters in the Prometheus UI and API. Make sure // that you don't have secrets exposed as parameters if you enable this. // +optional IncludeParameters *bool `json:"includeParameters,omitempty"` - // Refresh interval to re-read the list of resources. + // refreshInterval defines the time after which the provided names are refreshed. + // If not set, Prometheus uses its default value. // +optional RefreshInterval *v1.Duration `json:"refreshInterval,omitempty"` - // Port to scrape the metrics from. + // port defines the port to scrape metrics from. If using the public IP address, this must // +kubebuilder:validation:Minimum=0 // +kubebuilder:validation:Maximum=65535 + // +optional Port *int32 `json:"port,omitempty"` - // Optional HTTP basic authentication information. + // basicAuth defines information to use on every scrape request. // Cannot be set at the same time as `authorization`, or `oauth2`. // +optional BasicAuth *v1.BasicAuth `json:"basicAuth,omitempty"` - // Optional `authorization` HTTP header configuration. - // Cannot be set at the same time as `basicAuth`, or `oauth2`. + // authorization defines the header configuration to authenticate against the DigitalOcean API. + // Cannot be set at the same time as `oauth2`. // +optional Authorization *v1.SafeAuthorization `json:"authorization,omitempty"` - // Optional OAuth2.0 configuration. - // Cannot be set at the same time as `basicAuth`, or `authorization`. + // oauth2 defines the optional OAuth 2.0 configuration to authenticate against the target HTTP endpoint. + // Cannot be set at the same time as `authorization`, or `basicAuth`. // +optional OAuth2 *v1.OAuth2 `json:"oauth2,omitempty"` v1.ProxyConfig `json:",inline"` - // TLS configuration to connect to the Puppet DB. + // tlsConfig defines the TLS configuration to connect to the Consul API. // +optional TLSConfig *v1.SafeTLSConfig `json:"tlsConfig,omitempty"` - // Configure whether the HTTP requests should follow HTTP 3xx redirects. + // followRedirects defines whether HTTP requests follow HTTP 3xx redirects. // +optional FollowRedirects *bool `json:"followRedirects,omitempty"` - // Configure whether to enable HTTP2. + // enableHTTP2 defines whether to enable HTTP2. // +optional EnableHTTP2 *bool `json:"enableHTTP2,omitempty"` } @@ -1325,51 +1375,52 @@ type PuppetDBSDConfig struct { // See https://prometheus.io/docs/prometheus/latest/configuration/configuration/#lightsail_sd_config // TODO: Need to document that we will not be supporting the `_file` fields. type LightSailSDConfig struct { - // The AWS region. + // region defines the AWS region. // +kubebuilder:validation:MinLength=1 // +optional Region *string `json:"region,omitempty"` - // AccessKey is the AWS API key. + // accessKey defines the AWS API key. // +optional AccessKey *corev1.SecretKeySelector `json:"accessKey,omitempty"` - // SecretKey is the AWS API secret. + // secretKey defines the AWS API secret. // +optional SecretKey *corev1.SecretKeySelector `json:"secretKey,omitempty"` - // AWS Role ARN, an alternative to using AWS API keys. + // roleARN defines the AWS Role ARN, an alternative to using AWS API keys. // +optional RoleARN *string `json:"roleARN,omitempty"` - // Custom endpoint to be used. + // endpoint defines the custom endpoint to be used. // +kubebuilder:validation:MinLength=1 // +optional Endpoint *string `json:"endpoint,omitempty"` - // Refresh interval to re-read the list of instances. + // refreshInterval defines the time after which the provided names are refreshed. + // If not set, Prometheus uses its default value. // +optional RefreshInterval *v1.Duration `json:"refreshInterval,omitempty"` - // Port to scrape the metrics from. - // If using the public IP address, this must instead be specified in the relabeling rule. + // port defines the port to scrape metrics from. If using the public IP address, this must // +kubebuilder:validation:Minimum=0 // +kubebuilder:validation:Maximum=65535 + // +optional Port *int32 `json:"port,omitempty"` - // Optional HTTP basic authentication information. + // basicAuth defines information to use on every scrape request. // Cannot be set at the same time as `authorization`, or `oauth2`. // +optional BasicAuth *v1.BasicAuth `json:"basicAuth,omitempty"` - // Optional `authorization` HTTP header configuration. - // Cannot be set at the same time as `basicAuth`, or `oauth2`. + // authorization defines the header configuration to authenticate against the DigitalOcean API. + // Cannot be set at the same time as `oauth2`. // +optional Authorization *v1.SafeAuthorization `json:"authorization,omitempty"` - // Optional OAuth2.0 configuration. - // Cannot be set at the same time as `basicAuth`, or `authorization`. + // oauth2 defines the optional OAuth 2.0 configuration to authenticate against the target HTTP endpoint. + // Cannot be set at the same time as `authorization`, or `basicAuth`. // +optional OAuth2 *v1.OAuth2 `json:"oauth2,omitempty"` v1.ProxyConfig `json:",inline"` - // TLS configuration to connect to the Puppet DB. + // tlsConfig defines the TLS configuration to connect to the Consul API. // +optional TLSConfig *v1.SafeTLSConfig `json:"tlsConfig,omitempty"` - // Configure whether the HTTP requests should follow HTTP 3xx redirects. + // followRedirects defines whether HTTP requests follow HTTP 3xx redirects. // +optional FollowRedirects *bool `json:"followRedirects,omitempty"` - // Configure whether to enable HTTP2. + // enableHTTP2 defines whether to enable HTTP2. // +optional EnableHTTP2 *bool `json:"enableHTTP2,omitempty"` } @@ -1387,55 +1438,56 @@ const ( // See https://prometheus.io/docs/prometheus/latest/configuration/configuration/#scaleway_sd_config // TODO: Need to document that we will not be supporting the `_file` fields. type ScalewaySDConfig struct { - // Access key to use. https://console.scaleway.com/project/credentials + // accessKey defines the access key to use. https://console.scaleway.com/project/credentials // +kubebuilder:validation:MinLength=1 // +required AccessKey string `json:"accessKey"` - // Secret key to use when listing targets. + // secretKey defines the secret key to use when listing targets. // +required SecretKey corev1.SecretKeySelector `json:"secretKey"` - // Project ID of the targets. + // projectID defines the Project ID of the targets. // +kubebuilder:validation:MinLength=1 // +required ProjectID string `json:"projectID"` - // Service of the targets to retrieve. Must be `Instance` or `Baremetal`. + // role defines the service of the targets to retrieve. Must be `Instance` or `Baremetal`. // +required Role ScalewayRole `json:"role"` - // The port to scrape metrics from. + // port defines the port to scrape metrics from. If using the public IP address, this must // +kubebuilder:validation:Minimum=0 // +kubebuilder:validation:Maximum=65535 // +optional Port *int32 `json:"port,omitempty"` - // API URL to use when doing the server listing requests. + // apiURL defines the API URL to use when doing the server listing requests. // +kubebuilder:validation:Pattern:="^http(s)?://.+$" // +optional ApiURL *string `json:"apiURL,omitempty"` - // Zone is the availability zone of your targets (e.g. fr-par-1). + // zone defines the availability zone of your targets (e.g. fr-par-1). // +kubebuilder:validation:MinLength=1 // +optional Zone *string `json:"zone,omitempty"` - // NameFilter specify a name filter (works as a LIKE) to apply on the server listing request. + // nameFilter defines a name filter (works as a LIKE) to apply on the server listing request. // +kubebuilder:validation:MinLength=1 // +optional NameFilter *string `json:"nameFilter,omitempty"` - // TagsFilter specify a tag filter (a server needs to have all defined tags to be listed) to apply on the server listing request. + // tagsFilter defines a tag filter (a server needs to have all defined tags to be listed) to apply on the server listing request. // +kubebuilder:validation:MinItems=1 // +kubebuilder:validation:items:MinLength=1 // +listType=set // +optional TagsFilter []string `json:"tagsFilter,omitempty"` - // Refresh interval to re-read the list of instances. + // refreshInterval defines the time after which the provided names are refreshed. + // If not set, Prometheus uses its default value. // +optional RefreshInterval *v1.Duration `json:"refreshInterval,omitempty"` // +optional v1.ProxyConfig `json:",inline"` - // Configure whether HTTP requests follow HTTP 3xx redirects. + // followRedirects defines whether HTTP requests follow HTTP 3xx redirects. // +optional FollowRedirects *bool `json:"followRedirects,omitempty"` - // Whether to enable HTTP2. + // enableHTTP2 defines whether to enable HTTP2. // +optional EnableHTTP2 *bool `json:"enableHTTP2,omitempty"` - // TLS configuration to use on every scrape request + // tlsConfig defines the TLS configuration to connect to the Consul API. // +optional TLSConfig *v1.SafeTLSConfig `json:"tlsConfig,omitempty"` } @@ -1443,32 +1495,34 @@ type ScalewaySDConfig struct { // IonosSDConfig configurations allow retrieving scrape targets from IONOS resources. // See https://prometheus.io/docs/prometheus/latest/configuration/configuration/#ionos_sd_config type IonosSDConfig struct { - // The unique ID of the IONOS data center. + // datacenterID defines the unique ID of the IONOS data center. // +kubebuilder:validation:MinLength=1 // +required DataCenterID string `json:"datacenterID"` - // Port to scrape the metrics from. + // port defines the port to scrape metrics from. If using the public IP address, this must // +kubebuilder:validation:Minimum=0 // +kubebuilder:validation:Maximum=65535 // +optional Port *int32 `json:"port,omitempty"` - // Refresh interval to re-read the list of resources. + // refreshInterval defines the time after which the provided names are refreshed. + // If not set, Prometheus uses its default value. // +optional RefreshInterval *v1.Duration `json:"refreshInterval,omitempty"` - // Authorization` header configuration, required when using IONOS. + // authorization defines the header configuration to authenticate against the IONOS. + // Cannot be set at the same time as `oauth2`. // +required Authorization v1.SafeAuthorization `json:"authorization"` v1.ProxyConfig `json:",inline"` - // TLS configuration to use when connecting to the IONOS API. + // tlsConfig defines the TLS configuration to connect to the Consul API. // +optional TLSConfig *v1.SafeTLSConfig `json:"tlsConfig,omitempty"` - // Configure whether the HTTP requests should follow HTTP 3xx redirects. + // followRedirects defines whether HTTP requests follow HTTP 3xx redirects. // +optional FollowRedirects *bool `json:"followRedirects,omitempty"` - // Configure whether to enable HTTP2. + // enableHTTP2 defines whether to enable HTTP2. // +optional EnableHTTP2 *bool `json:"enableHTTP2,omitempty"` - // Configure whether to enable OAuth2. + // oauth2 defines the configuration to use on every scrape request. // +optional OAuth2 *v1.OAuth2 `json:"oauth2,omitempty"` } diff --git a/vendor/github.com/prometheus-operator/prometheus-operator/pkg/apis/monitoring/v1alpha1/validation.go b/vendor/github.com/prometheus-operator/prometheus-operator/pkg/apis/monitoring/v1alpha1/validation.go index ed1b849b74..f4ad418b79 100644 --- a/vendor/github.com/prometheus-operator/prometheus-operator/pkg/apis/monitoring/v1alpha1/validation.go +++ b/vendor/github.com/prometheus-operator/prometheus-operator/pkg/apis/monitoring/v1alpha1/validation.go @@ -304,9 +304,11 @@ func (mr MonthRange) Parse() (*ParsedRange, error) { // ParsedRange is an integer representation of a range // +kubebuilder:object:generate:=false type ParsedRange struct { - // Start is the beginning of the range + // start defines the beginning of the range + // +optional Start int `json:"start,omitempty"` - // End of the range + // end defines the end of the range + // +optional End int `json:"end,omitempty"` } diff --git a/vendor/github.com/prometheus-operator/prometheus-operator/pkg/apis/monitoring/v1alpha1/zz_generated.deepcopy.go b/vendor/github.com/prometheus-operator/prometheus-operator/pkg/apis/monitoring/v1alpha1/zz_generated.deepcopy.go index 436002fb0c..415327b14f 100644 --- a/vendor/github.com/prometheus-operator/prometheus-operator/pkg/apis/monitoring/v1alpha1/zz_generated.deepcopy.go +++ b/vendor/github.com/prometheus-operator/prometheus-operator/pkg/apis/monitoring/v1alpha1/zz_generated.deepcopy.go @@ -928,6 +928,11 @@ func (in *HTTPConfig) DeepCopyInto(out *HTTPConfig) { *out = new(bool) **out = **in } + if in.EnableHTTP2 != nil { + in, out := &in.EnableHTTP2, &out.EnableHTTP2 + *out = new(bool) + **out = **in + } } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new HTTPConfig. @@ -1027,7 +1032,7 @@ func (in *HetznerSDConfig) DeepCopyInto(out *HetznerSDConfig) { } if in.Port != nil { in, out := &in.Port, &out.Port - *out = new(int) + *out = new(int32) **out = **in } if in.RefreshInterval != nil { @@ -2529,6 +2534,7 @@ func (in *ScrapeConfig) DeepCopyInto(out *ScrapeConfig) { out.TypeMeta = in.TypeMeta in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) in.Spec.DeepCopyInto(&out.Spec) + in.Status.DeepCopyInto(&out.Status) } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ScrapeConfig. diff --git a/vendor/github.com/prometheus-operator/prometheus-operator/pkg/apis/monitoring/v1beta1/alertmanager_config_types.go b/vendor/github.com/prometheus-operator/prometheus-operator/pkg/apis/monitoring/v1beta1/alertmanager_config_types.go index a537cf0b24..8111c98604 100644 --- a/vendor/github.com/prometheus-operator/prometheus-operator/pkg/apis/monitoring/v1beta1/alertmanager_config_types.go +++ b/vendor/github.com/prometheus-operator/prometheus-operator/pkg/apis/monitoring/v1beta1/alertmanager_config_types.go @@ -47,18 +47,22 @@ const ( // // `Alertmanager` objects select `AlertmanagerConfig` objects using label and namespace selectors. type AlertmanagerConfig struct { - metav1.TypeMeta `json:",inline"` + // TypeMeta defines the versioned schema of this representation of an object. + metav1.TypeMeta `json:",inline"` + // metadata defines ObjectMeta as the metadata that all persisted resources. + // +optional metav1.ObjectMeta `json:"metadata,omitempty"` - + // spec defines the specification of AlertmanagerConfigSpec + // +required Spec AlertmanagerConfigSpec `json:"spec"` } // AlertmanagerConfigList is a list of AlertmanagerConfig. // +k8s:openapi-gen=true type AlertmanagerConfigList struct { + // TypeMeta defines the versioned schema of this representation of an object. metav1.TypeMeta `json:",inline"` - // Standard list metadata - // More info: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#metadata + // metadata defines ListMeta as metadata for collection responses. metav1.ListMeta `json:"metadata,omitempty"` // List of AlertmanagerConfig Items []AlertmanagerConfig `json:"items"` @@ -68,61 +72,62 @@ type AlertmanagerConfigList struct { // By definition, the Alertmanager configuration only applies to alerts for which // the `namespace` label is equal to the namespace of the AlertmanagerConfig resource. type AlertmanagerConfigSpec struct { - // The Alertmanager route definition for alerts matching the resource's + // route defines the Alertmanager route definition for alerts matching the resource's // namespace. If present, it will be added to the generated Alertmanager // configuration as a first-level route. // +optional Route *Route `json:"route"` - // List of receivers. + // receivers defines the list of receivers. // +optional Receivers []Receiver `json:"receivers"` - // List of inhibition rules. The rules will only apply to alerts matching + // inhibitRules defines the list of inhibition rules. The rules will only apply to alerts matching // the resource's namespace. // +optional InhibitRules []InhibitRule `json:"inhibitRules,omitempty"` - // List of TimeInterval specifying when the routes should be muted or active. + // timeIntervals defines the list of timeIntervals specifying when the routes should be muted. // +optional TimeIntervals []TimeInterval `json:"timeIntervals,omitempty"` } // Route defines a node in the routing tree. type Route struct { - // Name of the receiver for this route. If not empty, it should be listed in + // receiver defines the name of the receiver for this route. If not empty, it should be listed in // the `receivers` field. // +optional Receiver string `json:"receiver"` - // List of labels to group by. + // groupBy defines the list of labels to group by. // Labels must not be repeated (unique list). // Special label "..." (aggregate by all possible labels), if provided, must be the only element in the list. // +optional GroupBy []string `json:"groupBy,omitempty"` - // How long to wait before sending the initial notification. + // groupWait defines how long to wait before sending the initial notification. // Must match the regular expression`^(([0-9]+)y)?(([0-9]+)w)?(([0-9]+)d)?(([0-9]+)h)?(([0-9]+)m)?(([0-9]+)s)?(([0-9]+)ms)?$` // Example: "30s" // +optional GroupWait string `json:"groupWait,omitempty"` - // How long to wait before sending an updated notification. + // groupInterval defines how long to wait before sending an updated notification. // Must match the regular expression`^(([0-9]+)y)?(([0-9]+)w)?(([0-9]+)d)?(([0-9]+)h)?(([0-9]+)m)?(([0-9]+)s)?(([0-9]+)ms)?$` // Example: "5m" // +optional GroupInterval string `json:"groupInterval,omitempty"` - // How long to wait before repeating the last notification. + // repeatInterval defines how long to wait before repeating the last notification. // Must match the regular expression`^(([0-9]+)y)?(([0-9]+)w)?(([0-9]+)d)?(([0-9]+)h)?(([0-9]+)m)?(([0-9]+)s)?(([0-9]+)ms)?$` // Example: "4h" // +optional RepeatInterval string `json:"repeatInterval,omitempty"` - // List of matchers that the alert's labels should match. For the first + // matchers defines the list of matchers that the alert's labels should match. For the first // level route, the operator removes any existing equality and regexp // matcher on the `namespace` label and adds a `namespace: ` matcher. // +optional Matchers []Matcher `json:"matchers,omitempty"` - // Boolean indicating whether an alert should continue matching subsequent + // continue defines the boolean indicating whether an alert should continue matching subsequent // sibling nodes. It will always be overridden to true for the first-level // route by the Prometheus operator. // +optional Continue bool `json:"continue,omitempty"` - // Child routes. + // routes defines the child routes. + // +optional Routes []apiextensionsv1.JSON `json:"routes,omitempty"` // Note: this comment applies to the field definition above but appears // below otherwise it gets included in the generated manifest. @@ -131,10 +136,11 @@ type Route struct { // an alternative type to circumvent the limitation. The downside is that // the Kube API can't validate the data beyond the fact that it is a valid // JSON representation. - // MuteTimeIntervals is a list of TimeInterval names that will mute this route when matched. + + // muteTimeIntervals is a list of MuteTimeInterval names that will mute this route when matched, // +optional MuteTimeIntervals []string `json:"muteTimeIntervals,omitempty"` - // ActiveTimeIntervals is a list of TimeInterval names when this route should be active. + // activeTimeIntervals is a list of TimeInterval names when this route should be active. // +optional ActiveTimeIntervals []string `json:"activeTimeIntervals,omitempty"` } @@ -156,123 +162,139 @@ func (r *Route) ChildRoutes() ([]Route, error) { // Receiver defines one or more notification integrations. type Receiver struct { - // Name of the receiver. Must be unique across all items from the list. + // name defines the name of the receiver. Must be unique across all items from the list. // +kubebuilder:validation:MinLength=1 + // +required Name string `json:"name"` - // List of OpsGenie configurations. + // opsgenieConfigs defines the list of OpsGenie configurations. + // +optional OpsGenieConfigs []OpsGenieConfig `json:"opsgenieConfigs,omitempty"` - // List of PagerDuty configurations. + // pagerdutyConfigs defines the List of PagerDuty configurations. + // +optional PagerDutyConfigs []PagerDutyConfig `json:"pagerdutyConfigs,omitempty"` - // List of Slack configurations. + // discordConfigs defines the list of Slack configurations. + // +optional DiscordConfigs []DiscordConfig `json:"discordConfigs,omitempty"` - // List of Slack configurations. + // slackConfigs defines the list of Slack configurations. + // +optional SlackConfigs []SlackConfig `json:"slackConfigs,omitempty"` - // List of webhook configurations. + // webhookConfigs defines the List of webhook configurations. + // +optional WebhookConfigs []WebhookConfig `json:"webhookConfigs,omitempty"` - // List of WeChat configurations. + // wechatConfigs defines the list of WeChat configurations. + // +optional WeChatConfigs []WeChatConfig `json:"wechatConfigs,omitempty"` - // List of Email configurations. + // emailConfigs defines the list of Email configurations. + // +optional EmailConfigs []EmailConfig `json:"emailConfigs,omitempty"` - // List of VictorOps configurations. + // victoropsConfigs defines the list of VictorOps configurations. + // +optional VictorOpsConfigs []VictorOpsConfig `json:"victoropsConfigs,omitempty"` - // List of Pushover configurations. + // pushoverConfigs defines the list of Pushover configurations. + // +optional PushoverConfigs []PushoverConfig `json:"pushoverConfigs,omitempty"` - // List of SNS configurations + // snsConfigs defines the list of SNS configurations + // +optional SNSConfigs []SNSConfig `json:"snsConfigs,omitempty"` - // List of Telegram configurations. + // telegramConfigs defines the list of Telegram configurations. + // +optional TelegramConfigs []TelegramConfig `json:"telegramConfigs,omitempty"` - // List of Webex configurations. + // webexConfigs defines the list of Webex configurations. + // +optional WebexConfigs []WebexConfig `json:"webexConfigs,omitempty"` - // List of MSTeams configurations. + // msteamsConfigs defines the list of MSTeams configurations. // It requires Alertmanager >= 0.26.0. + // +optional MSTeamsConfigs []MSTeamsConfig `json:"msteamsConfigs,omitempty"` - // List of MSTeamsV2 configurations. + // msteamsv2Configs defines the list of MSTeamsV2 configurations. // It requires Alertmanager >= 0.28.0. + // +optional MSTeamsV2Configs []MSTeamsV2Config `json:"msteamsv2Configs,omitempty"` - // List of RocketChat configurations. + // rocketchatConfigs defines the list of RocketChat configurations. // It requires Alertmanager >= 0.28.0. + // +optional RocketChatConfigs []RocketChatConfig `json:"rocketchatConfigs,omitempty"` } // PagerDutyConfig configures notifications via PagerDuty. // See https://prometheus.io/docs/alerting/latest/configuration/#pagerduty_config type PagerDutyConfig struct { - // Whether or not to notify about resolved alerts. + // sendResolved defines whether or not to notify about resolved alerts. // +optional SendResolved *bool `json:"sendResolved,omitempty"` - // The secret's key that contains the PagerDuty integration key (when using + // routingKey defines the secret's key that contains the PagerDuty integration key (when using // Events API v2). Either this field or `serviceKey` needs to be defined. // The secret needs to be in the same namespace as the AlertmanagerConfig // object and accessible by the Prometheus Operator. // +optional RoutingKey *SecretKeySelector `json:"routingKey,omitempty"` - // The secret's key that contains the PagerDuty service key (when using + // serviceKey defines the secret's key that contains the PagerDuty service key (when using // integration type "Prometheus"). Either this field or `routingKey` needs to // be defined. // The secret needs to be in the same namespace as the AlertmanagerConfig // object and accessible by the Prometheus Operator. // +optional ServiceKey *SecretKeySelector `json:"serviceKey,omitempty"` - // The URL to send requests to. + // url defines the URL to send requests to. // +optional URL string `json:"url,omitempty"` - // Client identification. + // client defines the client identification. // +optional Client string `json:"client,omitempty"` - // Backlink to the sender of notification. + // clientURL defines the backlink to the sender of notification. // +optional ClientURL string `json:"clientURL,omitempty"` - // Description of the incident. + // description of the incident. // +optional Description string `json:"description,omitempty"` - // Severity of the incident. + // severity of the incident. // +optional Severity string `json:"severity,omitempty"` - // The class/type of the event. + // class defines the class/type of the event. // +optional Class string `json:"class,omitempty"` - // A cluster or grouping of sources. + // group defines a cluster or grouping of sources. // +optional Group string `json:"group,omitempty"` - // The part or component of the affected system that is broken. + // component defines the part or component of the affected system that is broken. // +optional Component string `json:"component,omitempty"` - // Arbitrary key/value pairs that provide further detail about the incident. + // details defines the arbitrary key/value pairs that provide further detail about the incident. // +optional Details []KeyValue `json:"details,omitempty"` - // A list of image details to attach that provide further detail about an incident. + // pagerDutyImageConfigs defines a list of image details to attach that provide further detail about an incident. // +optional PagerDutyImageConfigs []PagerDutyImageConfig `json:"pagerDutyImageConfigs,omitempty"` - // A list of link details to attach that provide further detail about an incident. + // pagerDutyLinkConfigs defines a list of link details to attach that provide further detail about an incident. // +optional PagerDutyLinkConfigs []PagerDutyLinkConfig `json:"pagerDutyLinkConfigs,omitempty"` - // HTTP client configuration. + // httpConfig defines the HTTP client configuration. // +optional HTTPConfig *HTTPConfig `json:"httpConfig,omitempty"` - // Unique location of the affected system. + // source defines the unique location of the affected system. // +optional Source *string `yaml:"source,omitempty" json:"source,omitempty"` } // PagerDutyImageConfig attaches images to an incident type PagerDutyImageConfig struct { - // Src of the image being attached to the incident + // src of the image being attached to the incident // +optional Src string `json:"src,omitempty"` - // Optional URL; makes the image a clickable link. + // href defines the optional URL; makes the image a clickable link. // +optional Href string `json:"href,omitempty"` - // Alt is the optional alternative text for the image. + // alt is the optional alternative text for the image. // +optional Alt string `json:"alt,omitempty"` } // PagerDutyLinkConfig attaches text links to an incident type PagerDutyLinkConfig struct { - // Href is the URL of the link to be attached + // href defines the URL of the link to be attached // +optional Href string `json:"href,omitempty"` - // Text that describes the purpose of the link, and can be used as the link's text. + // alt defines the text that describes the purpose of the link, and can be used as the link's text. // +optional Text string `json:"alt,omitempty"` } @@ -280,32 +302,32 @@ type PagerDutyLinkConfig struct { // DiscordConfig configures notifications via Discord. // See https://prometheus.io/docs/alerting/latest/configuration/#discord_config type DiscordConfig struct { - // Whether or not to notify about resolved alerts. + // sendResolved defines whether or not to notify about resolved alerts. // +optional SendResolved *bool `json:"sendResolved,omitempty"` - // The secret's key that contains the Discord webhook URL. + // apiURL defines the secret's key that contains the Discord webhook URL. // The secret needs to be in the same namespace as the AlertmanagerConfig // object and accessible by the Prometheus Operator. // +required APIURL v1.SecretKeySelector `json:"apiURL,omitempty"` - // The template of the message's title. + // title defines the template of the message's title. // +optional Title *string `json:"title,omitempty"` - // The template of the message's body. + // message defines the template of the message's body. // +optional Message *string `json:"message,omitempty"` - // The template of the content's body. + // content defines the template of the content's body. // +optional // +kubebuilder:validation:MinLength=1 Content *string `json:"content,omitempty"` - // The username of the message sender. + // username defines the username of the message sender. // +optional // +kubebuilder:validation:MinLength=1 Username *string `json:"username,omitempty"` - // The avatar url of the message sender. + // avatarURL defines the avatar url of the message sender. // +optional AvatarURL *URL `json:"avatarURL,omitempty"` - // HTTP client configuration. + // httpConfig defines HTTP client configuration. // +optional HTTPConfig *HTTPConfig `json:"httpConfig,omitempty"` } @@ -313,56 +335,77 @@ type DiscordConfig struct { // SlackConfig configures notifications via Slack. // See https://prometheus.io/docs/alerting/latest/configuration/#slack_config type SlackConfig struct { - // Whether or not to notify about resolved alerts. + // sendResolved defines whether or not to notify about resolved alerts. // +optional SendResolved *bool `json:"sendResolved,omitempty"` - // The secret's key that contains the Slack webhook URL. + // apiURL defines the secret's key that contains the Slack webhook URL. // The secret needs to be in the same namespace as the AlertmanagerConfig // object and accessible by the Prometheus Operator. // +optional APIURL *SecretKeySelector `json:"apiURL,omitempty"` - // The channel or user to send notifications to. + // channel defines the channel or user to send notifications to. // +optional Channel string `json:"channel,omitempty"` + // username defines the slack bot user name. // +optional Username string `json:"username,omitempty"` + // color defines the color of the left border of the Slack message attachment. + // Can be a hex color code (e.g., "#ff0000") or a predefined color name. // +optional Color string `json:"color,omitempty"` + // title defines the title text displayed in the Slack message attachment. // +optional Title string `json:"title,omitempty"` + // titleLink defines the URL that the title will link to when clicked. // +optional TitleLink string `json:"titleLink,omitempty"` + // pretext defines optional text that appears above the message attachment block. // +optional Pretext string `json:"pretext,omitempty"` + // text defines the main text content of the Slack message attachment. // +optional Text string `json:"text,omitempty"` - // A list of Slack fields that are sent with each notification. + // fields defines a list of Slack fields that are sent with each notification. // +optional Fields []SlackField `json:"fields,omitempty"` + // shortFields determines whether fields are displayed in a compact format. + // When true, fields are shown side by side when possible. // +optional ShortFields bool `json:"shortFields,omitempty"` + // footer defines small text displayed at the bottom of the message attachment. // +optional Footer string `json:"footer,omitempty"` + // fallback defines a plain-text summary of the attachment for clients that don't support attachments. // +optional Fallback string `json:"fallback,omitempty"` + // callbackId defines an identifier for the message used in interactive components. // +optional CallbackID string `json:"callbackId,omitempty"` + // iconEmoji defines the emoji to use as the bot's avatar (e.g., ":ghost:"). // +optional IconEmoji string `json:"iconEmoji,omitempty"` + // iconURL defines the URL to an image to use as the bot's avatar. // +optional IconURL string `json:"iconURL,omitempty"` + // imageURL defines the URL to an image file that will be displayed inside the message attachment. // +optional ImageURL string `json:"imageURL,omitempty"` + // thumbURL defines the URL to an image file that will be displayed as a thumbnail + // on the right side of the message attachment. // +optional ThumbURL string `json:"thumbURL,omitempty"` + // linkNames enables automatic linking of channel names and usernames in the message. + // When true, @channel and @username will be converted to clickable links. // +optional LinkNames bool `json:"linkNames,omitempty"` + // mrkdwnIn defines which fields should be parsed as Slack markdown. + // Valid values include "pretext", "text", and "fields". // +optional MrkdwnIn []string `json:"mrkdwnIn,omitempty"` - // A list of Slack actions that are sent with each notification. + // actions defines a list of Slack actions that are sent with each notification. // +optional Actions []SlackAction `json:"actions,omitempty"` - // HTTP client configuration. + // httpConfig defines the HTTP client configuration. // +optional HTTPConfig *HTTPConfig `json:"httpConfig,omitempty"` } @@ -389,18 +432,34 @@ func (sc *SlackConfig) Validate() error { // See https://api.slack.com/docs/message-attachments#action_fields and // https://api.slack.com/docs/message-buttons for more information. type SlackAction struct { + // type defines the type of interactive component. + // Common values include "button" for clickable buttons and "select" for dropdown menus. // +kubebuilder:validation:MinLength=1 + // +required Type string `json:"type"` + // text defines the user-visible label displayed on the action element. + // For buttons, this is the button text. For select menus, this is the placeholder text. // +kubebuilder:validation:MinLength=1 + // +required Text string `json:"text"` + // url defines the URL to open when the action is triggered. + // Only applicable for button-type actions. When set, clicking the button opens this URL. // +optional URL string `json:"url,omitempty"` + // style defines the visual appearance of the action element. + // Valid values include "default", "primary" (green), and "danger" (red). // +optional Style string `json:"style,omitempty"` + // name defines a unique identifier for the action within the message. + // This value is sent back to your application when the action is triggered. // +optional Name string `json:"name,omitempty"` + // value defines the payload sent when the action is triggered. + // This data is included in the callback sent to your application. // +optional Value string `json:"value,omitempty"` + // confirm defines an optional confirmation dialog that appears before the action is executed. + // When set, users must confirm their intent before the action proceeds. // +optional ConfirmField *SlackConfirmationField `json:"confirm,omitempty"` } @@ -434,12 +493,21 @@ func (sa *SlackAction) Validate() error { // See https://api.slack.com/docs/interactive-message-field-guide#confirmation_fields // for more information. type SlackConfirmationField struct { + // text defines the main message displayed in the confirmation dialog. + // This should be a clear question or statement asking the user to confirm their action. // +kubebuilder:validation:MinLength=1 + // +required Text string `json:"text"` + // title defines the title text displayed at the top of the confirmation dialog. + // When not specified, a default title will be used. // +optional Title string `json:"title,omitempty"` + // okText defines the label for the confirmation button in the dialog. + // When not specified, defaults to "Okay". This button proceeds with the action. // +optional OkText string `json:"okText,omitempty"` + // dismissText defines the label for the cancel button in the dialog. + // When not specified, defaults to "Cancel". This button cancels the action. // +optional DismissText string `json:"dismissText,omitempty"` } @@ -457,10 +525,19 @@ func (scf *SlackConfirmationField) Validate() error { // is short enough to be displayed next to other fields designated as short. // See https://api.slack.com/docs/message-attachments#fields for more information. type SlackField struct { + // title defines the label or header text displayed for this field. + // This appears as bold text above the field value in the Slack message. // +kubebuilder:validation:MinLength=1 + // +required Title string `json:"title"` + // value defines the content or data displayed for this field. + // This appears below the title and can contain plain text or Slack markdown. // +kubebuilder:validation:MinLength=1 + // +required Value string `json:"value"` + // short determines whether this field can be displayed alongside other short fields. + // When true, Slack may display this field side by side with other short fields. + // When false or not specified, the field takes the full width of the message. // +optional Short *bool `json:"short,omitempty"` } @@ -481,29 +558,29 @@ func (sf *SlackField) Validate() error { // WebhookConfig configures notifications via a generic receiver supporting the webhook payload. // See https://prometheus.io/docs/alerting/latest/configuration/#webhook_config type WebhookConfig struct { - // Whether or not to notify about resolved alerts. + // sendResolved defines whether or not to notify about resolved alerts. // +optional SendResolved *bool `json:"sendResolved,omitempty"` - // The URL to send HTTP POST requests to. `urlSecret` takes precedence over - // `url`. One of `urlSecret` and `url` should be defined. + // url defines the URL to send HTTP POST requests to. + // urlSecret takes precedence over url. One of urlSecret and url should be defined. // +optional URL *string `json:"url,omitempty"` - // The secret's key that contains the webhook URL to send HTTP requests to. - // `urlSecret` takes precedence over `url`. One of `urlSecret` and `url` - // should be defined. + // urlSecret defines the secret's key that contains the webhook URL to send HTTP requests to. + // urlSecret takes precedence over url. One of urlSecret and url should be defined. // The secret needs to be in the same namespace as the AlertmanagerConfig // object and accessible by the Prometheus Operator. // +optional URLSecret *SecretKeySelector `json:"urlSecret,omitempty"` - // HTTP client configuration. + // httpConfig defines the HTTP client configuration for webhook requests. // +optional HTTPConfig *HTTPConfig `json:"httpConfig,omitempty"` - // Maximum number of alerts to be sent per webhook message. When 0, all alerts are included. + // maxAlerts defines the maximum number of alerts to be sent per webhook message. + // When 0, all alerts are included in the webhook payload. // +optional // +kubebuilder:validation:Minimum=0 MaxAlerts int32 `json:"maxAlerts,omitempty"` - // The maximum time to wait for a webhook request to complete, before failing the - // request and allowing it to be retried. + // timeout defines the maximum time to wait for a webhook request to complete, + // before failing the request and allowing it to be retried. // It requires Alertmanager >= v0.28.0. // +optional Timeout *monitoringv1.Duration `json:"timeout,omitempty"` @@ -512,48 +589,59 @@ type WebhookConfig struct { // OpsGenieConfig configures notifications via OpsGenie. // See https://prometheus.io/docs/alerting/latest/configuration/#opsgenie_config type OpsGenieConfig struct { - // Whether or not to notify about resolved alerts. + // sendResolved defines whether or not to notify about resolved alerts. // +optional SendResolved *bool `json:"sendResolved,omitempty"` - // The secret's key that contains the OpsGenie API key. + // apiKey defines the secret's key that contains the OpsGenie API key. // The secret needs to be in the same namespace as the AlertmanagerConfig // object and accessible by the Prometheus Operator. // +optional APIKey *SecretKeySelector `json:"apiKey,omitempty"` - // The URL to send OpsGenie API requests to. + // apiURL defines the URL to send OpsGenie API requests to. + // When not specified, defaults to the standard OpsGenie API endpoint. // +optional APIURL string `json:"apiURL,omitempty"` - // Alert text limited to 130 characters. + // message defines the alert text limited to 130 characters. + // This appears as the main alert title in OpsGenie. // +optional Message string `json:"message,omitempty"` - // Description of the incident. + // description defines the detailed description of the incident. + // This provides additional context beyond the message field. // +optional Description string `json:"description,omitempty"` - // Backlink to the sender of the notification. + // source defines the backlink to the sender of the notification. + // This helps identify where the alert originated from. // +optional Source string `json:"source,omitempty"` - // Comma separated list of tags attached to the notifications. + // tags defines a comma separated list of tags attached to the notifications. + // These help categorize and filter alerts within OpsGenie. // +optional Tags string `json:"tags,omitempty"` - // Additional alert note. + // note defines an additional alert note. + // This provides supplementary information about the alert. // +optional Note string `json:"note,omitempty"` - // Priority level of alert. Possible values are P1, P2, P3, P4, and P5. + // priority defines the priority level of alert. + // Possible values are P1, P2, P3, P4, and P5, where P1 is highest priority. // +optional Priority string `json:"priority,omitempty"` - // A set of arbitrary key/value pairs that provide further detail about the incident. + // details defines a set of arbitrary key/value pairs that provide further detail about the incident. + // These appear as additional fields in the OpsGenie alert. // +optional Details []KeyValue `json:"details,omitempty"` - // List of responders responsible for notifications. + // responders defines the list of responders responsible for notifications. + // These determine who gets notified when the alert is created. // +optional Responders []OpsGenieConfigResponder `json:"responders,omitempty"` - // HTTP client configuration. + // httpConfig defines the HTTP client configuration for OpsGenie API requests. // +optional HTTPConfig *HTTPConfig `json:"httpConfig,omitempty"` - // Optional field that can be used to specify which domain alert is related to. + // entity defines an optional field that can be used to specify which domain alert is related to. + // This helps group related alerts together in OpsGenie. // +optional Entity string `json:"entity,omitempty"` - // Comma separated list of actions that will be available for the alert. + // actions defines a comma separated list of actions that will be available for the alert. + // These appear as action buttons in the OpsGenie interface. // +optional Actions string `json:"actions,omitempty"` } @@ -570,19 +658,26 @@ func (o *OpsGenieConfig) Validate() error { // OpsGenieConfigResponder defines a responder to an incident. // One of `id`, `name` or `username` has to be defined. +// +kubebuilder:validation:OneOf=ID,Name,Username type OpsGenieConfigResponder struct { - // ID of the responder. + // id defines the unique identifier of the responder. + // This corresponds to the responder's ID within OpsGenie. // +optional ID string `json:"id,omitempty"` - // Name of the responder. + // name defines the display name of the responder. + // This is used when the responder is identified by name rather than ID. // +optional Name string `json:"name,omitempty"` - // Username of the responder. + // username defines the username of the responder. + // This is typically used for user-type responders when identifying by username. // +optional Username string `json:"username,omitempty"` - // Type of responder. + // type defines the type of responder. + // Valid values include "user", "team", "schedule", and "escalation". + // This determines how OpsGenie interprets the other identifier fields. // +kubebuilder:validation:MinLength=1 // +kubebuilder:validation:Enum=team;teams;user;escalation;schedule + // +required Type string `json:"type"` } @@ -613,29 +708,30 @@ func (r *OpsGenieConfigResponder) Validate() error { // HTTPConfig defines a client HTTP configuration. // See https://prometheus.io/docs/alerting/latest/configuration/#http_config type HTTPConfig struct { - // Authorization header configuration for the client. + // authorization defines the authorization header configuration for the client. // This is mutually exclusive with BasicAuth and is only available starting from Alertmanager v0.22+. // +optional Authorization *monitoringv1.SafeAuthorization `json:"authorization,omitempty"` - // BasicAuth for the client. + // basicAuth defines the basic authentication credentials for the client. // This is mutually exclusive with Authorization. If both are defined, BasicAuth takes precedence. // +optional BasicAuth *monitoringv1.BasicAuth `json:"basicAuth,omitempty"` - // OAuth2 client credentials used to fetch a token for the targets. + // oauth2 defines the OAuth2 client credentials used to fetch a token for the targets. + // This enables OAuth2 authentication flow for HTTP requests. // +optional OAuth2 *monitoringv1.OAuth2 `json:"oauth2,omitempty"` - // The secret's key that contains the bearer token to be used by the client + // bearerTokenSecret defines the secret's key that contains the bearer token to be used by the client // for authentication. // The secret needs to be in the same namespace as the AlertmanagerConfig // object and accessible by the Prometheus Operator. // +optional BearerTokenSecret *SecretKeySelector `json:"bearerTokenSecret,omitempty"` - // TLS configuration for the client. + // tlsConfig defines the TLS configuration for the client. + // This includes settings for certificates, CA validation, and TLS protocol options. // +optional TLSConfig *monitoringv1.SafeTLSConfig `json:"tlsConfig,omitempty"` - // Optional proxy URL. - // + // proxyURL defines an optional proxy URL for HTTP requests. // If defined, this field takes precedence over `proxyUrl`. // // +optional @@ -643,31 +739,38 @@ type HTTPConfig struct { monitoringv1.ProxyConfig `json:",inline"` - // FollowRedirects specifies whether the client should follow HTTP 3xx redirects. + // followRedirects defines whether HTTP requests follow HTTP 3xx redirects. + // When true, the client will automatically follow redirect responses. // +optional FollowRedirects *bool `json:"followRedirects,omitempty"` + + // enableHttp2 can be used to disable HTTP2. + // + // +optional + EnableHTTP2 *bool `json:"enableHttp2,omitempty"` } // WebexConfig configures notification via Cisco Webex // See https://prometheus.io/docs/alerting/latest/configuration/#webex_config type WebexConfig struct { - // Whether to notify about resolved alerts. + // sendResolved defines whether or not to notify about resolved alerts. // +optional SendResolved *bool `json:"sendResolved,omitempty"` - // The Webex Teams API URL i.e. https://webexapis.com/v1/messages + // apiURL defines the Webex Teams API URL i.e. https://webexapis.com/v1/messages // +optional APIURL *URL `json:"apiURL,omitempty"` - // The HTTP client's configuration. + // httpConfig defines the HTTP client's configuration. // You must use this configuration to supply the bot token as part of the HTTP `Authorization` header. + // +optional HTTPConfig *HTTPConfig `json:"httpConfig,omitempty"` - // Message template + // message defines the message template // +optional Message *string `json:"message,omitempty"` - // ID of the Webex Teams room where to send the messages. + // roomID defines the ID of the Webex Teams room where to send the messages. // +kubebuilder:validation:MinLength=1 // +required RoomID string `json:"roomID"` @@ -676,82 +779,109 @@ type WebexConfig struct { // WeChatConfig configures notifications via WeChat. // See https://prometheus.io/docs/alerting/latest/configuration/#wechat_config type WeChatConfig struct { - // Whether or not to notify about resolved alerts. + // sendResolved defines whether or not to notify about resolved alerts. // +optional SendResolved *bool `json:"sendResolved,omitempty"` - // The secret's key that contains the WeChat API key. + // apiSecret defines the secret's key that contains the WeChat API key. // The secret needs to be in the same namespace as the AlertmanagerConfig // object and accessible by the Prometheus Operator. // +optional APISecret *SecretKeySelector `json:"apiSecret,omitempty"` - // The WeChat API URL. + // apiURL defines the WeChat API URL. + // When not specified, defaults to the standard WeChat Work API endpoint. // +optional APIURL string `json:"apiURL,omitempty"` - // The corp id for authentication. + // corpID defines the corp id for authentication. + // This is the unique identifier for your WeChat Work organization. // +optional CorpID string `json:"corpID,omitempty"` + // agentID defines the application agent ID within WeChat Work. + // This identifies which WeChat Work application will send the notifications. // +optional AgentID string `json:"agentID,omitempty"` + // toUser defines the target user(s) to receive the notification. + // Can be a single user ID or multiple user IDs separated by '|'. // +optional ToUser string `json:"toUser,omitempty"` + // toParty defines the target department(s) to receive the notification. + // Can be a single department ID or multiple department IDs separated by '|'. // +optional ToParty string `json:"toParty,omitempty"` + // toTag defines the target tag(s) to receive the notification. + // Can be a single tag ID or multiple tag IDs separated by '|'. // +optional ToTag string `json:"toTag,omitempty"` - // API request data as defined by the WeChat API. + // message defines the API request data as defined by the WeChat API. + // This contains the actual notification content to be sent. + // +optional Message string `json:"message,omitempty"` + // messageType defines the type of message to send. + // Valid values include "text", "markdown", and other WeChat Work supported message types. // +optional MessageType string `json:"messageType,omitempty"` - // HTTP client configuration. + // httpConfig defines the HTTP client configuration for WeChat API requests. // +optional HTTPConfig *HTTPConfig `json:"httpConfig,omitempty"` } // EmailConfig configures notifications via Email. type EmailConfig struct { - // Whether or not to notify about resolved alerts. + // sendResolved defines whether or not to notify about resolved alerts. // +optional SendResolved *bool `json:"sendResolved,omitempty"` - // The email address to send notifications to. + // to defines the email address to send notifications to. + // This is the recipient address for alert notifications. // +optional To string `json:"to,omitempty"` - // The sender address. + // from defines the sender address for email notifications. + // This appears as the "From" field in the email header. // +optional From string `json:"from,omitempty"` - // The hostname to identify to the SMTP server. + // hello defines the hostname to identify to the SMTP server. + // This is used in the SMTP HELO/EHLO command during the connection handshake. // +optional Hello string `json:"hello,omitempty"` - // The SMTP host and port through which emails are sent. E.g. example.com:25 + // smarthost defines the SMTP host and port through which emails are sent. + // Format should be "hostname:port", e.g. "smtp.example.com:587". // +optional Smarthost string `json:"smarthost,omitempty"` - // The username to use for authentication. + // authUsername defines the username to use for SMTP authentication. + // This is used for SMTP AUTH when the server requires authentication. // +optional AuthUsername string `json:"authUsername,omitempty"` - // The secret's key that contains the password to use for authentication. + // authPassword defines the secret's key that contains the password to use for authentication. // The secret needs to be in the same namespace as the AlertmanagerConfig // object and accessible by the Prometheus Operator. + // +optional AuthPassword *SecretKeySelector `json:"authPassword,omitempty"` - // The secret's key that contains the CRAM-MD5 secret. + // authSecret defines the secret's key that contains the CRAM-MD5 secret. + // This is used for CRAM-MD5 authentication mechanism. // The secret needs to be in the same namespace as the AlertmanagerConfig // object and accessible by the Prometheus Operator. + // +optional AuthSecret *SecretKeySelector `json:"authSecret,omitempty"` - // The identity to use for authentication. + // authIdentity defines the identity to use for SMTP authentication. + // This is typically used with PLAIN authentication mechanism. // +optional AuthIdentity string `json:"authIdentity,omitempty"` - // Further headers email header key/value pairs. Overrides any headers - // previously set by the notification implementation. + // headers defines additional email header key/value pairs. + // These override any headers previously set by the notification implementation. + // +optional Headers []KeyValue `json:"headers,omitempty"` - // The HTML body of the email notification. + // html defines the HTML body of the email notification. + // This allows for rich formatting in the email content. // +optional HTML *string `json:"html,omitempty"` - // The text body of the email notification. + // text defines the plain text body of the email notification. + // This provides a fallback for email clients that don't support HTML. // +optional Text *string `json:"text,omitempty"` - // The SMTP TLS requirement. + // requireTLS defines the SMTP TLS requirement. // Note that Go does not support unencrypted connections to remote SMTP endpoints. // +optional RequireTLS *bool `json:"requireTLS,omitempty"` - // TLS configuration + // tlsConfig defines the TLS configuration for SMTP connections. + // This includes settings for certificates, CA validation, and TLS protocol options. // +optional TLSConfig *monitoringv1.SafeTLSConfig `json:"tlsConfig,omitempty"` } @@ -759,36 +889,43 @@ type EmailConfig struct { // VictorOpsConfig configures notifications via VictorOps. // See https://prometheus.io/docs/alerting/latest/configuration/#victorops_config type VictorOpsConfig struct { - // Whether or not to notify about resolved alerts. + // sendResolved defines whether or not to notify about resolved alerts. // +optional SendResolved *bool `json:"sendResolved,omitempty"` - // The secret's key that contains the API key to use when talking to the VictorOps API. + // apiKey defines the secret's key that contains the API key to use when talking to the VictorOps API. // The secret needs to be in the same namespace as the AlertmanagerConfig // object and accessible by the Prometheus Operator. // +optional APIKey *SecretKeySelector `json:"apiKey,omitempty"` - // The VictorOps API URL. + // apiUrl defines the VictorOps API URL. + // When not specified, defaults to the standard VictorOps API endpoint. // +optional APIURL string `json:"apiUrl,omitempty"` - // A key used to map the alert to a team. + // routingKey defines a key used to map the alert to a team. + // This determines which VictorOps team will receive the alert notification. // +optional RoutingKey string `json:"routingKey"` - // Describes the behavior of the alert (CRITICAL, WARNING, INFO). + // messageType describes the behavior of the alert. + // Valid values are "CRITICAL", "WARNING", and "INFO". // +optional MessageType string `json:"messageType,omitempty"` - // Contains summary of the alerted problem. + // entityDisplayName contains a summary of the alerted problem. + // This appears as the main title or identifier for the incident. // +optional EntityDisplayName string `json:"entityDisplayName,omitempty"` - // Contains long explanation of the alerted problem. + // stateMessage contains a long explanation of the alerted problem. + // This provides detailed context about the incident. // +optional StateMessage string `json:"stateMessage,omitempty"` - // The monitoring tool the state message is from. + // monitoringTool defines the monitoring tool the state message is from. + // This helps identify the source system that generated the alert. // +optional MonitoringTool string `json:"monitoringTool,omitempty"` - // Additional custom fields for notification. + // customFields defines additional custom fields for notification. + // These provide extra metadata that will be included with the VictorOps incident. // +optional CustomFields []KeyValue `json:"customFields,omitempty"` - // The HTTP client's configuration. + // httpConfig defines the HTTP client's configuration for VictorOps API requests. // +optional HTTPConfig *HTTPConfig `json:"httpConfig,omitempty"` } @@ -796,69 +933,80 @@ type VictorOpsConfig struct { // PushoverConfig configures notifications via Pushover. // See https://prometheus.io/docs/alerting/latest/configuration/#pushover_config type PushoverConfig struct { - // Whether or not to notify about resolved alerts. + // sendResolved defines whether or not to notify about resolved alerts. // +optional SendResolved *bool `json:"sendResolved,omitempty"` - // The secret's key that contains the recipient user's user key. + // userKey defines the secret's key that contains the recipient user's user key. // The secret needs to be in the same namespace as the AlertmanagerConfig // object and accessible by the Prometheus Operator. // Either `userKey` or `userKeyFile` is required. // +optional UserKey *SecretKeySelector `json:"userKey,omitempty"` - // The user key file that contains the recipient user's user key. + // userKeyFile defines the user key file that contains the recipient user's user key. // Either `userKey` or `userKeyFile` is required. // It requires Alertmanager >= v0.26.0. // +optional UserKeyFile *string `json:"userKeyFile,omitempty"` - // The secret's key that contains the registered application's API token, see https://pushover.net/apps. + // token defines the secret's key that contains the registered application's API token. + // See https://pushover.net/apps for application registration. // The secret needs to be in the same namespace as the AlertmanagerConfig // object and accessible by the Prometheus Operator. // Either `token` or `tokenFile` is required. // +optional Token *SecretKeySelector `json:"token,omitempty"` - // The token file that contains the registered application's API token, see https://pushover.net/apps. + // tokenFile defines the token file that contains the registered application's API token. + // See https://pushover.net/apps for application registration. // Either `token` or `tokenFile` is required. // It requires Alertmanager >= v0.26.0. // +optional TokenFile *string `json:"tokenFile,omitempty"` - // Notification title. + // title defines the notification title displayed in the Pushover message. + // This appears as the bold header text in the notification. // +optional Title string `json:"title,omitempty"` - // Notification message. + // message defines the notification message content. + // This is the main body text of the Pushover notification. // +optional Message string `json:"message,omitempty"` - // A supplementary URL shown alongside the message. + // url defines a supplementary URL shown alongside the message. + // This creates a clickable link within the Pushover notification. // +optional URL string `json:"url,omitempty"` - // A title for supplementary URL, otherwise just the URL is shown + // urlTitle defines a title for the supplementary URL. + // If not specified, the raw URL is shown instead. // +optional URLTitle string `json:"urlTitle,omitempty"` - // The time to live definition for the alert notification + // ttl defines the time to live for the alert notification. + // This determines how long the notification remains active before expiring. // +optional TTL *monitoringv1.Duration `json:"ttl,omitempty"` - // The name of a device to send the notification to + // device defines the name of a specific device to send the notification to. + // If not specified, the notification is sent to all user's devices. // +optional Device *string `json:"device,omitempty"` - // The name of one of the sounds supported by device clients to override the user's default sound choice + // sound defines the name of one of the sounds supported by device clients. + // This overrides the user's default sound choice for this notification. // +optional Sound string `json:"sound,omitempty"` - // Priority, see https://pushover.net/api#priority + // priority defines the notification priority level. + // See https://pushover.net/api#priority for valid values and behavior. // +optional Priority string `json:"priority,omitempty"` - // How often the Pushover servers will send the same notification to the user. - // Must be at least 30 seconds. + // retry defines how often the Pushover servers will send the same notification to the user. + // Must be at least 30 seconds. Only applies to priority 2 notifications. // +kubebuilder:validation:Pattern=`^(([0-9]+)y)?(([0-9]+)w)?(([0-9]+)d)?(([0-9]+)h)?(([0-9]+)m)?(([0-9]+)s)?(([0-9]+)ms)?$` // +optional Retry string `json:"retry,omitempty"` - // How long your notification will continue to be retried for, unless the user - // acknowledges the notification. + // expire defines how long your notification will continue to be retried for, + // unless the user acknowledges the notification. Only applies to priority 2 notifications. // +kubebuilder:validation:Pattern=`^(([0-9]+)y)?(([0-9]+)w)?(([0-9]+)d)?(([0-9]+)h)?(([0-9]+)m)?(([0-9]+)s)?(([0-9]+)ms)?$` // +optional Expire string `json:"expire,omitempty"` - // Whether notification message is HTML or plain text. + // html defines whether notification message is HTML or plain text. + // When true, the message can include HTML formatting tags. // +optional HTML bool `json:"html,omitempty"` - // HTTP client configuration. + // httpConfig defines the HTTP client configuration for Pushover API requests. // +optional HTTPConfig *HTTPConfig `json:"httpConfig,omitempty"` } @@ -866,38 +1014,42 @@ type PushoverConfig struct { // SNSConfig configures notifications via AWS SNS. // See https://prometheus.io/docs/alerting/latest/configuration/#sns_configs type SNSConfig struct { - // Whether or not to notify about resolved alerts. + // sendResolved defines whether or not to notify about resolved alerts. // +optional SendResolved *bool `json:"sendResolved,omitempty"` - // The SNS API URL i.e. https://sns.us-east-2.amazonaws.com. + // apiURL defines the SNS API URL, e.g. https://sns.us-east-2.amazonaws.com. // If not specified, the SNS API URL from the SNS SDK will be used. // +optional ApiURL string `json:"apiURL,omitempty"` - // Configures AWS's Signature Verification 4 signing process to sign requests. + // sigv4 configures AWS's Signature Verification 4 signing process to sign requests. + // This includes AWS credentials and region configuration for authentication. // +optional Sigv4 *monitoringv1.Sigv4 `json:"sigv4,omitempty"` - // SNS topic ARN, i.e. arn:aws:sns:us-east-2:698519295917:My-Topic + // topicARN defines the SNS topic ARN, e.g. arn:aws:sns:us-east-2:698519295917:My-Topic. // If you don't specify this value, you must specify a value for the PhoneNumber or TargetARN. // +optional TopicARN string `json:"topicARN,omitempty"` - // Subject line when the message is delivered to email endpoints. + // subject defines the subject line when the message is delivered to email endpoints. + // This field is only used when sending to email subscribers of an SNS topic. // +optional Subject string `json:"subject,omitempty"` - // Phone number if message is delivered via SMS in E.164 format. + // phoneNumber defines the phone number if message is delivered via SMS in E.164 format. // If you don't specify this value, you must specify a value for the TopicARN or TargetARN. // +optional PhoneNumber string `json:"phoneNumber,omitempty"` - // The mobile platform endpoint ARN if message is delivered via mobile notifications. - // If you don't specify this value, you must specify a value for the topic_arn or PhoneNumber. + // targetARN defines the mobile platform endpoint ARN if message is delivered via mobile notifications. + // If you don't specify this value, you must specify a value for the TopicARN or PhoneNumber. // +optional TargetARN string `json:"targetARN,omitempty"` - // The message content of the SNS notification. + // message defines the message content of the SNS notification. + // This is the actual notification text that will be sent to subscribers. // +optional Message string `json:"message,omitempty"` - // SNS message attributes. + // attributes defines SNS message attributes as key-value pairs. + // These provide additional metadata that can be used for message filtering and routing. // +optional Attributes map[string]string `json:"attributes,omitempty"` - // HTTP client configuration. + // httpConfig defines the HTTP client configuration for SNS API requests. // +optional HTTPConfig *HTTPConfig `json:"httpConfig,omitempty"` } @@ -905,46 +1057,49 @@ type SNSConfig struct { // TelegramConfig configures notifications via Telegram. // See https://prometheus.io/docs/alerting/latest/configuration/#telegram_config type TelegramConfig struct { - // Whether to notify about resolved alerts. + // sendResolved defines whether or not to notify about resolved alerts. // +optional SendResolved *bool `json:"sendResolved,omitempty"` - // The Telegram API URL i.e. https://api.telegram.org. - // If not specified, default API URL will be used. + // apiURL defines the Telegram API URL, e.g. https://api.telegram.org. + // If not specified, the default Telegram API URL will be used. // +optional APIURL string `json:"apiURL,omitempty"` - // Telegram bot token. It is mutually exclusive with `botTokenFile`. + // botToken defines the Telegram bot token. It is mutually exclusive with `botTokenFile`. // The secret needs to be in the same namespace as the AlertmanagerConfig // object and accessible by the Prometheus Operator. - // // Either `botToken` or `botTokenFile` is required. - // - //+optional + // +optional BotToken *SecretKeySelector `json:"botToken,omitempty"` - // File to read the Telegram bot token from. It is mutually exclusive with `botToken`. + // botTokenFile defines the file to read the Telegram bot token from. + // It is mutually exclusive with `botToken`. // Either `botToken` or `botTokenFile` is required. - // // It requires Alertmanager >= v0.26.0. - // // +optional BotTokenFile *string `json:"botTokenFile,omitempty"` - // The Telegram chat ID. + // chatID defines the Telegram chat ID where messages will be sent. + // This can be a user ID, group ID, or channel ID (with @ prefix for public channels). // +required ChatID int64 `json:"chatID,omitempty"` - // The Telegram Group Topic ID. + // messageThreadID defines the Telegram Group Topic ID for threaded messages. + // This allows sending messages to specific topics within Telegram groups. // It requires Alertmanager >= 0.26.0. // +optional MessageThreadID *int64 `json:"messageThreadID,omitempty"` - // Message template + // message defines the message template for the Telegram notification. + // This is the content that will be sent to the specified chat. // +optional Message string `json:"message,omitempty"` - // Disable telegram notifications + // disableNotifications controls whether Telegram notifications are sent silently. + // When true, users will receive the message without notification sounds. // +optional DisableNotifications *bool `json:"disableNotifications,omitempty"` - // Parse mode for telegram message + // parseMode defines the parse mode for telegram message formatting. + // Valid values are "MarkdownV2", "Markdown", and "HTML". + // This determines how text formatting is interpreted in the message. //+kubebuilder:validation:Enum=MarkdownV2;Markdown;HTML // +optional ParseMode string `json:"parseMode,omitempty"` - // HTTP client configuration. + // httpConfig defines the HTTP client configuration for Telegram API requests. // +optional HTTPConfig *HTTPConfig `json:"httpConfig,omitempty"` } @@ -952,46 +1107,53 @@ type TelegramConfig struct { // MSTeamsConfig configures notifications via Microsoft Teams. // It requires Alertmanager >= 0.26.0. type MSTeamsConfig struct { - // Whether to notify about resolved alerts. + // sendResolved defines whether or not to notify about resolved alerts. // +optional SendResolved *bool `json:"sendResolved,omitempty"` - // MSTeams webhook URL. - // +kubebuilder:validation:Required + // webhookUrl defines the MSTeams webhook URL for sending notifications. + // This is the incoming webhook URL configured in your Teams channel. + // +required WebhookURL v1.SecretKeySelector `json:"webhookUrl"` - // Message title template. + // title defines the message title template for Teams notifications. + // This appears as the main heading of the Teams message card. // +optional Title *string `json:"title,omitempty"` - // Message summary template. + // summary defines the message summary template for Teams notifications. + // This provides a brief overview that appears in Teams notification previews. // It requires Alertmanager >= 0.27.0. // +optional Summary *string `json:"summary,omitempty"` - // Message body template. + // text defines the message body template for Teams notifications. + // This contains the detailed content of the Teams message. // +optional Text *string `json:"text,omitempty"` - // HTTP client configuration. + // httpConfig defines the HTTP client configuration for Teams webhook requests. // +optional HTTPConfig *HTTPConfig `json:"httpConfig,omitempty"` } -// MSTeamsV2Config configures notifications via Microsoft Teams using the new message format with adaptive cards as required by flows +// MSTeamsV2Config configures notifications via Microsoft Teams using the new message format with adaptive cards as required by flows. // See https://prometheus.io/docs/alerting/latest/configuration/#msteamsv2_config // It requires Alertmanager >= 0.28.0. type MSTeamsV2Config struct { - // Whether to notify about resolved alerts. + // sendResolved defines whether or not to notify about resolved alerts. // +optional SendResolved *bool `json:"sendResolved,omitempty"` - // MSTeams incoming webhook URL. + // webhookURL defines the MSTeams incoming webhook URL for adaptive card notifications. + // This webhook must support the newer adaptive cards format required by Teams flows. // +optional WebhookURL *v1.SecretKeySelector `json:"webhookURL,omitempty"` - // Message title template. + // title defines the message title template for adaptive card notifications. + // This appears as the main heading in the Teams adaptive card. // +kubebuilder:validation:MinLength=1 // +optional Title *string `json:"title,omitempty"` - // Message body template. + // text defines the message body template for adaptive card notifications. + // This contains the detailed content displayed in the Teams adaptive card format. // +kubebuilder:validation:MinLength=1 // +optional Text *string `json:"text,omitempty"` - // HTTP client configuration. + // httpConfig defines the HTTP client configuration for Teams webhook requests. // +optional HTTPConfig *HTTPConfig `json:"httpConfig,omitempty"` } @@ -999,96 +1161,117 @@ type MSTeamsV2Config struct { // RocketChatConfig configures notifications via RocketChat. // It requires Alertmanager >= 0.28.0. type RocketChatConfig struct { - // Whether to notify about resolved alerts. + // sendResolved defines whether or not to notify about resolved alerts. // +optional SendResolved *bool `json:"sendResolved,omitempty"` - // The API URL for RocketChat. + // apiURL defines the API URL for RocketChat. // Defaults to https://open.rocket.chat/ if not specified. // +optional APIURL *URL `json:"apiURL,omitempty"` - // The channel to send alerts to. + // channel defines the channel to send alerts to. + // This can be a channel name (e.g., "#alerts") or a direct message recipient. // +kubebuilder:validation:MinLength=1 // +optional Channel *string `json:"channel,omitempty"` - // The sender token. + // token defines the sender token for RocketChat authentication. + // This is the personal access token or bot token used to authenticate API requests. // +required Token v1.SecretKeySelector `json:"token,omitempty"` - // The sender token ID. + // tokenID defines the sender token ID for RocketChat authentication. + // This is the user ID associated with the token used for API requests. // +required TokenID v1.SecretKeySelector `json:"tokenID,omitempty"` - // The message color. + // color defines the message color displayed in RocketChat. + // This appears as a colored bar alongside the message. // +kubebuilder:validation:MinLength=1 // +optional Color *string `json:"color,omitempty"` - // If provided, the avatar will be displayed as an emoji. + // emoji defines the emoji to be displayed as an avatar. + // If provided, this emoji will be used instead of the default avatar or iconURL. // +kubebuilder:validation:MinLength=1 // +optional Emoji *string `json:"emoji,omitempty"` - // Icon URL for the message. + // iconURL defines the icon URL for the message avatar. + // This displays a custom image as the message sender's avatar. // +optional IconURL *URL `json:"iconURL,omitempty"` - // The main message text. + // text defines the message text to send. + // This is optional because attachments can be used instead of or alongside text. // +kubebuilder:validation:MinLength=1 // +optional Text *string `json:"text,omitempty"` - // The message title. + // title defines the message title displayed prominently in the message. + // This appears as bold text at the top of the message attachment. // +kubebuilder:validation:MinLength=1 // +optional Title *string `json:"title,omitempty"` - // The title link for the message. + // titleLink defines the URL that the title will link to when clicked. + // This makes the message title clickable in the RocketChat interface. // +kubebuilder:validation:MinLength=1 // +optional TitleLink *string `json:"titleLink,omitempty"` - // Additional fields for the message. + // fields defines additional fields for the message attachment. + // These appear as structured key-value pairs within the message. // +kubebuilder:validation:MinItems=1 // +optional Fields []RocketChatFieldConfig `json:"fields,omitempty"` - // Whether to use short fields. + // shortFields defines whether to use short fields in the message layout. + // When true, fields may be displayed side by side to save space. // +optional ShortFields *bool `json:"shortFields,omitempty"` - // Image URL for the message. + // imageURL defines the image URL to display within the message. + // This embeds an image directly in the message attachment. // +optional ImageURL *URL `json:"imageURL,omitempty"` - // Thumbnail URL for the message. + // thumbURL defines the thumbnail URL for the message. + // This displays a small thumbnail image alongside the message content. // +optional ThumbURL *URL `json:"thumbURL,omitempty"` - // Whether to enable link names. + // linkNames defines whether to enable automatic linking of usernames and channels. + // When true, @username and #channel references become clickable links. // +optional LinkNames *bool `json:"linkNames,omitempty"` - // Actions to include in the message. + // actions defines interactive actions to include in the message. + // These appear as buttons that users can click to trigger responses. // +kubebuilder:validation:MinItems=1 // +optional Actions []RocketChatActionConfig `json:"actions,omitempty"` - // HTTP client configuration. + // httpConfig defines the HTTP client configuration for RocketChat API requests. // +optional HTTPConfig *HTTPConfig `json:"httpConfig,omitempty"` } // RocketChatFieldConfig defines a field for RocketChat messages. type RocketChatFieldConfig struct { - // The field title. + // title defines the title of this field. + // This appears as bold text labeling the field content. // +kubebuilder:validation:MinLength=1 // +optional Title *string `json:"title,omitempty"` - // The field value. + // value defines the value of this field, displayed underneath the title. + // This contains the actual data or content for the field. // +kubebuilder:validation:MinLength=1 // +optional Value *string `json:"value,omitempty"` - // Whether the field is displayed in a compact form. + // short defines whether this field should be a short field. + // When true, the field may be displayed inline with other short fields to save space. // +optional Short *bool `json:"short,omitempty"` } // RocketChatActionConfig defines actions for RocketChat messages. type RocketChatActionConfig struct { - // The button text. + // text defines the button text displayed to users. + // This is the label that appears on the interactive button. // +kubebuilder:validation:MinLength=1 // +optional Text *string `json:"text,omitempty"` - // The URL the button links to. + // url defines the URL the button links to when clicked. + // This creates a clickable button that opens the specified URL. // +optional URL *URL `json:"url,omitempty"` - // The message to send when the button is clicked. + // msg defines the message to send when the button is clicked. + // This allows the button to post a predefined message to the channel. // +kubebuilder:validation:MinLength=1 // +optional Msg *string `json:"msg,omitempty"` @@ -1098,39 +1281,51 @@ type RocketChatActionConfig struct { // alerts are already firing. // See https://prometheus.io/docs/alerting/latest/configuration/#inhibit_rule type InhibitRule struct { - // Matchers that have to be fulfilled in the alerts to be muted. The - // operator enforces that the alert matches the resource's namespace. + // targetMatch defines matchers that have to be fulfilled in the alerts to be muted. + // The operator enforces that the alert matches the resource's namespace. + // When these conditions are met, matching alerts will be inhibited (silenced). + // +optional TargetMatch []Matcher `json:"targetMatch,omitempty"` - // Matchers for which one or more alerts have to exist for the inhibition - // to take effect. The operator enforces that the alert matches the - // resource's namespace. + // sourceMatch defines matchers for which one or more alerts have to exist for the inhibition + // to take effect. The operator enforces that the alert matches the resource's namespace. + // These are the "trigger" alerts that cause other alerts to be inhibited. + // +optional SourceMatch []Matcher `json:"sourceMatch,omitempty"` - // Labels that must have an equal value in the source and target alert for - // the inhibition to take effect. + // equal defines labels that must have an equal value in the source and target alert + // for the inhibition to take effect. This ensures related alerts are properly grouped. + // +optional Equal []string `json:"equal,omitempty"` } // KeyValue defines a (key, value) tuple. type KeyValue struct { - // Key of the tuple. + // key defines the key of the tuple. + // This is the identifier or name part of the key-value pair. // +kubebuilder:validation:MinLength=1 + // +required Key string `json:"key"` - // Value of the tuple. + // value defines the value of the tuple. + // This is the data or content associated with the key. + // +required Value string `json:"value"` } // Matcher defines how to match on alert's labels. type Matcher struct { - // Label to match. + // name defines the label to match. + // This specifies which alert label should be evaluated. // +kubebuilder:validation:MinLength=1 + // +required Name string `json:"name"` - // Label value to match. + // value defines the label value to match. + // This is the expected value for the specified label. // +optional Value string `json:"value"` - // Match operator, one of `=` (equal to), `!=` (not equal to), `=~` (regex - // match) or `!~` (not regex match). - // Negative operators (`!=` and `!~`) require Alertmanager >= v0.22.0. + // matchType defines the match operation available with AlertManager >= v0.22.0. + // Takes precedence over Regex (deprecated) if non-empty. + // Valid values: "=" (equality), "!=" (inequality), "=~" (regex match), "!~" (regex non-match). // +kubebuilder:validation:Enum=!=;=;=~;!~ + // +optional MatchType MatchType `json:"matchType,omitempty"` } @@ -1170,13 +1365,13 @@ func (mt MatchType) Valid() bool { // SecretKeySelector selects a key of a Secret. type SecretKeySelector struct { - // The name of the secret in the object's namespace to select from. + // name defines the name of the secret in the object's namespace to select from. // +kubebuilder:validation:MinLength=1 - // +kubebuilder:validation:Required + // +required Name string `json:"name"` - // The key of the secret to select from. Must be a valid secret key. + // key defines the key of the secret to select from. Must be a valid secret key. // +kubebuilder:validation:MinLength=1 - // +kubebuilder:validation:Required + // +required Key string `json:"key"` } @@ -1220,28 +1415,29 @@ func openMetricsEscape(s string) string { // TimeInterval specifies the periods in time when notifications will be muted or active. type TimeInterval struct { - // Name of the time interval. - // +kubebuilder:validation:Required + // name of the time interval. + // +required Name string `json:"name,omitempty"` - // TimeIntervals is a list of TimePeriod. + // timeIntervals defines a list of TimePeriod. + // +optional TimeIntervals []TimePeriod `json:"timeIntervals,omitempty"` } // TimePeriod describes periods of time. type TimePeriod struct { - // Times is a list of TimeRange + // times defines a list of TimeRange // +optional Times []TimeRange `json:"times,omitempty"` - // Weekdays is a list of WeekdayRange + // weekdays defines a list of WeekdayRange // +optional Weekdays []WeekdayRange `json:"weekdays,omitempty"` - // DaysOfMonth is a list of DayOfMonthRange + // daysOfMonth defines a list of DayOfMonthRange // +optional DaysOfMonth []DayOfMonthRange `json:"daysOfMonth,omitempty"` - // Months is a list of MonthRange + // months defines a list of MonthRange // +optional Months []MonthRange `json:"months,omitempty"` - // Years is a list of YearRange + // years defines a list of YearRange // +optional Years []YearRange `json:"years,omitempty"` } @@ -1252,9 +1448,11 @@ type Time string // TimeRange defines a start and end time in 24hr format type TimeRange struct { - // StartTime is the start time in 24hr format. + // startTime defines the start time in 24hr format. + // +optional StartTime Time `json:"startTime,omitempty"` - // EndTime is the end time in 24hr format. + // endTime defines the end time in 24hr format. + // +optional EndTime Time `json:"endTime,omitempty"` } @@ -1265,13 +1463,15 @@ type WeekdayRange string // DayOfMonthRange is an inclusive range of days of the month beginning at 1 type DayOfMonthRange struct { - // Start of the inclusive range + // start of the inclusive range // +kubebuilder:validation:Minimum=-31 // +kubebuilder:validation:Maximum=31 + // +optional Start int `json:"start,omitempty"` - // End of the inclusive range + // end of the inclusive range // +kubebuilder:validation:Minimum=-31 // +kubebuilder:validation:Maximum=31 + // +optional End int `json:"end,omitempty"` } diff --git a/vendor/github.com/prometheus-operator/prometheus-operator/pkg/apis/monitoring/v1beta1/conversion_from.go b/vendor/github.com/prometheus-operator/prometheus-operator/pkg/apis/monitoring/v1beta1/conversion_from.go index bc16b9025f..8f3b8f06bf 100644 --- a/vendor/github.com/prometheus-operator/prometheus-operator/pkg/apis/monitoring/v1beta1/conversion_from.go +++ b/vendor/github.com/prometheus-operator/prometheus-operator/pkg/apis/monitoring/v1beta1/conversion_from.go @@ -151,6 +151,7 @@ func convertHTTPConfigFrom(in *v1alpha1.HTTPConfig) *HTTPConfig { ProxyURLOriginal: in.ProxyURLOriginal, ProxyConfig: in.ProxyConfig, FollowRedirects: in.FollowRedirects, + EnableHTTP2: in.EnableHTTP2, } } diff --git a/vendor/github.com/prometheus-operator/prometheus-operator/pkg/apis/monitoring/v1beta1/conversion_to.go b/vendor/github.com/prometheus-operator/prometheus-operator/pkg/apis/monitoring/v1beta1/conversion_to.go index c1f4a75777..f65c7ac4f3 100644 --- a/vendor/github.com/prometheus-operator/prometheus-operator/pkg/apis/monitoring/v1beta1/conversion_to.go +++ b/vendor/github.com/prometheus-operator/prometheus-operator/pkg/apis/monitoring/v1beta1/conversion_to.go @@ -144,6 +144,7 @@ func convertHTTPConfigTo(in *HTTPConfig) *v1alpha1.HTTPConfig { ProxyURLOriginal: in.ProxyURLOriginal, ProxyConfig: in.ProxyConfig, FollowRedirects: in.FollowRedirects, + EnableHTTP2: in.EnableHTTP2, } } diff --git a/vendor/github.com/prometheus-operator/prometheus-operator/pkg/apis/monitoring/v1beta1/validation.go b/vendor/github.com/prometheus-operator/prometheus-operator/pkg/apis/monitoring/v1beta1/validation.go index 57f8a82d36..856566122b 100644 --- a/vendor/github.com/prometheus-operator/prometheus-operator/pkg/apis/monitoring/v1beta1/validation.go +++ b/vendor/github.com/prometheus-operator/prometheus-operator/pkg/apis/monitoring/v1beta1/validation.go @@ -303,9 +303,11 @@ func (mr MonthRange) Parse() (*ParsedRange, error) { // ParsedRange is an integer representation of a range // +kubebuilder:object:generate:=false type ParsedRange struct { - // Start is the beginning of the range + // start defines the beginning of the range + // +optional Start int `json:"start,omitempty"` - // End of the range + // end defines the end of the range + // +optional End int `json:"end,omitempty"` } diff --git a/vendor/github.com/prometheus-operator/prometheus-operator/pkg/apis/monitoring/v1beta1/zz_generated.deepcopy.go b/vendor/github.com/prometheus-operator/prometheus-operator/pkg/apis/monitoring/v1beta1/zz_generated.deepcopy.go index 00ff2fddd5..94d5dbf320 100644 --- a/vendor/github.com/prometheus-operator/prometheus-operator/pkg/apis/monitoring/v1beta1/zz_generated.deepcopy.go +++ b/vendor/github.com/prometheus-operator/prometheus-operator/pkg/apis/monitoring/v1beta1/zz_generated.deepcopy.go @@ -267,6 +267,11 @@ func (in *HTTPConfig) DeepCopyInto(out *HTTPConfig) { *out = new(bool) **out = **in } + if in.EnableHTTP2 != nil { + in, out := &in.EnableHTTP2, &out.EnableHTTP2 + *out = new(bool) + **out = **in + } } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new HTTPConfig. diff --git a/vendor/github.com/prometheus-operator/prometheus-operator/pkg/client/applyconfiguration/monitoring/v1/alertmanager.go b/vendor/github.com/prometheus-operator/prometheus-operator/pkg/client/applyconfiguration/monitoring/v1/alertmanager.go index aeb26b8dbe..bf74aa7411 100644 --- a/vendor/github.com/prometheus-operator/prometheus-operator/pkg/client/applyconfiguration/monitoring/v1/alertmanager.go +++ b/vendor/github.com/prometheus-operator/prometheus-operator/pkg/client/applyconfiguration/monitoring/v1/alertmanager.go @@ -41,6 +41,7 @@ func Alertmanager(name, namespace string) *AlertmanagerApplyConfiguration { b.WithAPIVersion("monitoring.coreos.com/v1") return b } +func (b AlertmanagerApplyConfiguration) IsApplyConfiguration() {} // WithKind sets the Kind field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. @@ -216,8 +217,24 @@ func (b *AlertmanagerApplyConfiguration) WithStatus(value *AlertmanagerStatusApp return b } +// GetKind retrieves the value of the Kind field in the declarative configuration. +func (b *AlertmanagerApplyConfiguration) GetKind() *string { + return b.TypeMetaApplyConfiguration.Kind +} + +// GetAPIVersion retrieves the value of the APIVersion field in the declarative configuration. +func (b *AlertmanagerApplyConfiguration) GetAPIVersion() *string { + return b.TypeMetaApplyConfiguration.APIVersion +} + // GetName retrieves the value of the Name field in the declarative configuration. func (b *AlertmanagerApplyConfiguration) GetName() *string { b.ensureObjectMetaApplyConfigurationExists() return b.ObjectMetaApplyConfiguration.Name } + +// GetNamespace retrieves the value of the Namespace field in the declarative configuration. +func (b *AlertmanagerApplyConfiguration) GetNamespace() *string { + b.ensureObjectMetaApplyConfigurationExists() + return b.ObjectMetaApplyConfiguration.Namespace +} diff --git a/vendor/github.com/prometheus-operator/prometheus-operator/pkg/client/applyconfiguration/monitoring/v1/alertmanagerglobalconfig.go b/vendor/github.com/prometheus-operator/prometheus-operator/pkg/client/applyconfiguration/monitoring/v1/alertmanagerglobalconfig.go index a1fe62246b..a9cd77c60a 100644 --- a/vendor/github.com/prometheus-operator/prometheus-operator/pkg/client/applyconfiguration/monitoring/v1/alertmanagerglobalconfig.go +++ b/vendor/github.com/prometheus-operator/prometheus-operator/pkg/client/applyconfiguration/monitoring/v1/alertmanagerglobalconfig.go @@ -30,7 +30,7 @@ type AlertmanagerGlobalConfigApplyConfiguration struct { SlackAPIURL *corev1.SecretKeySelector `json:"slackApiUrl,omitempty"` OpsGenieAPIURL *corev1.SecretKeySelector `json:"opsGenieApiUrl,omitempty"` OpsGenieAPIKey *corev1.SecretKeySelector `json:"opsGenieApiKey,omitempty"` - PagerdutyURL *string `json:"pagerdutyUrl,omitempty"` + PagerdutyURL *monitoringv1.URL `json:"pagerdutyUrl,omitempty"` TelegramConfig *GlobalTelegramConfigApplyConfiguration `json:"telegram,omitempty"` JiraConfig *GlobalJiraConfigApplyConfiguration `json:"jira,omitempty"` VictorOpsConfig *GlobalVictorOpsConfigApplyConfiguration `json:"victorops,omitempty"` @@ -96,7 +96,7 @@ func (b *AlertmanagerGlobalConfigApplyConfiguration) WithOpsGenieAPIKey(value co // WithPagerdutyURL sets the PagerdutyURL field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the PagerdutyURL field is set to the value of the last call. -func (b *AlertmanagerGlobalConfigApplyConfiguration) WithPagerdutyURL(value string) *AlertmanagerGlobalConfigApplyConfiguration { +func (b *AlertmanagerGlobalConfigApplyConfiguration) WithPagerdutyURL(value monitoringv1.URL) *AlertmanagerGlobalConfigApplyConfiguration { b.PagerdutyURL = &value return b } diff --git a/vendor/github.com/prometheus-operator/prometheus-operator/pkg/client/applyconfiguration/monitoring/v1/embeddedpersistentvolumeclaim.go b/vendor/github.com/prometheus-operator/prometheus-operator/pkg/client/applyconfiguration/monitoring/v1/embeddedpersistentvolumeclaim.go index 760939f0ac..f6d450c219 100644 --- a/vendor/github.com/prometheus-operator/prometheus-operator/pkg/client/applyconfiguration/monitoring/v1/embeddedpersistentvolumeclaim.go +++ b/vendor/github.com/prometheus-operator/prometheus-operator/pkg/client/applyconfiguration/monitoring/v1/embeddedpersistentvolumeclaim.go @@ -38,6 +38,7 @@ func EmbeddedPersistentVolumeClaim() *EmbeddedPersistentVolumeClaimApplyConfigur b.WithAPIVersion("monitoring.coreos.com/v1") return b } +func (b EmbeddedPersistentVolumeClaimApplyConfiguration) IsApplyConfiguration() {} // WithKind sets the Kind field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. @@ -115,3 +116,13 @@ func (b *EmbeddedPersistentVolumeClaimApplyConfiguration) WithStatus(value corev b.Status = &value return b } + +// GetKind retrieves the value of the Kind field in the declarative configuration. +func (b *EmbeddedPersistentVolumeClaimApplyConfiguration) GetKind() *string { + return b.TypeMetaApplyConfiguration.Kind +} + +// GetAPIVersion retrieves the value of the APIVersion field in the declarative configuration. +func (b *EmbeddedPersistentVolumeClaimApplyConfiguration) GetAPIVersion() *string { + return b.TypeMetaApplyConfiguration.APIVersion +} diff --git a/vendor/github.com/prometheus-operator/prometheus-operator/pkg/client/applyconfiguration/monitoring/v1/httpconfig.go b/vendor/github.com/prometheus-operator/prometheus-operator/pkg/client/applyconfiguration/monitoring/v1/httpconfig.go index 5b55498507..3e724da1b6 100644 --- a/vendor/github.com/prometheus-operator/prometheus-operator/pkg/client/applyconfiguration/monitoring/v1/httpconfig.go +++ b/vendor/github.com/prometheus-operator/prometheus-operator/pkg/client/applyconfiguration/monitoring/v1/httpconfig.go @@ -30,6 +30,7 @@ type HTTPConfigApplyConfiguration struct { TLSConfig *SafeTLSConfigApplyConfiguration `json:"tlsConfig,omitempty"` ProxyConfigApplyConfiguration `json:",inline"` FollowRedirects *bool `json:"followRedirects,omitempty"` + EnableHTTP2 *bool `json:"enableHttp2,omitempty"` } // HTTPConfigApplyConfiguration constructs a declarative configuration of the HTTPConfig type for use with @@ -123,3 +124,11 @@ func (b *HTTPConfigApplyConfiguration) WithFollowRedirects(value bool) *HTTPConf b.FollowRedirects = &value return b } + +// WithEnableHTTP2 sets the EnableHTTP2 field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the EnableHTTP2 field is set to the value of the last call. +func (b *HTTPConfigApplyConfiguration) WithEnableHTTP2(value bool) *HTTPConfigApplyConfiguration { + b.EnableHTTP2 = &value + return b +} diff --git a/vendor/github.com/prometheus-operator/prometheus-operator/pkg/client/applyconfiguration/monitoring/v1/otlpconfig.go b/vendor/github.com/prometheus-operator/prometheus-operator/pkg/client/applyconfiguration/monitoring/v1/otlpconfig.go index 9d27560a8b..8e07ceb571 100644 --- a/vendor/github.com/prometheus-operator/prometheus-operator/pkg/client/applyconfiguration/monitoring/v1/otlpconfig.go +++ b/vendor/github.com/prometheus-operator/prometheus-operator/pkg/client/applyconfiguration/monitoring/v1/otlpconfig.go @@ -29,6 +29,7 @@ type OTLPConfigApplyConfiguration struct { TranslationStrategy *monitoringv1.TranslationStrategyOption `json:"translationStrategy,omitempty"` KeepIdentifyingResourceAttributes *bool `json:"keepIdentifyingResourceAttributes,omitempty"` ConvertHistogramsToNHCB *bool `json:"convertHistogramsToNHCB,omitempty"` + PromoteScopeMetadata *bool `json:"promoteScopeMetadata,omitempty"` } // OTLPConfigApplyConfiguration constructs a declarative configuration of the OTLPConfig type for use with @@ -88,3 +89,11 @@ func (b *OTLPConfigApplyConfiguration) WithConvertHistogramsToNHCB(value bool) * b.ConvertHistogramsToNHCB = &value return b } + +// WithPromoteScopeMetadata sets the PromoteScopeMetadata field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the PromoteScopeMetadata field is set to the value of the last call. +func (b *OTLPConfigApplyConfiguration) WithPromoteScopeMetadata(value bool) *OTLPConfigApplyConfiguration { + b.PromoteScopeMetadata = &value + return b +} diff --git a/vendor/github.com/prometheus-operator/prometheus-operator/pkg/client/applyconfiguration/monitoring/v1/podmetricsendpoint.go b/vendor/github.com/prometheus-operator/prometheus-operator/pkg/client/applyconfiguration/monitoring/v1/podmetricsendpoint.go index ac42e66ca8..e61f850878 100644 --- a/vendor/github.com/prometheus-operator/prometheus-operator/pkg/client/applyconfiguration/monitoring/v1/podmetricsendpoint.go +++ b/vendor/github.com/prometheus-operator/prometheus-operator/pkg/client/applyconfiguration/monitoring/v1/podmetricsendpoint.go @@ -25,28 +25,21 @@ import ( // PodMetricsEndpointApplyConfiguration represents a declarative configuration of the PodMetricsEndpoint type for use // with apply. type PodMetricsEndpointApplyConfiguration struct { - Port *string `json:"port,omitempty"` - PortNumber *int32 `json:"portNumber,omitempty"` - TargetPort *intstr.IntOrString `json:"targetPort,omitempty"` - Path *string `json:"path,omitempty"` - Scheme *string `json:"scheme,omitempty"` - Params map[string][]string `json:"params,omitempty"` - Interval *monitoringv1.Duration `json:"interval,omitempty"` - ScrapeTimeout *monitoringv1.Duration `json:"scrapeTimeout,omitempty"` - TLSConfig *SafeTLSConfigApplyConfiguration `json:"tlsConfig,omitempty"` - BearerTokenSecret *corev1.SecretKeySelector `json:"bearerTokenSecret,omitempty"` - HonorLabels *bool `json:"honorLabels,omitempty"` - HonorTimestamps *bool `json:"honorTimestamps,omitempty"` - TrackTimestampsStaleness *bool `json:"trackTimestampsStaleness,omitempty"` - BasicAuth *BasicAuthApplyConfiguration `json:"basicAuth,omitempty"` - OAuth2 *OAuth2ApplyConfiguration `json:"oauth2,omitempty"` - Authorization *SafeAuthorizationApplyConfiguration `json:"authorization,omitempty"` - MetricRelabelConfigs []RelabelConfigApplyConfiguration `json:"metricRelabelings,omitempty"` - RelabelConfigs []RelabelConfigApplyConfiguration `json:"relabelings,omitempty"` - ProxyConfigApplyConfiguration `json:",inline"` - FollowRedirects *bool `json:"followRedirects,omitempty"` - EnableHttp2 *bool `json:"enableHttp2,omitempty"` - FilterRunning *bool `json:"filterRunning,omitempty"` + Port *string `json:"port,omitempty"` + PortNumber *int32 `json:"portNumber,omitempty"` + TargetPort *intstr.IntOrString `json:"targetPort,omitempty"` + Path *string `json:"path,omitempty"` + Scheme *string `json:"scheme,omitempty"` + Params map[string][]string `json:"params,omitempty"` + Interval *monitoringv1.Duration `json:"interval,omitempty"` + ScrapeTimeout *monitoringv1.Duration `json:"scrapeTimeout,omitempty"` + HonorLabels *bool `json:"honorLabels,omitempty"` + HonorTimestamps *bool `json:"honorTimestamps,omitempty"` + TrackTimestampsStaleness *bool `json:"trackTimestampsStaleness,omitempty"` + MetricRelabelConfigs []RelabelConfigApplyConfiguration `json:"metricRelabelings,omitempty"` + RelabelConfigs []RelabelConfigApplyConfiguration `json:"relabelings,omitempty"` + FilterRunning *bool `json:"filterRunning,omitempty"` + HTTPConfigApplyConfiguration `json:",inline"` } // PodMetricsEndpointApplyConfiguration constructs a declarative configuration of the PodMetricsEndpoint type for use with @@ -125,22 +118,6 @@ func (b *PodMetricsEndpointApplyConfiguration) WithScrapeTimeout(value monitorin return b } -// WithTLSConfig sets the TLSConfig field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the TLSConfig field is set to the value of the last call. -func (b *PodMetricsEndpointApplyConfiguration) WithTLSConfig(value *SafeTLSConfigApplyConfiguration) *PodMetricsEndpointApplyConfiguration { - b.TLSConfig = value - return b -} - -// WithBearerTokenSecret sets the BearerTokenSecret field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the BearerTokenSecret field is set to the value of the last call. -func (b *PodMetricsEndpointApplyConfiguration) WithBearerTokenSecret(value corev1.SecretKeySelector) *PodMetricsEndpointApplyConfiguration { - b.BearerTokenSecret = &value - return b -} - // WithHonorLabels sets the HonorLabels field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the HonorLabels field is set to the value of the last call. @@ -165,30 +142,6 @@ func (b *PodMetricsEndpointApplyConfiguration) WithTrackTimestampsStaleness(valu return b } -// WithBasicAuth sets the BasicAuth field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the BasicAuth field is set to the value of the last call. -func (b *PodMetricsEndpointApplyConfiguration) WithBasicAuth(value *BasicAuthApplyConfiguration) *PodMetricsEndpointApplyConfiguration { - b.BasicAuth = value - return b -} - -// WithOAuth2 sets the OAuth2 field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the OAuth2 field is set to the value of the last call. -func (b *PodMetricsEndpointApplyConfiguration) WithOAuth2(value *OAuth2ApplyConfiguration) *PodMetricsEndpointApplyConfiguration { - b.OAuth2 = value - return b -} - -// WithAuthorization sets the Authorization field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the Authorization field is set to the value of the last call. -func (b *PodMetricsEndpointApplyConfiguration) WithAuthorization(value *SafeAuthorizationApplyConfiguration) *PodMetricsEndpointApplyConfiguration { - b.Authorization = value - return b -} - // WithMetricRelabelConfigs adds the given value to the MetricRelabelConfigs field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the MetricRelabelConfigs field. @@ -215,6 +168,54 @@ func (b *PodMetricsEndpointApplyConfiguration) WithRelabelConfigs(values ...*Rel return b } +// WithFilterRunning sets the FilterRunning field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the FilterRunning field is set to the value of the last call. +func (b *PodMetricsEndpointApplyConfiguration) WithFilterRunning(value bool) *PodMetricsEndpointApplyConfiguration { + b.FilterRunning = &value + return b +} + +// WithAuthorization sets the Authorization field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Authorization field is set to the value of the last call. +func (b *PodMetricsEndpointApplyConfiguration) WithAuthorization(value *SafeAuthorizationApplyConfiguration) *PodMetricsEndpointApplyConfiguration { + b.HTTPConfigApplyConfiguration.Authorization = value + return b +} + +// WithBasicAuth sets the BasicAuth field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the BasicAuth field is set to the value of the last call. +func (b *PodMetricsEndpointApplyConfiguration) WithBasicAuth(value *BasicAuthApplyConfiguration) *PodMetricsEndpointApplyConfiguration { + b.HTTPConfigApplyConfiguration.BasicAuth = value + return b +} + +// WithOAuth2 sets the OAuth2 field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the OAuth2 field is set to the value of the last call. +func (b *PodMetricsEndpointApplyConfiguration) WithOAuth2(value *OAuth2ApplyConfiguration) *PodMetricsEndpointApplyConfiguration { + b.HTTPConfigApplyConfiguration.OAuth2 = value + return b +} + +// WithBearerTokenSecret sets the BearerTokenSecret field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the BearerTokenSecret field is set to the value of the last call. +func (b *PodMetricsEndpointApplyConfiguration) WithBearerTokenSecret(value corev1.SecretKeySelector) *PodMetricsEndpointApplyConfiguration { + b.HTTPConfigApplyConfiguration.BearerTokenSecret = &value + return b +} + +// WithTLSConfig sets the TLSConfig field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the TLSConfig field is set to the value of the last call. +func (b *PodMetricsEndpointApplyConfiguration) WithTLSConfig(value *SafeTLSConfigApplyConfiguration) *PodMetricsEndpointApplyConfiguration { + b.HTTPConfigApplyConfiguration.TLSConfig = value + return b +} + // WithProxyURL sets the ProxyURL field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the ProxyURL field is set to the value of the last call. @@ -257,22 +258,14 @@ func (b *PodMetricsEndpointApplyConfiguration) WithProxyConnectHeader(entries ma // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the FollowRedirects field is set to the value of the last call. func (b *PodMetricsEndpointApplyConfiguration) WithFollowRedirects(value bool) *PodMetricsEndpointApplyConfiguration { - b.FollowRedirects = &value - return b -} - -// WithEnableHttp2 sets the EnableHttp2 field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the EnableHttp2 field is set to the value of the last call. -func (b *PodMetricsEndpointApplyConfiguration) WithEnableHttp2(value bool) *PodMetricsEndpointApplyConfiguration { - b.EnableHttp2 = &value + b.HTTPConfigApplyConfiguration.FollowRedirects = &value return b } -// WithFilterRunning sets the FilterRunning field in the declarative configuration to the given value +// WithEnableHTTP2 sets the EnableHTTP2 field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the FilterRunning field is set to the value of the last call. -func (b *PodMetricsEndpointApplyConfiguration) WithFilterRunning(value bool) *PodMetricsEndpointApplyConfiguration { - b.FilterRunning = &value +// If called multiple times, the EnableHTTP2 field is set to the value of the last call. +func (b *PodMetricsEndpointApplyConfiguration) WithEnableHTTP2(value bool) *PodMetricsEndpointApplyConfiguration { + b.HTTPConfigApplyConfiguration.EnableHTTP2 = &value return b } diff --git a/vendor/github.com/prometheus-operator/prometheus-operator/pkg/client/applyconfiguration/monitoring/v1/podmonitor.go b/vendor/github.com/prometheus-operator/prometheus-operator/pkg/client/applyconfiguration/monitoring/v1/podmonitor.go index 3100accb55..883c6a5008 100644 --- a/vendor/github.com/prometheus-operator/prometheus-operator/pkg/client/applyconfiguration/monitoring/v1/podmonitor.go +++ b/vendor/github.com/prometheus-operator/prometheus-operator/pkg/client/applyconfiguration/monitoring/v1/podmonitor.go @@ -27,7 +27,8 @@ import ( type PodMonitorApplyConfiguration struct { metav1.TypeMetaApplyConfiguration `json:",inline"` *metav1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` - Spec *PodMonitorSpecApplyConfiguration `json:"spec,omitempty"` + Spec *PodMonitorSpecApplyConfiguration `json:"spec,omitempty"` + Status *ConfigResourceStatusApplyConfiguration `json:"status,omitempty"` } // PodMonitor constructs a declarative configuration of the PodMonitor type for use with @@ -40,6 +41,7 @@ func PodMonitor(name, namespace string) *PodMonitorApplyConfiguration { b.WithAPIVersion("monitoring.coreos.com/v1") return b } +func (b PodMonitorApplyConfiguration) IsApplyConfiguration() {} // WithKind sets the Kind field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. @@ -207,8 +209,32 @@ func (b *PodMonitorApplyConfiguration) WithSpec(value *PodMonitorSpecApplyConfig return b } +// WithStatus sets the Status field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Status field is set to the value of the last call. +func (b *PodMonitorApplyConfiguration) WithStatus(value *ConfigResourceStatusApplyConfiguration) *PodMonitorApplyConfiguration { + b.Status = value + return b +} + +// GetKind retrieves the value of the Kind field in the declarative configuration. +func (b *PodMonitorApplyConfiguration) GetKind() *string { + return b.TypeMetaApplyConfiguration.Kind +} + +// GetAPIVersion retrieves the value of the APIVersion field in the declarative configuration. +func (b *PodMonitorApplyConfiguration) GetAPIVersion() *string { + return b.TypeMetaApplyConfiguration.APIVersion +} + // GetName retrieves the value of the Name field in the declarative configuration. func (b *PodMonitorApplyConfiguration) GetName() *string { b.ensureObjectMetaApplyConfigurationExists() return b.ObjectMetaApplyConfiguration.Name } + +// GetNamespace retrieves the value of the Namespace field in the declarative configuration. +func (b *PodMonitorApplyConfiguration) GetNamespace() *string { + b.ensureObjectMetaApplyConfigurationExists() + return b.ObjectMetaApplyConfiguration.Namespace +} diff --git a/vendor/github.com/prometheus-operator/prometheus-operator/pkg/client/applyconfiguration/monitoring/v1/probe.go b/vendor/github.com/prometheus-operator/prometheus-operator/pkg/client/applyconfiguration/monitoring/v1/probe.go index ec5b0d2221..4dac5bd42a 100644 --- a/vendor/github.com/prometheus-operator/prometheus-operator/pkg/client/applyconfiguration/monitoring/v1/probe.go +++ b/vendor/github.com/prometheus-operator/prometheus-operator/pkg/client/applyconfiguration/monitoring/v1/probe.go @@ -27,7 +27,8 @@ import ( type ProbeApplyConfiguration struct { metav1.TypeMetaApplyConfiguration `json:",inline"` *metav1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` - Spec *ProbeSpecApplyConfiguration `json:"spec,omitempty"` + Spec *ProbeSpecApplyConfiguration `json:"spec,omitempty"` + Status *ConfigResourceStatusApplyConfiguration `json:"status,omitempty"` } // Probe constructs a declarative configuration of the Probe type for use with @@ -40,6 +41,7 @@ func Probe(name, namespace string) *ProbeApplyConfiguration { b.WithAPIVersion("monitoring.coreos.com/v1") return b } +func (b ProbeApplyConfiguration) IsApplyConfiguration() {} // WithKind sets the Kind field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. @@ -207,8 +209,32 @@ func (b *ProbeApplyConfiguration) WithSpec(value *ProbeSpecApplyConfiguration) * return b } +// WithStatus sets the Status field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Status field is set to the value of the last call. +func (b *ProbeApplyConfiguration) WithStatus(value *ConfigResourceStatusApplyConfiguration) *ProbeApplyConfiguration { + b.Status = value + return b +} + +// GetKind retrieves the value of the Kind field in the declarative configuration. +func (b *ProbeApplyConfiguration) GetKind() *string { + return b.TypeMetaApplyConfiguration.Kind +} + +// GetAPIVersion retrieves the value of the APIVersion field in the declarative configuration. +func (b *ProbeApplyConfiguration) GetAPIVersion() *string { + return b.TypeMetaApplyConfiguration.APIVersion +} + // GetName retrieves the value of the Name field in the declarative configuration. func (b *ProbeApplyConfiguration) GetName() *string { b.ensureObjectMetaApplyConfigurationExists() return b.ObjectMetaApplyConfiguration.Name } + +// GetNamespace retrieves the value of the Namespace field in the declarative configuration. +func (b *ProbeApplyConfiguration) GetNamespace() *string { + b.ensureObjectMetaApplyConfigurationExists() + return b.ObjectMetaApplyConfiguration.Namespace +} diff --git a/vendor/github.com/prometheus-operator/prometheus-operator/pkg/client/applyconfiguration/monitoring/v1/prometheus.go b/vendor/github.com/prometheus-operator/prometheus-operator/pkg/client/applyconfiguration/monitoring/v1/prometheus.go index b953cd9e78..345d3b1946 100644 --- a/vendor/github.com/prometheus-operator/prometheus-operator/pkg/client/applyconfiguration/monitoring/v1/prometheus.go +++ b/vendor/github.com/prometheus-operator/prometheus-operator/pkg/client/applyconfiguration/monitoring/v1/prometheus.go @@ -41,6 +41,7 @@ func Prometheus(name, namespace string) *PrometheusApplyConfiguration { b.WithAPIVersion("monitoring.coreos.com/v1") return b } +func (b PrometheusApplyConfiguration) IsApplyConfiguration() {} // WithKind sets the Kind field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. @@ -216,8 +217,24 @@ func (b *PrometheusApplyConfiguration) WithStatus(value *PrometheusStatusApplyCo return b } +// GetKind retrieves the value of the Kind field in the declarative configuration. +func (b *PrometheusApplyConfiguration) GetKind() *string { + return b.TypeMetaApplyConfiguration.Kind +} + +// GetAPIVersion retrieves the value of the APIVersion field in the declarative configuration. +func (b *PrometheusApplyConfiguration) GetAPIVersion() *string { + return b.TypeMetaApplyConfiguration.APIVersion +} + // GetName retrieves the value of the Name field in the declarative configuration. func (b *PrometheusApplyConfiguration) GetName() *string { b.ensureObjectMetaApplyConfigurationExists() return b.ObjectMetaApplyConfiguration.Name } + +// GetNamespace retrieves the value of the Namespace field in the declarative configuration. +func (b *PrometheusApplyConfiguration) GetNamespace() *string { + b.ensureObjectMetaApplyConfigurationExists() + return b.ObjectMetaApplyConfiguration.Namespace +} diff --git a/vendor/github.com/prometheus-operator/prometheus-operator/pkg/client/applyconfiguration/monitoring/v1/prometheusrule.go b/vendor/github.com/prometheus-operator/prometheus-operator/pkg/client/applyconfiguration/monitoring/v1/prometheusrule.go index 748d5c17b2..74f601c6e8 100644 --- a/vendor/github.com/prometheus-operator/prometheus-operator/pkg/client/applyconfiguration/monitoring/v1/prometheusrule.go +++ b/vendor/github.com/prometheus-operator/prometheus-operator/pkg/client/applyconfiguration/monitoring/v1/prometheusrule.go @@ -27,7 +27,8 @@ import ( type PrometheusRuleApplyConfiguration struct { metav1.TypeMetaApplyConfiguration `json:",inline"` *metav1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` - Spec *PrometheusRuleSpecApplyConfiguration `json:"spec,omitempty"` + Spec *PrometheusRuleSpecApplyConfiguration `json:"spec,omitempty"` + Status *ConfigResourceStatusApplyConfiguration `json:"status,omitempty"` } // PrometheusRule constructs a declarative configuration of the PrometheusRule type for use with @@ -40,6 +41,7 @@ func PrometheusRule(name, namespace string) *PrometheusRuleApplyConfiguration { b.WithAPIVersion("monitoring.coreos.com/v1") return b } +func (b PrometheusRuleApplyConfiguration) IsApplyConfiguration() {} // WithKind sets the Kind field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. @@ -207,8 +209,32 @@ func (b *PrometheusRuleApplyConfiguration) WithSpec(value *PrometheusRuleSpecApp return b } +// WithStatus sets the Status field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Status field is set to the value of the last call. +func (b *PrometheusRuleApplyConfiguration) WithStatus(value *ConfigResourceStatusApplyConfiguration) *PrometheusRuleApplyConfiguration { + b.Status = value + return b +} + +// GetKind retrieves the value of the Kind field in the declarative configuration. +func (b *PrometheusRuleApplyConfiguration) GetKind() *string { + return b.TypeMetaApplyConfiguration.Kind +} + +// GetAPIVersion retrieves the value of the APIVersion field in the declarative configuration. +func (b *PrometheusRuleApplyConfiguration) GetAPIVersion() *string { + return b.TypeMetaApplyConfiguration.APIVersion +} + // GetName retrieves the value of the Name field in the declarative configuration. func (b *PrometheusRuleApplyConfiguration) GetName() *string { b.ensureObjectMetaApplyConfigurationExists() return b.ObjectMetaApplyConfiguration.Name } + +// GetNamespace retrieves the value of the Namespace field in the declarative configuration. +func (b *PrometheusRuleApplyConfiguration) GetNamespace() *string { + b.ensureObjectMetaApplyConfigurationExists() + return b.ObjectMetaApplyConfiguration.Namespace +} diff --git a/vendor/github.com/prometheus-operator/prometheus-operator/pkg/client/applyconfiguration/monitoring/v1/servicemonitor.go b/vendor/github.com/prometheus-operator/prometheus-operator/pkg/client/applyconfiguration/monitoring/v1/servicemonitor.go index 8b01281667..7642e34b97 100644 --- a/vendor/github.com/prometheus-operator/prometheus-operator/pkg/client/applyconfiguration/monitoring/v1/servicemonitor.go +++ b/vendor/github.com/prometheus-operator/prometheus-operator/pkg/client/applyconfiguration/monitoring/v1/servicemonitor.go @@ -41,6 +41,7 @@ func ServiceMonitor(name, namespace string) *ServiceMonitorApplyConfiguration { b.WithAPIVersion("monitoring.coreos.com/v1") return b } +func (b ServiceMonitorApplyConfiguration) IsApplyConfiguration() {} // WithKind sets the Kind field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. @@ -216,8 +217,24 @@ func (b *ServiceMonitorApplyConfiguration) WithStatus(value *ConfigResourceStatu return b } +// GetKind retrieves the value of the Kind field in the declarative configuration. +func (b *ServiceMonitorApplyConfiguration) GetKind() *string { + return b.TypeMetaApplyConfiguration.Kind +} + +// GetAPIVersion retrieves the value of the APIVersion field in the declarative configuration. +func (b *ServiceMonitorApplyConfiguration) GetAPIVersion() *string { + return b.TypeMetaApplyConfiguration.APIVersion +} + // GetName retrieves the value of the Name field in the declarative configuration. func (b *ServiceMonitorApplyConfiguration) GetName() *string { b.ensureObjectMetaApplyConfigurationExists() return b.ObjectMetaApplyConfiguration.Name } + +// GetNamespace retrieves the value of the Namespace field in the declarative configuration. +func (b *ServiceMonitorApplyConfiguration) GetNamespace() *string { + b.ensureObjectMetaApplyConfigurationExists() + return b.ObjectMetaApplyConfiguration.Namespace +} diff --git a/vendor/github.com/prometheus-operator/prometheus-operator/pkg/client/applyconfiguration/monitoring/v1/servicemonitorspec.go b/vendor/github.com/prometheus-operator/prometheus-operator/pkg/client/applyconfiguration/monitoring/v1/servicemonitorspec.go index 3fd107a29e..2800a7e050 100644 --- a/vendor/github.com/prometheus-operator/prometheus-operator/pkg/client/applyconfiguration/monitoring/v1/servicemonitorspec.go +++ b/vendor/github.com/prometheus-operator/prometheus-operator/pkg/client/applyconfiguration/monitoring/v1/servicemonitorspec.go @@ -40,10 +40,11 @@ type ServiceMonitorSpecApplyConfiguration struct { LabelNameLengthLimit *uint64 `json:"labelNameLengthLimit,omitempty"` LabelValueLengthLimit *uint64 `json:"labelValueLengthLimit,omitempty"` NativeHistogramConfigApplyConfiguration `json:",inline"` - KeepDroppedTargets *uint64 `json:"keepDroppedTargets,omitempty"` - AttachMetadata *AttachMetadataApplyConfiguration `json:"attachMetadata,omitempty"` - ScrapeClassName *string `json:"scrapeClass,omitempty"` - BodySizeLimit *monitoringv1.ByteSize `json:"bodySizeLimit,omitempty"` + KeepDroppedTargets *uint64 `json:"keepDroppedTargets,omitempty"` + AttachMetadata *AttachMetadataApplyConfiguration `json:"attachMetadata,omitempty"` + ScrapeClassName *string `json:"scrapeClass,omitempty"` + BodySizeLimit *monitoringv1.ByteSize `json:"bodySizeLimit,omitempty"` + ServiceDiscoveryRole *monitoringv1.ServiceDiscoveryRole `json:"serviceDiscoveryRole,omitempty"` } // ServiceMonitorSpecApplyConfiguration constructs a declarative configuration of the ServiceMonitorSpec type for use with @@ -238,3 +239,11 @@ func (b *ServiceMonitorSpecApplyConfiguration) WithBodySizeLimit(value monitorin b.BodySizeLimit = &value return b } + +// WithServiceDiscoveryRole sets the ServiceDiscoveryRole field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the ServiceDiscoveryRole field is set to the value of the last call. +func (b *ServiceMonitorSpecApplyConfiguration) WithServiceDiscoveryRole(value monitoringv1.ServiceDiscoveryRole) *ServiceMonitorSpecApplyConfiguration { + b.ServiceDiscoveryRole = &value + return b +} diff --git a/vendor/github.com/prometheus-operator/prometheus-operator/pkg/client/applyconfiguration/monitoring/v1/sigv4.go b/vendor/github.com/prometheus-operator/prometheus-operator/pkg/client/applyconfiguration/monitoring/v1/sigv4.go index d738fe2e67..3a053c5323 100644 --- a/vendor/github.com/prometheus-operator/prometheus-operator/pkg/client/applyconfiguration/monitoring/v1/sigv4.go +++ b/vendor/github.com/prometheus-operator/prometheus-operator/pkg/client/applyconfiguration/monitoring/v1/sigv4.go @@ -23,11 +23,12 @@ import ( // Sigv4ApplyConfiguration represents a declarative configuration of the Sigv4 type for use // with apply. type Sigv4ApplyConfiguration struct { - Region *string `json:"region,omitempty"` - AccessKey *corev1.SecretKeySelector `json:"accessKey,omitempty"` - SecretKey *corev1.SecretKeySelector `json:"secretKey,omitempty"` - Profile *string `json:"profile,omitempty"` - RoleArn *string `json:"roleArn,omitempty"` + Region *string `json:"region,omitempty"` + AccessKey *corev1.SecretKeySelector `json:"accessKey,omitempty"` + SecretKey *corev1.SecretKeySelector `json:"secretKey,omitempty"` + Profile *string `json:"profile,omitempty"` + RoleArn *string `json:"roleArn,omitempty"` + UseFIPSSTSEndpoint *bool `json:"useFIPSSTSEndpoint,omitempty"` } // Sigv4ApplyConfiguration constructs a declarative configuration of the Sigv4 type for use with @@ -75,3 +76,11 @@ func (b *Sigv4ApplyConfiguration) WithRoleArn(value string) *Sigv4ApplyConfigura b.RoleArn = &value return b } + +// WithUseFIPSSTSEndpoint sets the UseFIPSSTSEndpoint field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the UseFIPSSTSEndpoint field is set to the value of the last call. +func (b *Sigv4ApplyConfiguration) WithUseFIPSSTSEndpoint(value bool) *Sigv4ApplyConfiguration { + b.UseFIPSSTSEndpoint = &value + return b +} diff --git a/vendor/github.com/prometheus-operator/prometheus-operator/pkg/client/applyconfiguration/monitoring/v1/thanosruler.go b/vendor/github.com/prometheus-operator/prometheus-operator/pkg/client/applyconfiguration/monitoring/v1/thanosruler.go index 6acb8453ec..97320820dd 100644 --- a/vendor/github.com/prometheus-operator/prometheus-operator/pkg/client/applyconfiguration/monitoring/v1/thanosruler.go +++ b/vendor/github.com/prometheus-operator/prometheus-operator/pkg/client/applyconfiguration/monitoring/v1/thanosruler.go @@ -41,6 +41,7 @@ func ThanosRuler(name, namespace string) *ThanosRulerApplyConfiguration { b.WithAPIVersion("monitoring.coreos.com/v1") return b } +func (b ThanosRulerApplyConfiguration) IsApplyConfiguration() {} // WithKind sets the Kind field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. @@ -216,8 +217,24 @@ func (b *ThanosRulerApplyConfiguration) WithStatus(value *ThanosRulerStatusApply return b } +// GetKind retrieves the value of the Kind field in the declarative configuration. +func (b *ThanosRulerApplyConfiguration) GetKind() *string { + return b.TypeMetaApplyConfiguration.Kind +} + +// GetAPIVersion retrieves the value of the APIVersion field in the declarative configuration. +func (b *ThanosRulerApplyConfiguration) GetAPIVersion() *string { + return b.TypeMetaApplyConfiguration.APIVersion +} + // GetName retrieves the value of the Name field in the declarative configuration. func (b *ThanosRulerApplyConfiguration) GetName() *string { b.ensureObjectMetaApplyConfigurationExists() return b.ObjectMetaApplyConfiguration.Name } + +// GetNamespace retrieves the value of the Namespace field in the declarative configuration. +func (b *ThanosRulerApplyConfiguration) GetNamespace() *string { + b.ensureObjectMetaApplyConfigurationExists() + return b.ObjectMetaApplyConfiguration.Namespace +} diff --git a/vendor/github.com/prometheus-operator/prometheus-operator/pkg/client/versioned/typed/monitoring/v1/podmonitor.go b/vendor/github.com/prometheus-operator/prometheus-operator/pkg/client/versioned/typed/monitoring/v1/podmonitor.go index eb24fbf9ed..83e71948cf 100644 --- a/vendor/github.com/prometheus-operator/prometheus-operator/pkg/client/versioned/typed/monitoring/v1/podmonitor.go +++ b/vendor/github.com/prometheus-operator/prometheus-operator/pkg/client/versioned/typed/monitoring/v1/podmonitor.go @@ -38,6 +38,8 @@ type PodMonitorsGetter interface { type PodMonitorInterface interface { Create(ctx context.Context, podMonitor *monitoringv1.PodMonitor, opts metav1.CreateOptions) (*monitoringv1.PodMonitor, error) Update(ctx context.Context, podMonitor *monitoringv1.PodMonitor, opts metav1.UpdateOptions) (*monitoringv1.PodMonitor, error) + // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). + UpdateStatus(ctx context.Context, podMonitor *monitoringv1.PodMonitor, opts metav1.UpdateOptions) (*monitoringv1.PodMonitor, error) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error Get(ctx context.Context, name string, opts metav1.GetOptions) (*monitoringv1.PodMonitor, error) @@ -45,6 +47,8 @@ type PodMonitorInterface interface { Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *monitoringv1.PodMonitor, err error) Apply(ctx context.Context, podMonitor *applyconfigurationmonitoringv1.PodMonitorApplyConfiguration, opts metav1.ApplyOptions) (result *monitoringv1.PodMonitor, err error) + // Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). + ApplyStatus(ctx context.Context, podMonitor *applyconfigurationmonitoringv1.PodMonitorApplyConfiguration, opts metav1.ApplyOptions) (result *monitoringv1.PodMonitor, err error) PodMonitorExpansion } diff --git a/vendor/github.com/prometheus-operator/prometheus-operator/pkg/client/versioned/typed/monitoring/v1/probe.go b/vendor/github.com/prometheus-operator/prometheus-operator/pkg/client/versioned/typed/monitoring/v1/probe.go index ee29b0cba5..00b3140df5 100644 --- a/vendor/github.com/prometheus-operator/prometheus-operator/pkg/client/versioned/typed/monitoring/v1/probe.go +++ b/vendor/github.com/prometheus-operator/prometheus-operator/pkg/client/versioned/typed/monitoring/v1/probe.go @@ -38,6 +38,8 @@ type ProbesGetter interface { type ProbeInterface interface { Create(ctx context.Context, probe *monitoringv1.Probe, opts metav1.CreateOptions) (*monitoringv1.Probe, error) Update(ctx context.Context, probe *monitoringv1.Probe, opts metav1.UpdateOptions) (*monitoringv1.Probe, error) + // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). + UpdateStatus(ctx context.Context, probe *monitoringv1.Probe, opts metav1.UpdateOptions) (*monitoringv1.Probe, error) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error Get(ctx context.Context, name string, opts metav1.GetOptions) (*monitoringv1.Probe, error) @@ -45,6 +47,8 @@ type ProbeInterface interface { Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *monitoringv1.Probe, err error) Apply(ctx context.Context, probe *applyconfigurationmonitoringv1.ProbeApplyConfiguration, opts metav1.ApplyOptions) (result *monitoringv1.Probe, err error) + // Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). + ApplyStatus(ctx context.Context, probe *applyconfigurationmonitoringv1.ProbeApplyConfiguration, opts metav1.ApplyOptions) (result *monitoringv1.Probe, err error) ProbeExpansion } diff --git a/vendor/github.com/prometheus-operator/prometheus-operator/pkg/client/versioned/typed/monitoring/v1/prometheusrule.go b/vendor/github.com/prometheus-operator/prometheus-operator/pkg/client/versioned/typed/monitoring/v1/prometheusrule.go index 81c3e0800a..7e9560803b 100644 --- a/vendor/github.com/prometheus-operator/prometheus-operator/pkg/client/versioned/typed/monitoring/v1/prometheusrule.go +++ b/vendor/github.com/prometheus-operator/prometheus-operator/pkg/client/versioned/typed/monitoring/v1/prometheusrule.go @@ -38,6 +38,8 @@ type PrometheusRulesGetter interface { type PrometheusRuleInterface interface { Create(ctx context.Context, prometheusRule *monitoringv1.PrometheusRule, opts metav1.CreateOptions) (*monitoringv1.PrometheusRule, error) Update(ctx context.Context, prometheusRule *monitoringv1.PrometheusRule, opts metav1.UpdateOptions) (*monitoringv1.PrometheusRule, error) + // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). + UpdateStatus(ctx context.Context, prometheusRule *monitoringv1.PrometheusRule, opts metav1.UpdateOptions) (*monitoringv1.PrometheusRule, error) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error Get(ctx context.Context, name string, opts metav1.GetOptions) (*monitoringv1.PrometheusRule, error) @@ -45,6 +47,8 @@ type PrometheusRuleInterface interface { Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *monitoringv1.PrometheusRule, err error) Apply(ctx context.Context, prometheusRule *applyconfigurationmonitoringv1.PrometheusRuleApplyConfiguration, opts metav1.ApplyOptions) (result *monitoringv1.PrometheusRule, err error) + // Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). + ApplyStatus(ctx context.Context, prometheusRule *applyconfigurationmonitoringv1.PrometheusRuleApplyConfiguration, opts metav1.ApplyOptions) (result *monitoringv1.PrometheusRule, err error) PrometheusRuleExpansion } diff --git a/vendor/modules.txt b/vendor/modules.txt index 66e0a299e8..323e7b3a05 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -415,13 +415,13 @@ github.com/pkg/sftp/internal/encoding/ssh/filexfer/openssh # github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 ## explicit github.com/pmezard/go-difflib/difflib -# github.com/prometheus-operator/prometheus-operator/pkg/apis/monitoring v0.85.0 +# github.com/prometheus-operator/prometheus-operator/pkg/apis/monitoring v0.86.2 ## explicit; go 1.24.0 github.com/prometheus-operator/prometheus-operator/pkg/apis/monitoring github.com/prometheus-operator/prometheus-operator/pkg/apis/monitoring/v1 github.com/prometheus-operator/prometheus-operator/pkg/apis/monitoring/v1alpha1 github.com/prometheus-operator/prometheus-operator/pkg/apis/monitoring/v1beta1 -# github.com/prometheus-operator/prometheus-operator/pkg/client v0.85.0 +# github.com/prometheus-operator/prometheus-operator/pkg/client v0.86.2 ## explicit; go 1.24.0 github.com/prometheus-operator/prometheus-operator/pkg/client/applyconfiguration/monitoring/v1 github.com/prometheus-operator/prometheus-operator/pkg/client/versioned/scheme