v1

package
v0.86.2-rhobs1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 14, 2025 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Overview

Copyright 2024 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.

Index

Constants

View Source
const (
	AlertmanagersKind   = "Alertmanager"
	AlertmanagerName    = "alertmanagers"
	AlertManagerKindKey = "alertmanager"
)
View Source
const (
	PodMonitorsKind   = "PodMonitor"
	PodMonitorName    = "podmonitors"
	PodMonitorKindKey = "podmonitor"
)
View Source
const (
	ProbesKind   = "Probe"
	ProbeName    = "probes"
	ProbeKindKey = "probe"
)
View Source
const (
	PrometheusesKind  = "Prometheus"
	PrometheusName    = "prometheuses"
	PrometheusKindKey = "prometheus"
)
View Source
const (
	// Remote Write message's version 1.0.
	RemoteWriteMessageVersion1_0 = RemoteWriteMessageVersion("V1.0")
	// Remote Write message's version 2.0.
	RemoteWriteMessageVersion2_0 = RemoteWriteMessageVersion("V2.0")
)
View Source
const (
	AlertmanagerAPIVersion1 = AlertmanagerAPIVersion("V1")
	AlertmanagerAPIVersion2 = AlertmanagerAPIVersion("V2")
)
View Source
const (
	PrometheusRuleKind    = "PrometheusRule"
	PrometheusRuleName    = "prometheusrules"
	PrometheusRuleKindKey = "prometheusrule"
)
View Source
const (
	ServiceMonitorsKind   = "ServiceMonitor"
	ServiceMonitorName    = "servicemonitors"
	ServiceMonitorKindKey = "servicemonitor"
)
View Source
const (
	ThanosRulerKind    = "ThanosRuler"
	ThanosRulerName    = "thanosrulers"
	ThanosRulerKindKey = "thanosrulers"
)
View Source
const (
	RoleNode          = "node"
	RolePod           = "pod"
	RoleService       = "service"
	RoleEndpoint      = "endpoints"
	RoleEndpointSlice = "endpointslice"
	RoleIngress       = "ingress"
)

The valid options for Role.

View Source
const (
	Version = "v1"
)

Variables

View Source
var (
	// localSchemeBuilder and AddToScheme will stay in k8s.io/kubernetes.
	SchemeBuilder runtime.SchemeBuilder

	AddToScheme = localSchemeBuilder.AddToScheme
)
View Source
var SchemeGroupVersion = schema.GroupVersion{Group: monitoring.GroupName, Version: Version}

SchemeGroupVersion is the group version used to register these objects

Functions

func Resource

func Resource(resource string) schema.GroupResource

Resource takes an unqualified resource and returns a Group qualified GroupResource

Types

type APIServerConfig

type APIServerConfig struct {
	// 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.
	//
	// Cannot be set at the same time as `authorization`, `bearerToken`, or
	// `bearerTokenFile`.
	//
	// +optional
	BasicAuth *BasicAuth `json:"basicAuth,omitempty"`

	// 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"`

	// tlsConfig to use for the API server.
	//
	// +optional
	TLSConfig *TLSConfig `json:"tlsConfig,omitempty"`

	// authorization section for the API server.
	//
	// Cannot be set at the same time as `basicAuth`, `bearerToken`, or
	// `bearerTokenFile`.
	//
	// +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`.*
	//
	// +optional
	BearerToken string `json:"bearerToken,omitempty"`

	// Optional ProxyConfig.
	// +optional
	ProxyConfig `json:",inline"`
}

APIServerConfig defines how the Prometheus server connects to the Kubernetes API server.

More info: https://prometheus.io/docs/prometheus/latest/configuration/configuration/#kubernetes_sd_config

+k8s:openapi-gen=true

func (*APIServerConfig) DeepCopy

func (in *APIServerConfig) DeepCopy() *APIServerConfig

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new APIServerConfig.

func (*APIServerConfig) DeepCopyInto

func (in *APIServerConfig) DeepCopyInto(out *APIServerConfig)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type AdditionalLabelSelectors

type AdditionalLabelSelectors string

+kubebuilder:validation:Enum=OnResource;OnShard

const (
	// Automatically add a label selector that will select all pods matching the same Prometheus/PrometheusAgent resource (irrespective of their shards).
	ResourceNameLabelSelector AdditionalLabelSelectors = "OnResource"

	// Automatically add a label selector that will select all pods matching the same shard.
	ShardAndResourceNameLabelSelector AdditionalLabelSelectors = "OnShard"
)

type AlertingSpec

type AlertingSpec struct {
	// alertmanagers endpoints where Prometheus should send alerts to.
	// +required
	Alertmanagers []AlertmanagerEndpoints `json:"alertmanagers"`
}

AlertingSpec defines parameters for alerting configuration of Prometheus servers. +k8s:openapi-gen=true

func (*AlertingSpec) DeepCopy

func (in *AlertingSpec) DeepCopy() *AlertingSpec

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AlertingSpec.

func (*AlertingSpec) DeepCopyInto

func (in *AlertingSpec) DeepCopyInto(out *AlertingSpec)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type Alertmanager

type Alertmanager struct {
	// 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"`
	// 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"`
	// 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"`
}

The `Alertmanager` custom resource definition (CRD) defines a desired Alertmanager(https://prometheus.io/docs/alerting) setup to run in a Kubernetes cluster. It allows to specify many options such as the number of replicas, persistent storage and many more.

For each `Alertmanager` resource, the Operator deploys a `StatefulSet` in the same namespace. When there are two or more configured replicas, the Operator runs the Alertmanager instances in high-availability mode.

The resource defines via label and namespace selectors which `AlertmanagerConfig` objects should be associated to the deployed Alertmanager instances.

func (*Alertmanager) DeepCopy

func (in *Alertmanager) DeepCopy() *Alertmanager

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Alertmanager.

func (*Alertmanager) DeepCopyInto

func (in *Alertmanager) DeepCopyInto(out *Alertmanager)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*Alertmanager) DeepCopyObject

func (l *Alertmanager) DeepCopyObject() runtime.Object

DeepCopyObject implements the runtime.Object interface.

func (*Alertmanager) ExpectedReplicas

func (a *Alertmanager) ExpectedReplicas() int

func (*Alertmanager) SetAvailableReplicas

func (a *Alertmanager) SetAvailableReplicas(i int)

func (*Alertmanager) SetReplicas

func (a *Alertmanager) SetReplicas(i int)

func (*Alertmanager) SetUnavailableReplicas

func (a *Alertmanager) SetUnavailableReplicas(i int)

func (*Alertmanager) SetUpdatedReplicas

func (a *Alertmanager) SetUpdatedReplicas(i int)

type AlertmanagerAPIVersion

type AlertmanagerAPIVersion string

+kubebuilder:validation:Enum=v1;V1;v2;V2

type AlertmanagerConfigMatcherStrategy

type AlertmanagerConfigMatcherStrategy struct {
	// type defines the strategy used by
	// AlertmanagerConfig objects to match alerts in the routes and inhibition
	// rules.
	//
	// The default value is `OnNamespace`.
	//
	// +kubebuilder:validation:Enum="OnNamespace";"OnNamespaceExceptForAlertmanagerNamespace";"None"
	// +kubebuilder:default:="OnNamespace"
	// +optional
	Type AlertmanagerConfigMatcherStrategyType `json:"type,omitempty"`
}

func (*AlertmanagerConfigMatcherStrategy) DeepCopy

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AlertmanagerConfigMatcherStrategy.

func (*AlertmanagerConfigMatcherStrategy) DeepCopyInto

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type AlertmanagerConfigMatcherStrategyType

type AlertmanagerConfigMatcherStrategyType string
const (
	// With `OnNamespace`, the route and inhibition rules of an
	// AlertmanagerConfig object only process alerts that have a `namespace`
	// label equal to the namespace of the object.
	OnNamespaceConfigMatcherStrategyType AlertmanagerConfigMatcherStrategyType = "OnNamespace"

	// With `OnNamespaceExceptForAlertmanagerNamespace`, the route and inhibition rules of an
	// AlertmanagerConfig object only process alerts that have a `namespace`
	// label equal to the namespace of the object, unless the AlertmanagerConfig object
	// is in the same namespace as the Alertmanager object, where it will process all alerts.
	OnNamespaceExceptForAlertmanagerNamespaceConfigMatcherStrategyType AlertmanagerConfigMatcherStrategyType = "OnNamespaceExceptForAlertmanagerNamespace"

	// With `None`, the route and inhibition rules of an AlertmanagerConfig
	// object process all incoming alerts.
	NoneConfigMatcherStrategyType AlertmanagerConfigMatcherStrategyType = "None"
)

type AlertmanagerConfiguration

type AlertmanagerConfiguration struct {
	// 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"`
	// global defines the global parameters of the Alertmanager configuration.
	// +optional
	Global *AlertmanagerGlobalConfig `json:"global,omitempty"`
	// templates defines the custom notification templates.
	// +optional
	Templates []SecretOrConfigMap `json:"templates,omitempty"`
}

AlertmanagerConfiguration defines the Alertmanager configuration. +k8s:openapi-gen=true

func (*AlertmanagerConfiguration) DeepCopy

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AlertmanagerConfiguration.

func (*AlertmanagerConfiguration) DeepCopyInto

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type AlertmanagerEndpoints

type AlertmanagerEndpoints struct {
	// namespace of the Endpoints object.
	//
	// If not set, the object will be discovered in the namespace of the
	// Prometheus object.
	//
	// +kubebuilder:validation:MinLength:=1
	// +optional
	Namespace *string `json:"namespace,omitempty"`

	// 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.
	// +required
	Port intstr.IntOrString `json:"port"`

	// scheme to use when firing alerts.
	// +optional
	Scheme string `json:"scheme,omitempty"`

	// pathPrefix defines the prefix for the HTTP path alerts are pushed to.
	// +optional
	PathPrefix string `json:"pathPrefix,omitempty"`

	// tlsConfig to use for Alertmanager.
	//
	// +optional
	TLSConfig *TLSConfig `json:"tlsConfig,omitempty"`

	// basicAuth configuration for Alertmanager.
	//
	// Cannot be set at the same time as `bearerTokenFile`, `authorization` or `sigv4`.
	//
	// +optional
	BasicAuth *BasicAuth `json:"basicAuth,omitempty"`

	// 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.
	//
	// Cannot be set at the same time as `basicAuth`, `bearerTokenFile` or `sigv4`.
	//
	// +optional
	Authorization *SafeAuthorization `json:"authorization,omitempty"`

	// sigv4 defines AWS's Signature Verification 4 for the URL.
	//
	// It requires Prometheus >= v2.48.0.
	//
	// Cannot be set at the same time as `basicAuth`, `bearerTokenFile` or `authorization`.
	//
	// +optional
	Sigv4 *Sigv4 `json:"sigv4,omitempty"`

	// ProxyConfig
	// +optional
	ProxyConfig `json:",inline"`

	// 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 defines a per-target Alertmanager timeout when pushing alerts.
	//
	// +optional
	Timeout *Duration `json:"timeout,omitempty"`

	// enableHttp2 defines whether to enable HTTP2.
	//
	// +optional
	EnableHttp2 *bool `json:"enableHttp2,omitempty"`

	// relabelings defines the relabel configuration applied to the discovered Alertmanagers.
	//
	// +optional
	RelabelConfigs []RelabelConfig `json:"relabelings,omitempty"`

	// alertRelabelings defines the relabeling configs applied before sending alerts to a specific Alertmanager.
	// It requires Prometheus >= v2.51.0.
	//
	// +optional
	AlertRelabelConfigs []RelabelConfig `json:"alertRelabelings,omitempty"`
}

AlertmanagerEndpoints defines a selection of a single Endpoints object containing Alertmanager IPs to fire alerts against. +k8s:openapi-gen=true

func (*AlertmanagerEndpoints) DeepCopy

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AlertmanagerEndpoints.

func (*AlertmanagerEndpoints) DeepCopyInto

func (in *AlertmanagerEndpoints) DeepCopyInto(out *AlertmanagerEndpoints)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type AlertmanagerGlobalConfig

type AlertmanagerGlobalConfig struct {
	// smtp defines global SMTP parameters.
	// +optional
	SMTPConfig *GlobalSMTPConfig `json:"smtp,omitempty"`

	// 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"`

	// httpConfig defines the default HTTP configuration.
	// +optional
	HTTPConfig *HTTPConfig `json:"httpConfig,omitempty"`

	// slackApiUrl defines the default Slack API URL.
	// +optional
	SlackAPIURL *v1.SecretKeySelector `json:"slackApiUrl,omitempty"`

	// opsGenieApiUrl defines the default OpsGenie API URL.
	// +optional
	OpsGenieAPIURL *v1.SecretKeySelector `json:"opsGenieApiUrl,omitempty"`

	// opsGenieApiKey defines the default OpsGenie API Key.
	// +optional
	OpsGenieAPIKey *v1.SecretKeySelector `json:"opsGenieApiKey,omitempty"`

	// pagerdutyUrl defines the default Pagerduty URL.
	// +optional
	PagerdutyURL *URL `json:"pagerdutyUrl,omitempty"`

	// telegram defines the default Telegram config
	// +optional
	TelegramConfig *GlobalTelegramConfig `json:"telegram,omitempty"`

	// jira defines the default configuration for Jira.
	// +optional
	JiraConfig *GlobalJiraConfig `json:"jira,omitempty"`

	// victorops defines the default configuration for VictorOps.
	// +optional
	VictorOpsConfig *GlobalVictorOpsConfig `json:"victorops,omitempty"`

	// rocketChat defines the default configuration for Rocket Chat.
	// +optional
	RocketChatConfig *GlobalRocketChatConfig `json:"rocketChat,omitempty"`

	// webex defines the default configuration for Jira.
	// +optional
	WebexConfig *GlobalWebexConfig `json:"webex,omitempty"`

	// wechat defines the default WeChat Config
	// +optional
	WeChatConfig *GlobalWeChatConfig `json:"wechat,omitempty"`
}

AlertmanagerGlobalConfig configures parameters that are valid in all other configuration contexts. See https://prometheus.io/docs/alerting/latest/configuration/#configuration-file

func (*AlertmanagerGlobalConfig) DeepCopy

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AlertmanagerGlobalConfig.

func (*AlertmanagerGlobalConfig) DeepCopyInto

func (in *AlertmanagerGlobalConfig) DeepCopyInto(out *AlertmanagerGlobalConfig)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type AlertmanagerLimitsSpec

type AlertmanagerLimitsSpec struct {
	// 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"`
	// 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.
	//
	// +optional
	MaxPerSilenceBytes *ByteSize `json:"maxPerSilenceBytes,omitempty"`
}

AlertmanagerLimitsSpec defines the limits command line flags when starting Alertmanager. +k8s:openapi-gen=true

func (*AlertmanagerLimitsSpec) DeepCopy

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AlertmanagerLimitsSpec.

func (*AlertmanagerLimitsSpec) DeepCopyInto

func (in *AlertmanagerLimitsSpec) DeepCopyInto(out *AlertmanagerLimitsSpec)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type AlertmanagerList

type AlertmanagerList struct {
	// TypeMeta defines the versioned schema of this representation of an object.
	metav1.TypeMeta `json:",inline"`
	// metadata defines ListMeta as metadata for collection responses.
	metav1.ListMeta `json:"metadata,omitempty"`
	// List of Alertmanagers
	Items []Alertmanager `json:"items"`
}

AlertmanagerList is a list of Alertmanagers. +k8s:openapi-gen=true

func (*AlertmanagerList) DeepCopy

func (in *AlertmanagerList) DeepCopy() *AlertmanagerList

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AlertmanagerList.

func (*AlertmanagerList) DeepCopyInto

func (in *AlertmanagerList) DeepCopyInto(out *AlertmanagerList)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*AlertmanagerList) DeepCopyObject

func (l *AlertmanagerList) DeepCopyObject() runtime.Object

DeepCopyObject implements the runtime.Object interface.

type AlertmanagerSpec

type AlertmanagerSpec struct {
	// 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.
	// * "app.kubernetes.io/instance" label, set to the name of the Alertmanager instance.
	// * "app.kubernetes.io/managed-by" label, set to "prometheus-operator".
	// * "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
	// 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"`
	// 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.
	// +optional
	Version string `json:"version,omitempty"`
	// 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`.
	// 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"`
	// baseImage that is used to deploy pods, without tag.
	// Deprecated: use 'image' instead.
	// +optional
	BaseImage string `json:"baseImage,omitempty"`
	// 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
	// object, which shall be mounted into the Alertmanager Pods.
	// Each Secret is added to the StatefulSet definition as a volume named `secret-<secret-name>`.
	// The Secrets are mounted into `/etc/alertmanager/secrets/<secret-name>` in the 'alertmanager' container.
	// +optional
	Secrets []string `json:"secrets,omitempty"`
	// 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-<configmap-name>`.
	// The ConfigMaps are mounted into `/etc/alertmanager/configmaps/<configmap-name>` in the 'alertmanager' container.
	// +optional
	ConfigMaps []string `json:"configMaps,omitempty"`
	// 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-<alertmanager-name>`.
	//
	// The Alertmanager configuration should be available under the
	// `alertmanager.yaml` key. Additional keys from the original secret are
	// copied to the generated secret and mounted into the
	// `/etc/alertmanager/config` directory in the `alertmanager` container.
	//
	// 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"`
	// logLevel for Alertmanager to be configured with.
	// +kubebuilder:validation:Enum="";debug;info;warn;error
	// +optional
	LogLevel string `json:"logLevel,omitempty"`
	// logFormat for Alertmanager to be configured with.
	// +kubebuilder:validation:Enum="";logfmt;json
	// +optional
	LogFormat string `json:"logFormat,omitempty"`
	// 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"`
	// 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 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 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 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"`
	// 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"`
	// 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"`
	// 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"`
	// 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"`
	// nodeSelector defines which Nodes the Pods are scheduled on.
	// +optional
	NodeSelector map[string]string `json:"nodeSelector,omitempty"`
	// resources defines the resource requests and limits of the Pods.
	// +optional
	Resources v1.ResourceRequirements `json:"resources,omitempty"`
	// affinity defines the pod's scheduling constraints.
	// +optional
	Affinity *v1.Affinity `json:"affinity,omitempty"`
	// tolerations defines the pod's tolerations.
	// +optional
	Tolerations []v1.Toleration `json:"tolerations,omitempty"`
	// 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.
	// This defaults to the default PodSecurityContext.
	// +optional
	SecurityContext *v1.PodSecurityContext `json:"securityContext,omitempty"`
	// dnsPolicy defines the DNS policy for the pods.
	//
	// +optional
	DNSPolicy *DNSPolicy `json:"dnsPolicy,omitempty"`
	// dnsConfig defines the DNS configuration for the pods.
	//
	// +optional
	DNSConfig *PodDNSConfig `json:"dnsConfig,omitempty"`
	// enableServiceLinks defines whether information about services should be injected into pod's environment variables
	// +optional
	EnableServiceLinks *bool `json:"enableServiceLinks,omitempty"`
	// 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 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
	// Prometheus Pods.
	// +optional
	ServiceAccountName string `json:"serviceAccountName,omitempty"`
	// 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
	// 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
	// patch. The current container names are: `alertmanager` and
	// `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.
	// 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
	// generated init containers if they share the same name and modifications are
	// done via a strategic merge patch. The current init container name is:
	// `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"`
	// 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.
	// +optional
	AdditionalPeers []string `json:"additionalPeers,omitempty"`
	// 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"`
	// clusterGossipInterval defines the interval between gossip attempts.
	// +optional
	ClusterGossipInterval GoDuration `json:"clusterGossipInterval,omitempty"`
	// 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"`
	// clusterPushpullInterval defines the interval between pushpull attempts.
	// +optional
	ClusterPushpullInterval GoDuration `json:"clusterPushpullInterval,omitempty"`
	// clusterPeerTimeout defines the timeout for cluster peering.
	// +optional
	ClusterPeerTimeout GoDuration `json:"clusterPeerTimeout,omitempty"`
	// 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.
	// Use case is e.g. spanning an Alertmanager cluster across Kubernetes clusters with a single replica in each.
	// +optional
	ForceEnableClusterMode bool `json:"forceEnableClusterMode,omitempty"`
	// alertmanagerConfigSelector defines the selector to be used for to merge and configure Alertmanager with.
	// +optional
	AlertmanagerConfigSelector *metav1.LabelSelector `json:"alertmanagerConfigSelector,omitempty"`
	// 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
	// process incoming alerts.
	// +optional
	AlertmanagerConfigMatcherStrategy AlertmanagerConfigMatcherStrategy `json:"alertmanagerConfigMatcherStrategy,omitempty"`

	// 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.
	//
	// +kubebuilder:validation:Minimum:=0
	// +optional
	MinReadySeconds *int32 `json:"minReadySeconds,omitempty"`
	// hostAliases Pods configuration
	// +listType=map
	// +listMapKey=ip
	// +optional
	HostAliases []HostAlias `json:"hostAliases,omitempty"`
	// web defines the web command line flags when starting Alertmanager.
	// +optional
	Web *AlertmanagerWebSpec `json:"web,omitempty"`
	// limits defines the limits command line flags when starting Alertmanager.
	// +optional
	Limits *AlertmanagerLimitsSpec `json:"limits,omitempty"`
	// clusterTLS defines the mutual TLS configuration for the Alertmanager cluster's gossip protocol.
	//
	// It requires Alertmanager >= 0.24.0.
	// +optional
	ClusterTLS *ClusterTLSConfig `json:"clusterTLS,omitempty"`
	// 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
	AlertmanagerConfiguration *AlertmanagerConfiguration `json:"alertmanagerConfiguration,omitempty"`
	// 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"`
	// 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.
	//
	// It requires Alertmanager >= 0.27.0.
	// +optional
	EnableFeatures []string `json:"enableFeatures,omitempty"`
	// 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
	// by the given Alertmanager version.
	// +optional
	AdditionalArgs []Argument `json:"additionalArgs,omitempty"`

	// 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.
	//
	// Defaults to 120 seconds.
	//
	// +kubebuilder:validation:Minimum:=0
	// +optional
	TerminationGracePeriodSeconds *int64 `json:"terminationGracePeriodSeconds,omitempty"`

	// hostUsers supports the user space in Kubernetes.
	//
	// More info: https://kubernetes.io/docs/tasks/configure-pod-container/user-namespaces/
	//
	//
	// The feature requires at least Kubernetes 1.28 with the `UserNamespacesSupport` feature gate enabled.
	// Starting Kubernetes 1.33, the feature is enabled by default.
	//
	// +optional
	HostUsers *bool `json:"hostUsers,omitempty"`
}

AlertmanagerSpec is a 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 +k8s:openapi-gen=true

func (*AlertmanagerSpec) DeepCopy

func (in *AlertmanagerSpec) DeepCopy() *AlertmanagerSpec

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AlertmanagerSpec.

func (*AlertmanagerSpec) DeepCopyInto

func (in *AlertmanagerSpec) DeepCopyInto(out *AlertmanagerSpec)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type AlertmanagerStatus

type AlertmanagerStatus struct {
	// paused defines whether any actions on the underlying managed objects are
	// being performed. Only delete actions will be performed.
	// +optional
	Paused bool `json:"paused"`
	// replicas defines the total number of non-terminated pods targeted by this Alertmanager
	// object (their labels match the selector).
	// +optional
	Replicas int32 `json:"replicas"`
	// 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"`
	// availableReplicas defines the total number of available pods (ready for at least minReadySeconds)
	// targeted by this Alertmanager cluster.
	// +optional
	AvailableReplicas int32 `json:"availableReplicas"`
	// unavailableReplicas defines the total number of unavailable pods targeted by this Alertmanager object.
	// +optional
	UnavailableReplicas int32 `json:"unavailableReplicas"`
	// selector used to match the pods targeted by this Alertmanager object.
	// +optional
	Selector string `json:"selector,omitempty"`
	// conditions defines the current state of the Alertmanager object.
	// +listType=map
	// +listMapKey=type
	// +optional
	Conditions []Condition `json:"conditions,omitempty"`
}

AlertmanagerStatus is 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 +k8s:openapi-gen=true

func (*AlertmanagerStatus) DeepCopy

func (in *AlertmanagerStatus) DeepCopy() *AlertmanagerStatus

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AlertmanagerStatus.

func (*AlertmanagerStatus) DeepCopyInto

func (in *AlertmanagerStatus) DeepCopyInto(out *AlertmanagerStatus)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type AlertmanagerWebSpec

type AlertmanagerWebSpec struct {
	WebConfigFileFields `json:",inline"`
	// 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
	// `--web.timeout` flag.
	// +optional
	Timeout *uint32 `json:"timeout,omitempty"`
}

AlertmanagerWebSpec defines the web command line flags when starting Alertmanager. +k8s:openapi-gen=true

func (*AlertmanagerWebSpec) DeepCopy

func (in *AlertmanagerWebSpec) DeepCopy() *AlertmanagerWebSpec

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AlertmanagerWebSpec.

func (*AlertmanagerWebSpec) DeepCopyInto

func (in *AlertmanagerWebSpec) DeepCopyInto(out *AlertmanagerWebSpec)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type ArbitraryFSAccessThroughSMsConfig

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"`
}

ArbitraryFSAccessThroughSMsConfig enables users to configure, whether a service monitor selected by the Prometheus instance is allowed to use arbitrary files on the file system of the Prometheus container. This is the case when e.g. a service monitor specifies a BearerTokenFile in an endpoint. A malicious user could create a service monitor selecting arbitrary secret files in the Prometheus container. Those secrets would then be sent with a scrape request by Prometheus to a malicious target. Denying the above would prevent the attack, users can instead use the BearerTokenSecret field.

func (*ArbitraryFSAccessThroughSMsConfig) DeepCopy

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ArbitraryFSAccessThroughSMsConfig.

func (*ArbitraryFSAccessThroughSMsConfig) DeepCopyInto

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type Argument

type Argument struct {
	// name of the argument, e.g. "scrape.discovery-reload-interval".
	// +kubebuilder:validation:MinLength=1
	// +required
	Name string `json:"name"`
	// 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"`
}

Argument as part of the AdditionalArgs list. +k8s:openapi-gen=true

func (*Argument) DeepCopy

func (in *Argument) DeepCopy() *Argument

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Argument.

func (*Argument) DeepCopyInto

func (in *Argument) DeepCopyInto(out *Argument)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type AttachMetadata

type AttachMetadata struct {
	// node when set to true, Prometheus attaches node metadata to the discovered
	// targets.
	//
	// The Prometheus service account must have the `list` and `watch`
	// permissions on the `Nodes` objects.
	//
	// +optional
	Node *bool `json:"node,omitempty"`
}

func (*AttachMetadata) DeepCopy

func (in *AttachMetadata) DeepCopy() *AttachMetadata

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AttachMetadata.

func (*AttachMetadata) DeepCopyInto

func (in *AttachMetadata) DeepCopyInto(out *AttachMetadata)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type Authorization

type Authorization struct {
	// +optional
	SafeAuthorization `json:",inline"`

	// credentialsFile defines the file to read a secret from, mutually exclusive with `credentials`.
	// +optional
	CredentialsFile string `json:"credentialsFile,omitempty"`
}

func (*Authorization) DeepCopy

func (in *Authorization) DeepCopy() *Authorization

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Authorization.

func (*Authorization) DeepCopyInto

func (in *Authorization) DeepCopyInto(out *Authorization)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*Authorization) Validate

func (c *Authorization) Validate() error

Validate semantically validates the given Authorization section.

type AzureAD

type AzureAD struct {
	// 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.
	// 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.
	// 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.
	// See https://learn.microsoft.com/en-us/azure/developer/go/azure-sdk-authentication
	// Cannot be set at the same time as `oauth` or `managedIdentity`.
	//
	// It requires Prometheus >= v2.52.0 or Thanos >= v0.36.0.
	// +optional
	SDK *AzureSDK `json:"sdk,omitempty"`
}

AzureAD defines the configuration for remote write's azuread parameters. +k8s:openapi-gen=true

func (*AzureAD) DeepCopy

func (in *AzureAD) DeepCopy() *AzureAD

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AzureAD.

func (*AzureAD) DeepCopyInto

func (in *AzureAD) DeepCopyInto(out *AzureAD)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type AzureOAuth

type AzureOAuth struct {
	// 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.
	// +required
	ClientSecret v1.SecretKeySelector `json:"clientSecret"`
	// 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-.]+$
	TenantID string `json:"tenantId"`
}

AzureOAuth defines the Azure OAuth settings. +k8s:openapi-gen=true

func (*AzureOAuth) DeepCopy

func (in *AzureOAuth) DeepCopy() *AzureOAuth

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AzureOAuth.

func (*AzureOAuth) DeepCopyInto

func (in *AzureOAuth) DeepCopyInto(out *AzureOAuth)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type AzureSDK

type AzureSDK struct {
	// 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"`
}

AzureSDK is used to store azure SDK config values.

func (*AzureSDK) DeepCopy

func (in *AzureSDK) DeepCopy() *AzureSDK

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AzureSDK.

func (*AzureSDK) DeepCopyInto

func (in *AzureSDK) DeepCopyInto(out *AzureSDK)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type BasicAuth

type BasicAuth struct {
	// username defines a key of a Secret containing the username for
	// authentication.
	// +optional
	Username v1.SecretKeySelector `json:"username,omitempty"`

	// password defines a key of a Secret containing the password for
	// authentication.
	// +optional
	Password v1.SecretKeySelector `json:"password,omitempty"`
}

BasicAuth configures HTTP Basic Authentication settings.

+k8s:openapi-gen=true

func (*BasicAuth) DeepCopy

func (in *BasicAuth) DeepCopy() *BasicAuth

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new BasicAuth.

func (*BasicAuth) DeepCopyInto

func (in *BasicAuth) DeepCopyInto(out *BasicAuth)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type ByteSize

type ByteSize string

ByteSize is a valid memory size type based on powers-of-2, so 1KB is 1024B. Supported units: B, KB, KiB, MB, MiB, GB, GiB, TB, TiB, PB, PiB, EB, EiB Ex: `512MB`. +kubebuilder:validation:Pattern:="(^0|([0-9]*[.])?[0-9]+((K|M|G|T|E|P)i?)?B)$"

func (*ByteSize) IsEmpty

func (bs *ByteSize) IsEmpty() bool

type ClusterTLSConfig

type ClusterTLSConfig struct {
	// server defines the server-side configuration for mutual TLS.
	// +required
	ServerTLS WebTLSConfig `json:"server"`
	// client defines the client-side configuration for mutual TLS.
	// +required
	ClientTLS SafeTLSConfig `json:"client"`
}

ClusterTLSConfig defines the mutual TLS configuration for the Alertmanager cluster TLS protocol. +k8s:openapi-gen=true

func (*ClusterTLSConfig) DeepCopy

func (in *ClusterTLSConfig) DeepCopy() *ClusterTLSConfig

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterTLSConfig.

func (*ClusterTLSConfig) DeepCopyInto

func (in *ClusterTLSConfig) DeepCopyInto(out *ClusterTLSConfig)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type CommonPrometheusFields

type CommonPrometheusFields struct {
	// 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.
	// * "app.kubernetes.io/instance" label, set to the name of the Prometheus object.
	// * "app.kubernetes.io/managed-by" label, set to "prometheus-operator".
	// * "app.kubernetes.io/name" label, set to "prometheus".
	// * "app.kubernetes.io/version" label, set to the Prometheus version.
	// * "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"`

	// 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`
	// and `spec.scrapeConfigSelector` are null, the Prometheus configuration is unmanaged.
	// The Prometheus operator will ensure that the Prometheus configuration's
	// Secret exists, but it is the responsibility of the user to provide the raw
	// gzipped Prometheus configuration under the `prometheus.yaml.gz` key.
	// 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"`
	// 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"`

	// 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`
	// and `spec.scrapeConfigSelector` are null, the Prometheus configuration is unmanaged.
	// The Prometheus operator will ensure that the Prometheus configuration's
	// Secret exists, but it is the responsibility of the user to provide the raw
	// gzipped Prometheus configuration under the `prometheus.yaml.gz` key.
	// 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"`
	// 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"`

	// 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`
	// and `spec.scrapeConfigSelector` are null, the Prometheus configuration is unmanaged.
	// The Prometheus operator will ensure that the Prometheus configuration's
	// Secret exists, but it is the responsibility of the user to provide the raw
	// gzipped Prometheus configuration under the `prometheus.yaml.gz` key.
	// 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"`
	// 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"`

	// 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`
	// and `spec.scrapeConfigSelector` are null, the Prometheus configuration is unmanaged.
	// The Prometheus operator will ensure that the Prometheus configuration's
	// Secret exists, but it is the responsibility of the user to provide the raw
	// gzipped Prometheus configuration under the `prometheus.yaml.gz` key.
	// 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.
	//
	// Note that the ScrapeConfig custom resource definition is currently at Alpha level.
	//
	// +optional
	ScrapeConfigSelector *metav1.LabelSelector `json:"scrapeConfigSelector,omitempty"`
	// 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.
	//
	// Note that the ScrapeConfig custom resource definition is currently at Alpha level.
	//
	// +optional
	ScrapeConfigNamespaceSelector *metav1.LabelSelector `json:"scrapeConfigNamespaceSelector,omitempty"`

	// 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"`

	// 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"`

	// 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
	// Operator knows which version of Prometheus is being configured.
	//
	// If neither `spec.image` nor `spec.baseImage` are defined, the operator
	// will use the latest upstream version of Prometheus available at the time
	// when the operator was released.
	//
	// +optional
	Image *string `json:"image,omitempty"`
	// 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"`
	// 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"`

	// 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.
	//
	// Default: 1
	// +optional
	Replicas *int32 `json:"replicas,omitempty"`

	// 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.
	//
	// When not defined, the operator assumes only one shard.
	//
	// Note that scaling down shards will not reshard data onto the remaining
	// instances, it must be manually moved. Increasing shards will not reshard
	// data either but it will continue to be available from the same
	// instances. To query globally, use either
	// * Thanos sidecar + querier for query federation and Thanos Ruler for rules.
	// * Remote-write to send metrics to a central location.
	//
	// By default, the sharding of targets is performed on:
	// * The `__address__` target's metadata label for PodMonitor,
	// ServiceMonitor and ScrapeConfig resources.
	// * The `__param_target__` label for Probe resources.
	//
	// Users can define their own sharding implementation by setting the
	// `__tmp_hash` label during the target discovery with relabeling
	// configuration (either in the monitoring resources or via scrape class).
	//
	// 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"`

	// 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"`
	// 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 (`""`).
	//
	// Default: "prometheus"
	// +optional
	PrometheusExternalLabelName *string `json:"prometheusExternalLabelName,omitempty"`

	// logLevel for Prometheus and the config-reloader sidecar.
	// +kubebuilder:validation:Enum="";debug;info;warn;error
	// +optional
	LogLevel string `json:"logLevel,omitempty"`
	// logFormat for Log level for Prometheus and the config-reloader sidecar.
	// +kubebuilder:validation:Enum="";logfmt;json
	// +optional
	LogFormat string `json:"logFormat,omitempty"`

	// scrapeInterval defines interval between consecutive scrapes.
	//
	// Default: "30s"
	// +kubebuilder:default:="30s"
	// +optional
	ScrapeInterval Duration `json:"scrapeInterval,omitempty"`
	// 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"`

	// 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.
	//
	// It requires Prometheus >= v2.49.0.
	//
	// `PrometheusText1.0.0` requires Prometheus >= v3.0.0.
	//
	// +listType=set
	// +optional
	ScrapeProtocols []ScrapeProtocol `json:"scrapeProtocols,omitempty"`

	// 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"`

	// 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.
	// Use it with caution for specific low-volume use cases.
	// It is not suitable for replacing the ingestion via scraping and turning
	// Prometheus into a push-based metrics collection system.
	// 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"`

	// 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.
	//
	// It requires Prometheus >= v2.47.0.
	// +optional
	EnableOTLPReceiver *bool `json:"enableOTLPReceiver,omitempty"`

	// remoteWriteReceiverMessageVersions list of the protobuf message versions to accept when receiving the
	// remote writes.
	//
	// It requires Prometheus >= v2.54.0.
	//
	// +kubebuilder:validation:MinItems=1
	// +listType:=set
	// +optional
	RemoteWriteReceiverMessageVersions []RemoteWriteMessageVersion `json:"remoteWriteReceiverMessageVersions,omitempty"`

	// 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
	// that this behaviour may break at any time without notice.
	//
	// For more information see https://prometheus.io/docs/prometheus/latest/feature_flags/
	//
	// +listType:=set
	// +optional
	EnableFeatures []EnableFeature `json:"enableFeatures,omitempty"`

	// 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"`
	// 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.
	// +optional
	Storage *StorageSpec `json:"storage,omitempty"`

	// 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 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"`

	// 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.
	//
	// +optional
	PersistentVolumeClaimRetentionPolicy *appsv1.StatefulSetPersistentVolumeClaimRetentionPolicy `json:"persistentVolumeClaimRetentionPolicy,omitempty"`

	// web defines the configuration of the Prometheus web server.
	// +optional
	Web *PrometheusWebSpec `json:"web,omitempty"`

	// resources defines the resources requests and limits of the 'prometheus' container.
	// +optional
	Resources v1.ResourceRequirements `json:"resources,omitempty"`

	// 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
	// Prometheus Pods.
	// +optional
	ServiceAccountName string `json:"serviceAccountName,omitempty"`

	// 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.
	// It is possible to use strategic merge patch to project the service account token into the 'prometheus' container.
	// +optional
	AutomountServiceAccountToken *bool `json:"automountServiceAccountToken,omitempty"`

	// 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-<secret-name>`.
	// The Secrets are mounted into /etc/prometheus/secrets/<secret-name> in the 'prometheus' container.
	// +listType:=set
	// +optional
	Secrets []string `json:"secrets,omitempty"`
	// 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-<configmap-name>`.
	// The ConfigMaps are mounted into /etc/prometheus/configmaps/<configmap-name> in the 'prometheus' container.
	// +optional
	ConfigMaps []string `json:"configMaps,omitempty"`

	// affinity defines the Pods' affinity scheduling rules if specified.
	// +optional
	Affinity *v1.Affinity `json:"affinity,omitempty"`
	// tolerations defines the Pods' tolerations if specified.
	// +optional
	Tolerations []v1.Toleration `json:"tolerations,omitempty"`

	// topologySpreadConstraints defines the pod's topology spread constraints if specified.
	// +optional
	TopologySpreadConstraints []TopologySpreadConstraint `json:"topologySpreadConstraints,omitempty"`

	// remoteWrite defines the list of remote write configurations.
	// +optional
	RemoteWrite []RemoteWriteSpec `json:"remoteWrite,omitempty"`

	// 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.
	// This defaults to the default PodSecurityContext.
	// +optional
	SecurityContext *v1.PodSecurityContext `json:"securityContext,omitempty"`

	// dnsPolicy defines the DNS policy for the pods.
	//
	// +optional
	DNSPolicy *DNSPolicy `json:"dnsPolicy,omitempty"`
	// dnsConfig defines the DNS configuration for the pods.
	//
	// +optional
	DNSConfig *PodDNSConfig `json:"dnsConfig,omitempty"`
	// listenLocal when true, the Prometheus server listens on the loopback address
	// instead of the Pod IP's address.
	//
	// +optional
	ListenLocal bool `json:"listenLocal,omitempty"`

	// 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
	// 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
	// container if they share the same name and modifications are done via a
	// strategic merge patch.
	//
	// The names of containers managed by the operator are:
	// * `prometheus`
	// * `config-reloader`
	// * `thanos-sidecar`
	//
	// 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 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:
	// https://kubernetes.io/docs/concepts/workloads/pods/init-containers/
	// InitContainers described here modify an operator generated init
	// containers if they share the same name and modifications are done via a
	// strategic merge patch.
	//
	// The names of init container name managed by the operator are:
	// * `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"`

	// 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
	// in the official Prometheus documentation:
	// https://prometheus.io/docs/prometheus/latest/configuration/configuration/#scrape_config.
	// As scrape configs are appended, the user is responsible to make sure it
	// is valid. Note that using this feature may expose the possibility to
	// break upgrades of Prometheus. It is advised to review Prometheus release
	// notes to ensure that no incompatible scrape configs are going to break
	// Prometheus after the upgrade.
	// +optional
	AdditionalScrapeConfigs *v1.SecretKeySelector `json:"additionalScrapeConfigs,omitempty"`

	// 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
	// and bearer token file at /var/run/secrets/kubernetes.io/serviceaccount/.
	// +optional
	APIServerConfig *APIServerConfig `json:"apiserverConfig,omitempty"`

	// priorityClassName assigned to the Pods.
	// +optional
	PriorityClassName string `json:"priorityClassName,omitempty"`
	// portName used for the pods and governing service.
	// Default: "web"
	// +kubebuilder:default:="web"
	// +optional
	PortName string `json:"portName,omitempty"`

	// 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
	// (e.g.  '/var/run/secrets/kubernetes.io/serviceaccount/token'), a
	// malicious target can get access to the Prometheus service account's
	// token in the Prometheus' scrape request. Setting
	// `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"`

	// 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,`OverrideHonorLabels:true` enforces `honorLabels:false`
	// for all ServiceMonitor, PodMonitor and ScrapeConfig objects.
	// +optional
	OverrideHonorLabels bool `json:"overrideHonorLabels,omitempty"`
	// 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"`

	// 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"`

	// 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.
	// 3. All alerts generated from alerting rules defined in `PrometheusRule` objects.
	// 4. All vector selectors of PromQL expressions defined in `PrometheusRule` objects.
	//
	// The label will not added for objects referenced in `spec.excludedFromEnforcement`.
	//
	// 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"`

	// 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
	// `spec.enforcedSampleLimit`.
	//
	// It is meant to be used by admins to keep the overall number of
	// samples/series under a desired limit.
	//
	// When both `enforcedSampleLimit` and `sampleLimit` are defined and greater than zero, the following rules apply:
	// * Scrape objects without a defined sampleLimit value will inherit the global sampleLimit value (Prometheus >= 2.45.0) or the enforcedSampleLimit value (Prometheus < v2.45.0).
	//   If Prometheus version is >= 2.45.0 and the `enforcedSampleLimit` is greater than the `sampleLimit`, the `sampleLimit` will be set to `enforcedSampleLimit`.
	// * Scrape objects with a sampleLimit value less than or equal to enforcedSampleLimit keep their specific value.
	// * Scrape objects with a sampleLimit value greater than enforcedSampleLimit are set to enforcedSampleLimit.
	//
	//
	// +optional
	EnforcedSampleLimit *uint64 `json:"enforcedSampleLimit,omitempty"`
	// 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`.
	//
	// It is meant to be used by admins to to keep the overall number of
	// targets under a desired limit.
	//
	// When both `enforcedTargetLimit` and `targetLimit` are defined and greater than zero, the following rules apply:
	// * Scrape objects without a defined targetLimit value will inherit the global targetLimit value (Prometheus >= 2.45.0) or the enforcedTargetLimit value (Prometheus < v2.45.0).
	//   If Prometheus version is >= 2.45.0 and the `enforcedTargetLimit` is greater than the `targetLimit`, the `targetLimit` will be set to `enforcedTargetLimit`.
	// * Scrape objects with a targetLimit value less than or equal to enforcedTargetLimit keep their specific value.
	// * Scrape objects with a targetLimit value greater than enforcedTargetLimit are set to enforcedTargetLimit.
	//
	//
	// +optional
	EnforcedTargetLimit *uint64 `json:"enforcedTargetLimit,omitempty"`
	// 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`.
	//
	// It requires Prometheus >= v2.27.0.
	//
	// When both `enforcedLabelLimit` and `labelLimit` are defined and greater than zero, the following rules apply:
	// * Scrape objects without a defined labelLimit value will inherit the global labelLimit value (Prometheus >= 2.45.0) or the enforcedLabelLimit value (Prometheus < v2.45.0).
	//   If Prometheus version is >= 2.45.0 and the `enforcedLabelLimit` is greater than the `labelLimit`, the `labelLimit` will be set to `enforcedLabelLimit`.
	// * Scrape objects with a labelLimit value less than or equal to enforcedLabelLimit keep their specific value.
	// * Scrape objects with a labelLimit value greater than enforcedLabelLimit are set to enforcedLabelLimit.
	//
	//
	// +optional
	EnforcedLabelLimit *uint64 `json:"enforcedLabelLimit,omitempty"`
	// 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`.
	//
	// It requires Prometheus >= v2.27.0.
	//
	// When both `enforcedLabelNameLengthLimit` and `labelNameLengthLimit` are defined and greater than zero, the following rules apply:
	// * Scrape objects without a defined labelNameLengthLimit value will inherit the global labelNameLengthLimit value (Prometheus >= 2.45.0) or the enforcedLabelNameLengthLimit value (Prometheus < v2.45.0).
	//   If Prometheus version is >= 2.45.0 and the `enforcedLabelNameLengthLimit` is greater than the `labelNameLengthLimit`, the `labelNameLengthLimit` will be set to `enforcedLabelNameLengthLimit`.
	// * Scrape objects with a labelNameLengthLimit value less than or equal to enforcedLabelNameLengthLimit keep their specific value.
	// * Scrape objects with a labelNameLengthLimit value greater than enforcedLabelNameLengthLimit are set to enforcedLabelNameLengthLimit.
	//
	//
	// +optional
	EnforcedLabelNameLengthLimit *uint64 `json:"enforcedLabelNameLengthLimit,omitempty"`
	// 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`.
	//
	// It requires Prometheus >= v2.27.0.
	//
	// When both `enforcedLabelValueLengthLimit` and `labelValueLengthLimit` are defined and greater than zero, the following rules apply:
	// * Scrape objects without a defined labelValueLengthLimit value will inherit the global labelValueLengthLimit value (Prometheus >= 2.45.0) or the enforcedLabelValueLengthLimit value (Prometheus < v2.45.0).
	//   If Prometheus version is >= 2.45.0 and the `enforcedLabelValueLengthLimit` is greater than the `labelValueLengthLimit`, the `labelValueLengthLimit` will be set to `enforcedLabelValueLengthLimit`.
	// * Scrape objects with a labelValueLengthLimit value less than or equal to enforcedLabelValueLengthLimit keep their specific value.
	// * Scrape objects with a labelValueLengthLimit value greater than enforcedLabelValueLengthLimit are set to enforcedLabelValueLengthLimit.
	//
	//
	// +optional
	EnforcedLabelValueLengthLimit *uint64 `json:"enforcedLabelValueLengthLimit,omitempty"`
	// 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
	// greater than zero and less than `spec.enforcedKeepDroppedTargets`.
	//
	// It requires Prometheus >= v2.47.0.
	//
	// When both `enforcedKeepDroppedTargets` and `keepDroppedTargets` are defined and greater than zero, the following rules apply:
	// * Scrape objects without a defined keepDroppedTargets value will inherit the global keepDroppedTargets value (Prometheus >= 2.45.0) or the enforcedKeepDroppedTargets value (Prometheus < v2.45.0).
	//   If Prometheus version is >= 2.45.0 and the `enforcedKeepDroppedTargets` is greater than the `keepDroppedTargets`, the `keepDroppedTargets` will be set to `enforcedKeepDroppedTargets`.
	// * Scrape objects with a keepDroppedTargets value less than or equal to enforcedKeepDroppedTargets keep their specific value.
	// * Scrape objects with a keepDroppedTargets value greater than enforcedKeepDroppedTargets are set to enforcedKeepDroppedTargets.
	//
	//
	// +optional
	EnforcedKeepDroppedTargets *uint64 `json:"enforcedKeepDroppedTargets,omitempty"`
	// 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.
	//
	// It requires Prometheus >= v2.28.0.
	//
	// When both `enforcedBodySizeLimit` and `bodySizeLimit` are defined and greater than zero, the following rules apply:
	// * Scrape objects without a defined bodySizeLimit value will inherit the global bodySizeLimit value (Prometheus >= 2.45.0) or the enforcedBodySizeLimit value (Prometheus < v2.45.0).
	//   If Prometheus version is >= 2.45.0 and the `enforcedBodySizeLimit` is greater than the `bodySizeLimit`, the `bodySizeLimit` will be set to `enforcedBodySizeLimit`.
	// * 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"`

	// nameValidationScheme defines the validation scheme for metric and label names.
	//
	// It requires Prometheus >= v2.55.0.
	//
	// +optional
	NameValidationScheme *NameValidationSchemeOptions `json:"nameValidationScheme,omitempty"`

	// 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.
	//
	// It requires Prometheus >= v3.4.0.
	//
	// +optional
	NameEscapingScheme *NameEscapingSchemeOptions `json:"nameEscapingScheme,omitempty"`

	// convertClassicHistogramsToNHCB defines whether to convert all scraped classic histograms into a native
	// histogram with custom buckets.
	//
	// It requires Prometheus >= v3.4.0.
	//
	// +optional
	ConvertClassicHistogramsToNHCB *bool `json:"convertClassicHistogramsToNHCB,omitempty"`

	// 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.
	//
	// It requires Prometheus >= v3.5.0.
	//
	// +optional
	ScrapeClassicHistograms *bool `json:"scrapeClassicHistograms,omitempty"`

	// 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.
	//
	// +kubebuilder:validation:Minimum:=0
	// +optional
	MinReadySeconds *int32 `json:"minReadySeconds,omitempty"`

	// hostAliases defines the optional list of hosts and IPs that will be injected into the Pod's
	// hosts file if specified.
	//
	// +listType=map
	// +listMapKey=ip
	// +optional
	HostAliases []HostAlias `json:"hostAliases,omitempty"`

	// 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
	// Prometheus container which may cause issues if they are invalid or not supported
	// by the given Prometheus version.
	//
	// In case of an argument conflict (e.g. an argument which is already set by the
	// operator itself) or when providing an invalid argument, the reconciliation will
	// fail and an error will be logged.
	//
	// +optional
	AdditionalArgs []Argument `json:"additionalArgs,omitempty"`

	// walCompression defines the compression of the write-ahead log (WAL) using Snappy.
	//
	// WAL compression is enabled by default for Prometheus >= 2.20.0
	//
	// Requires Prometheus v2.11.0 and above.
	//
	// +optional
	WALCompression *bool `json:"walCompression,omitempty"`

	// 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.
	//
	// +optional
	ExcludedFromEnforcement []ObjectReference `json:"excludedFromEnforcement,omitempty"`

	// 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/ ).
	//
	// 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
	// PodMonitor and ServiceMonitor objects.
	//
	// +optional
	PodTargetLabels []string `json:"podTargetLabels,omitempty"`

	// 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.
	// 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.
	// If you want to enforce a maximum limit for all scrape objects, refer to enforcedBodySizeLimit.
	//
	// +optional
	BodySizeLimit *ByteSize `json:"bodySizeLimit,omitempty"`
	// 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.
	// If you want to enforce a maximum limit for all scrape objects, refer to enforcedSampleLimit.
	//
	// +optional
	SampleLimit *uint64 `json:"sampleLimit,omitempty"`
	// 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.
	// If you want to enforce a maximum limit for all scrape objects, refer to enforcedTargetLimit.
	//
	// +optional
	TargetLimit *uint64 `json:"targetLimit,omitempty"`
	// 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.
	// If you want to enforce a maximum limit for all scrape objects, refer to enforcedLabelLimit.
	//
	// +optional
	LabelLimit *uint64 `json:"labelLimit,omitempty"`
	// 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.
	// If you want to enforce a maximum limit for all scrape objects, refer to enforcedLabelNameLengthLimit.
	//
	// +optional
	LabelNameLengthLimit *uint64 `json:"labelNameLengthLimit,omitempty"`
	// 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.
	// If you want to enforce a maximum limit for all scrape objects, refer to enforcedLabelValueLengthLimit.
	//
	// +optional
	LabelValueLengthLimit *uint64 `json:"labelValueLengthLimit,omitempty"`
	// 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.
	//
	// Note that the global limit only applies to scrape objects that don't specify an explicit limit value.
	// If you want to enforce a maximum limit for all scrape objects, refer to enforcedKeepDroppedTargets.
	//
	// +optional
	KeepDroppedTargets *uint64 `json:"keepDroppedTargets,omitempty"`

	// 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"`

	// 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"`

	// 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
	// in a breaking way.
	//
	// +listType=map
	// +listMapKey=name
	// +optional
	ScrapeClasses []ScrapeClass `json:"scrapeClasses,omitempty"`

	// 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".
	// If unset, the operator assumes the "Endpoints" role.
	//
	// +optional
	ServiceDiscoveryRole *ServiceDiscoveryRole `json:"serviceDiscoveryRole,omitempty"`

	// 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"`

	// 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
	// will mount the file into an emptyDir volume at `/var/log/prometheus`.
	// If a full path is provided, e.g. '/var/log/prometheus/file.log', you
	// must mount a volume in the specified directory and it must be writable.
	// It requires Prometheus >= v2.55.0.
	//
	// +kubebuilder:validation:MinLength=1
	// +optional
	ScrapeFailureLogFile *string `json:"scrapeFailureLogFile,omitempty"`

	// 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.
	// When deploying multiple Prometheus/PrometheusAgent 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"`

	// runtime defines the values for the Prometheus process behavior
	// +optional
	Runtime *RuntimeConfig `json:"runtime,omitempty"`

	// 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.
	//
	// Defaults to 600 seconds.
	//
	// +kubebuilder:validation:Minimum:=0
	// +optional
	TerminationGracePeriodSeconds *int64 `json:"terminationGracePeriodSeconds,omitempty"`

	// hostUsers supports the user space in Kubernetes.
	//
	// More info: https://kubernetes.io/docs/tasks/configure-pod-container/user-namespaces/
	//
	//
	// The feature requires at least Kubernetes 1.28 with the `UserNamespacesSupport` feature gate enabled.
	// Starting Kubernetes 1.33, the feature is enabled by default.
	//
	// +optional
	HostUsers *bool `json:"hostUsers,omitempty"`
}

CommonPrometheusFields are the options available to both the Prometheus server and agent. +k8s:deepcopy-gen=true

func (*CommonPrometheusFields) DeepCopy

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CommonPrometheusFields.

func (*CommonPrometheusFields) DeepCopyInto

func (in *CommonPrometheusFields) DeepCopyInto(out *CommonPrometheusFields)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*CommonPrometheusFields) PrometheusURIScheme

func (cpf *CommonPrometheusFields) PrometheusURIScheme() string

func (*CommonPrometheusFields) WebRoutePrefix

func (cpf *CommonPrometheusFields) WebRoutePrefix() string

type Condition

type Condition struct {
	// type of the condition being reported.
	// +required
	Type ConditionType `json:"type"`
	// 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.
	// +optional
	Reason string `json:"reason,omitempty"`
	// message defines human-readable message indicating details for the condition's last transition.
	// +optional
	Message string `json:"message,omitempty"`
	// 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"`
}

Condition represents the state of the resources associated with the Prometheus, Alertmanager or ThanosRuler resource. +k8s:deepcopy-gen=true

func (*Condition) DeepCopy

func (in *Condition) DeepCopy() *Condition

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Condition.

func (*Condition) DeepCopyInto

func (in *Condition) DeepCopyInto(out *Condition)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type ConditionStatus

type ConditionStatus string

+kubebuilder:validation:MinLength=1

const (
	ConditionTrue     ConditionStatus = "True"
	ConditionDegraded ConditionStatus = "Degraded"
	ConditionFalse    ConditionStatus = "False"
	ConditionUnknown  ConditionStatus = "Unknown"
)

type ConditionType

type ConditionType string

+kubebuilder:validation:MinLength=1

const (
	// Available indicates whether enough pods are ready to provide the
	// service.
	// The possible status values for this condition type are:
	// - True: all pods are running and ready, the service is fully available.
	// - Degraded: some pods aren't ready, the service is partially available.
	// - False: no pods are running, the service is totally unavailable.
	// - Unknown: the operator couldn't determine the condition status.
	Available ConditionType = "Available"
	// Reconciled indicates whether the operator has reconciled the state of
	// the underlying resources with the object's spec.
	// The possible status values for this condition type are:
	// - True: the reconciliation was successful.
	// - False: the reconciliation failed.
	// - Unknown: the operator couldn't determine the condition status.
	Reconciled ConditionType = "Reconciled"
	// Accepted indicates whether the workload controller has successfully accepted
	// the configuration resource and updated the configuration of the workload accordingly.
	// The possible status values for this condition type are:
	// - True: the configuration resource was successfully accepted by the controller and written to the configuration secret.
	// - False: the controller rejected the configuration due to an error.
	// - Unknown: the operator couldn't determine the condition status.
	Accepted ConditionType = "Accepted"
)

type ConfigResourceCondition

type ConfigResourceCondition struct {
	// type of the condition being reported.
	// Currently, only "Accepted" is supported.
	// +kubebuilder:validation:Enum=Accepted
	// +required
	Type ConditionType `json:"type"`
	// status of the condition.
	// +required
	Status ConditionStatus `json:"status"`
	// 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.
	// +optional
	Reason string `json:"reason,omitempty"`
	// message defines the human-readable message indicating details for the condition's last transition.
	// +optional
	Message string `json:"message,omitempty"`
	// 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"`
}

ConfigResourceCondition describes the status of configuration resources linked to Prometheus, PrometheusAgent, Alertmanager or ThanosRuler. +k8s:deepcopy-gen=true

func (*ConfigResourceCondition) DeepCopy

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ConfigResourceCondition.

func (*ConfigResourceCondition) DeepCopyInto

func (in *ConfigResourceCondition) DeepCopyInto(out *ConfigResourceCondition)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type ConfigResourceStatus

type ConfigResourceStatus struct {
	// 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"`
}

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

func (*ConfigResourceStatus) DeepCopy

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ConfigResourceStatus.

func (*ConfigResourceStatus) DeepCopyInto

func (in *ConfigResourceStatus) DeepCopyInto(out *ConfigResourceStatus)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type CoreV1TopologySpreadConstraint

type CoreV1TopologySpreadConstraint v1.TopologySpreadConstraint

func (*CoreV1TopologySpreadConstraint) DeepCopy

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CoreV1TopologySpreadConstraint.

func (*CoreV1TopologySpreadConstraint) DeepCopyInto

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type DNSPolicy

type DNSPolicy string

DNSPolicy specifies the DNS policy for the pod. +kubebuilder:validation:Enum=ClusterFirstWithHostNet;ClusterFirst;Default;None

const (
	// 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 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 defines that the pod should use the default (as
	// determined by kubelet) DNS settings.
	DNSDefault DNSPolicy = "Default"

	// 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"
)

type Duration

type Duration string

Duration is a valid time duration that can be parsed by Prometheus model.ParseDuration() function. Supported units: y, w, d, h, m, s, ms Examples: `30s`, `1m`, `1h20m15s`, `15d` +kubebuilder:validation:Pattern:="^(0|(([0-9]+)y)?(([0-9]+)w)?(([0-9]+)d)?(([0-9]+)h)?(([0-9]+)m)?(([0-9]+)s)?(([0-9]+)ms)?)$"

func DurationPointer

func DurationPointer(s string) *Duration

DurationPointer is a helper function to parse a Duration string into a *Duration.

type EmbeddedObjectMetadata

type EmbeddedObjectMetadata struct {
	// 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.
	// Cannot be updated.
	// More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/
	// +optional
	Name string `json:"name,omitempty" protobuf:"bytes,1,opt,name=name"`

	// 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 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/
	// +optional
	Annotations map[string]string `json:"annotations,omitempty" protobuf:"bytes,12,rep,name=annotations"`
}

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.

func (*EmbeddedObjectMetadata) DeepCopy

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new EmbeddedObjectMetadata.

func (*EmbeddedObjectMetadata) DeepCopyInto

func (in *EmbeddedObjectMetadata) DeepCopyInto(out *EmbeddedObjectMetadata)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type EmbeddedPersistentVolumeClaim

type EmbeddedPersistentVolumeClaim struct {
	// TypeMeta defines the versioned schema of this representation of an object.
	metav1.TypeMeta `json:",inline"`
	// metadata defines EmbeddedMetadata contains metadata relevant to an EmbeddedResource.
	// +optional
	EmbeddedObjectMetadata `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"`
	// 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
	Status v1.PersistentVolumeClaimStatus `json:"status,omitempty" protobuf:"bytes,3,opt,name=status"`
}

EmbeddedPersistentVolumeClaim is an embedded version of k8s.io/api/core/v1.PersistentVolumeClaim. It contains TypeMeta and a reduced ObjectMeta.

func (*EmbeddedPersistentVolumeClaim) DeepCopy

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new EmbeddedPersistentVolumeClaim.

func (*EmbeddedPersistentVolumeClaim) DeepCopyInto

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type EnableFeature

type EnableFeature string

+kubebuilder:validation:MinLength:=1

type Endpoint

type Endpoint struct {
	// port defines the name of the Service port which this endpoint refers to.
	//
	// It takes precedence over `targetPort`.
	// +optional
	Port string `json:"port,omitempty"`

	// 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"`

	// 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"`

	// 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"`

	// params define optional HTTP URL parameters.
	// +optional
	Params map[string][]string `json:"params,omitempty"`

	// interval at which Prometheus scrapes the metrics from the target.
	//
	// If empty, Prometheus uses the global scrape interval.
	// +optional
	Interval Duration `json:"interval,omitempty"`

	// 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"`

	// tlsConfig defines the TLS configuration to use when scraping the target.
	//
	// +optional
	TLSConfig *TLSConfig `json:"tlsConfig,omitempty"`

	// bearerTokenFile defines the file to read bearer token for scraping the target.
	//
	// Deprecated: use `authorization` instead.
	// +optional
	BearerTokenFile string `json:"bearerTokenFile,omitempty"`

	// 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.
	//
	// +optional
	//
	// Deprecated: use `authorization` instead.
	BearerTokenSecret *v1.SecretKeySelector `json:"bearerTokenSecret,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"`

	// honorLabels defines when true the metric's labels when they collide
	// with the target's labels.
	// +optional
	HonorLabels bool `json:"honorLabels,omitempty"`

	// 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
	// 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"`

	// basicAuth defines 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 defines 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"`

	// metricRelabelings defines the relabeling rules to apply to the
	// samples before ingestion.
	//
	// +optional
	MetricRelabelConfigs []RelabelConfig `json:"metricRelabelings,omitempty"`

	// relabelings defines the relabeling rules to apply the target's
	// metadata labels.
	//
	// The 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
	//
	// +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"`

	// 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.
	//
	// More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle/#pod-phase
	//
	// +optional
	FilterRunning *bool `json:"filterRunning,omitempty"`
}

Endpoint defines an endpoint serving Prometheus metrics to be scraped by Prometheus.

+k8s:openapi-gen=true

func (*Endpoint) DeepCopy

func (in *Endpoint) DeepCopy() *Endpoint

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Endpoint.

func (*Endpoint) DeepCopyInto

func (in *Endpoint) DeepCopyInto(out *Endpoint)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type Exemplars

type Exemplars struct {
	// 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.
	//
	// If not set, Prometheus uses its default value. A value of zero or less
	// than zero disables the storage.
	//
	// +optional
	MaxSize *int64 `json:"maxSize,omitempty"`
}

func (*Exemplars) DeepCopy

func (in *Exemplars) DeepCopy() *Exemplars

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Exemplars.

func (*Exemplars) DeepCopyInto

func (in *Exemplars) DeepCopyInto(out *Exemplars)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type GlobalJiraConfig

type GlobalJiraConfig struct {
	// apiURL defines the default Jira API URL.
	//
	// It requires Alertmanager >= v0.28.0.
	//
	// +optional
	APIURL *URL `json:"apiURL,omitempty"`
}

GlobalJiraConfig configures global Jira parameters.

func (*GlobalJiraConfig) DeepCopy

func (in *GlobalJiraConfig) DeepCopy() *GlobalJiraConfig

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GlobalJiraConfig.

func (*GlobalJiraConfig) DeepCopyInto

func (in *GlobalJiraConfig) DeepCopyInto(out *GlobalJiraConfig)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type GlobalRocketChatConfig

type GlobalRocketChatConfig struct {
	// apiURL defines the default Rocket Chat API URL.
	//
	// It requires Alertmanager >= v0.28.0.
	//
	// +optional
	APIURL *URL `json:"apiURL,omitempty"`

	// token defines the default Rocket Chat token.
	//
	// It requires Alertmanager >= v0.28.0.
	//
	// +optional
	Token *v1.SecretKeySelector `json:"token,omitempty"`

	// tokenID defines the default Rocket Chat Token ID.
	//
	// It requires Alertmanager >= v0.28.0.
	//
	// +optional
	TokenID *v1.SecretKeySelector `json:"tokenID,omitempty"`
}

GlobalRocketChatConfig configures global Rocket Chat parameters.

func (*GlobalRocketChatConfig) DeepCopy

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GlobalRocketChatConfig.

func (*GlobalRocketChatConfig) DeepCopyInto

func (in *GlobalRocketChatConfig) DeepCopyInto(out *GlobalRocketChatConfig)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type GlobalSMTPConfig

type GlobalSMTPConfig struct {
	// from defines the default SMTP From header field.
	// +optional
	From *string `json:"from,omitempty"`

	// smartHost defines the default SMTP smarthost used for sending emails.
	// +optional
	SmartHost *HostPort `json:"smartHost,omitempty"`

	// hello defines the default hostname to identify to the SMTP server.
	// +optional
	Hello *string `json:"hello,omitempty"`

	// 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"`

	// authPassword represents SMTP Auth using LOGIN and PLAIN.
	// +optional
	AuthPassword *v1.SecretKeySelector `json:"authPassword,omitempty"`

	// authIdentity represents SMTP Auth using PLAIN
	// +optional
	AuthIdentity *string `json:"authIdentity,omitempty"`

	// authSecret represents SMTP Auth using CRAM-MD5.
	// +optional
	AuthSecret *v1.SecretKeySelector `json:"authSecret,omitempty"`

	// 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"`

	// tlsConfig defines the default TLS configuration for SMTP receivers
	// +optional
	TLSConfig *SafeTLSConfig `json:"tlsConfig,omitempty"`
}

GlobalSMTPConfig configures global SMTP parameters. See https://prometheus.io/docs/alerting/latest/configuration/#configuration-file

func (*GlobalSMTPConfig) DeepCopy

func (in *GlobalSMTPConfig) DeepCopy() *GlobalSMTPConfig

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GlobalSMTPConfig.

func (*GlobalSMTPConfig) DeepCopyInto

func (in *GlobalSMTPConfig) DeepCopyInto(out *GlobalSMTPConfig)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type GlobalTelegramConfig

type GlobalTelegramConfig struct {
	// apiURL defines he default Telegram API URL.
	//
	// It requires Alertmanager >= v0.24.0.
	// +optional
	APIURL *URL `json:"apiURL,omitempty"`
}

GlobalTelegramConfig configures global Telegram parameters.

func (*GlobalTelegramConfig) DeepCopy

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GlobalTelegramConfig.

func (*GlobalTelegramConfig) DeepCopyInto

func (in *GlobalTelegramConfig) DeepCopyInto(out *GlobalTelegramConfig)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type GlobalVictorOpsConfig

type GlobalVictorOpsConfig struct {
	// apiURL defines the default VictorOps API URL.
	//
	// +optional
	APIURL *URL `json:"apiURL,omitempty"`
	// apiKey defines the default VictorOps API Key.
	//
	// +optional
	APIKey *v1.SecretKeySelector `json:"apiKey,omitempty"`
}

GlobalVictorOpsConfig configures global VictorOps parameters.

func (*GlobalVictorOpsConfig) DeepCopy

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GlobalVictorOpsConfig.

func (*GlobalVictorOpsConfig) DeepCopyInto

func (in *GlobalVictorOpsConfig) DeepCopyInto(out *GlobalVictorOpsConfig)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type GlobalWeChatConfig

type GlobalWeChatConfig struct {
	// apiURL defines he default WeChat API URL.
	// The default value is "https://qyapi.weixin.qq.com/cgi-bin/"
	// +optional
	APIURL *URL `json:"apiURL,omitempty"`

	// apiSecret defines the default WeChat API Secret.
	// +optional
	APISecret *v1.SecretKeySelector `json:"apiSecret,omitempty"`

	// apiCorpID defines the default WeChat API Corporate ID.
	// +optional
	// +kubebuilder:validation:MinLength=1
	APICorpID *string `json:"apiCorpID,omitempty"`
}

func (*GlobalWeChatConfig) DeepCopy

func (in *GlobalWeChatConfig) DeepCopy() *GlobalWeChatConfig

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GlobalWeChatConfig.

func (*GlobalWeChatConfig) DeepCopyInto

func (in *GlobalWeChatConfig) DeepCopyInto(out *GlobalWeChatConfig)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type GlobalWebexConfig

type GlobalWebexConfig struct {
	// apiURL defines the is the default Webex API URL.
	//
	// It requires Alertmanager >= v0.25.0.
	//
	// +optional
	APIURL *URL `json:"apiURL,omitempty"`
}

GlobalWebexConfig configures global Webex parameters. See https://prometheus.io/docs/alerting/latest/configuration/#configuration-file

func (*GlobalWebexConfig) DeepCopy

func (in *GlobalWebexConfig) DeepCopy() *GlobalWebexConfig

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GlobalWebexConfig.

func (*GlobalWebexConfig) DeepCopyInto

func (in *GlobalWebexConfig) DeepCopyInto(out *GlobalWebexConfig)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type GoDuration

type GoDuration string

GoDuration is a valid time duration that can be parsed by Go's time.ParseDuration() function. Supported units: h, m, s, ms Examples: `45ms`, `30s`, `1m`, `1h20m15s` +kubebuilder:validation:Pattern:="^(0|(([0-9]+)h)?(([0-9]+)m)?(([0-9]+)s)?(([0-9]+)ms)?)$"

type HTTPConfig

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"`
}

HTTPConfig defines the configuration for the HTTP client.

func (*HTTPConfig) DeepCopy

func (in *HTTPConfig) DeepCopy() *HTTPConfig

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new HTTPConfig.

func (*HTTPConfig) DeepCopyInto

func (in *HTTPConfig) DeepCopyInto(out *HTTPConfig)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*HTTPConfig) Validate

func (hc *HTTPConfig) Validate() error

Validate semantically validates the given HTTPConfig.

type HostAlias

type HostAlias struct {
	// ip defines the IP address of the host file entry.
	// +required
	IP string `json:"ip"`
	// hostnames defines hostnames for the above IP address.
	// +required
	Hostnames []string `json:"hostnames"`
}

HostAlias holds the mapping between IP and hostnames that will be injected as an entry in the pod's hosts file.

func (*HostAlias) DeepCopy

func (in *HostAlias) DeepCopy() *HostAlias

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new HostAlias.

func (*HostAlias) DeepCopyInto

func (in *HostAlias) DeepCopyInto(out *HostAlias)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type HostPort

type HostPort struct {
	// 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"`
	// 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"`
}

HostPort represents a "host:port" network address.

func (*HostPort) DeepCopy

func (in *HostPort) DeepCopy() *HostPort

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new HostPort.

func (*HostPort) DeepCopyInto

func (in *HostPort) DeepCopyInto(out *HostPort)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type LabelName

type LabelName string

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 ManagedIdentity

type ManagedIdentity struct {
	// clientId defines defines the Azure User-assigned Managed identity.
	// +required
	ClientID string `json:"clientId"`
}

ManagedIdentity defines the Azure User-assigned Managed identity. +k8s:openapi-gen=true

func (*ManagedIdentity) DeepCopy

func (in *ManagedIdentity) DeepCopy() *ManagedIdentity

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ManagedIdentity.

func (*ManagedIdentity) DeepCopyInto

func (in *ManagedIdentity) DeepCopyInto(out *ManagedIdentity)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type MetadataConfig

type MetadataConfig struct {
	// send defines whether metric metadata is sent to the remote storage or not.
	// +optional
	Send bool `json:"send,omitempty"`

	// sendInterval defines how frequently metric metadata is sent to the remote storage.
	// +optional
	SendInterval Duration `json:"sendInterval,omitempty"`

	// maxSamplesPerSend defines the maximum number of metadata samples per send.
	//
	// It requires Prometheus >= v2.29.0.
	//
	// +optional
	// +kubebuilder:validation:Minimum=-1
	MaxSamplesPerSend *int32 `json:"maxSamplesPerSend,omitempty"`
}

MetadataConfig configures the sending of series metadata to the remote storage.

+k8s:openapi-gen=true

func (*MetadataConfig) DeepCopy

func (in *MetadataConfig) DeepCopy() *MetadataConfig

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MetadataConfig.

func (*MetadataConfig) DeepCopyInto

func (in *MetadataConfig) DeepCopyInto(out *MetadataConfig)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type NameEscapingSchemeOptions

type NameEscapingSchemeOptions string

Specifies the character escaping scheme that will be applied when scraping for metric and label names that do not conform to the legacy Prometheus character set.

Supported values are:

  • `AllowUTF8`, full UTF-8 support, no escaping needed.
  • `Underscores`, legacy-invalid characters are escaped to underscores.
  • `Dots`, dot characters are escaped to `_dot_`, underscores to `__`, and all other legacy-invalid characters to underscores.
  • `Values`, the string is prefixed by `U__` and all invalid characters are escaped to their unicode value, surrounded by underscores.

+kubebuilder:validation:Enum=AllowUTF8;Underscores;Dots;Values

const (
	AllowUTF8NameEscapingScheme   NameEscapingSchemeOptions = "AllowUTF8"
	UnderscoresNameEscapingScheme NameEscapingSchemeOptions = "Underscores"
	DotsNameEscapingScheme        NameEscapingSchemeOptions = "Dots"
	ValuesNameEscapingScheme      NameEscapingSchemeOptions = "Values"
)

type NameValidationSchemeOptions

type NameValidationSchemeOptions string

Specifies the validation scheme for metric and label names.

Supported values are:

  • `UTF8NameValidationScheme` for UTF-8 support.
  • `LegacyNameValidationScheme` for letters, numbers, colons, and underscores.

Note that `LegacyNameValidationScheme` cannot be used along with the OpenTelemetry `NoUTF8EscapingWithSuffixes` translation strategy (if enabled).

+kubebuilder:validation:Enum=UTF8;Legacy

const (
	UTF8NameValidationScheme   NameValidationSchemeOptions = "UTF8"
	LegacyNameValidationScheme NameValidationSchemeOptions = "Legacy"
)

type NamespaceSelector

type NamespaceSelector struct {
	// any defines the boolean describing whether all namespaces are selected in contrast to a
	// list restricting them.
	// +optional
	Any bool `json:"any,omitempty"`
	// matchNames defines the list of namespace names to select from.
	// +optional
	MatchNames []string `json:"matchNames,omitempty"`
}

NamespaceSelector is a selector for selecting either all namespaces or a list of namespaces. If `any` is true, it takes precedence over `matchNames`. If `matchNames` is empty and `any` is false, it means that the objects are selected from the current namespace. +k8s:openapi-gen=true

func (*NamespaceSelector) DeepCopy

func (in *NamespaceSelector) DeepCopy() *NamespaceSelector

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NamespaceSelector.

func (*NamespaceSelector) DeepCopyInto

func (in *NamespaceSelector) DeepCopyInto(out *NamespaceSelector)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type NativeHistogramConfig

type NativeHistogramConfig struct {
	// 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.
	//
	// +optional
	ScrapeClassicHistograms *bool `json:"scrapeClassicHistograms,omitempty"`

	// 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"`

	// 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"`

	// convertClassicHistogramsToNHCB defines whether to convert all scraped classic histograms into a native histogram with custom buckets.
	// It requires Prometheus >= v3.0.0.
	//
	// +optional
	ConvertClassicHistogramsToNHCB *bool `json:"convertClassicHistogramsToNHCB,omitempty"`
}

NativeHistogramConfig extends the native histogram configuration settings. +k8s:openapi-gen=true

func (*NativeHistogramConfig) DeepCopy

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NativeHistogramConfig.

func (*NativeHistogramConfig) DeepCopyInto

func (in *NativeHistogramConfig) DeepCopyInto(out *NativeHistogramConfig)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type NonEmptyDuration

type NonEmptyDuration string

NonEmptyDuration is a valid time duration that can be parsed by Prometheus model.ParseDuration() function. Compared to Duration, NonEmptyDuration enforces a minimum length of 1. Supported units: y, w, d, h, m, s, ms Examples: `30s`, `1m`, `1h20m15s`, `15d` +kubebuilder:validation:Pattern:="^(0|(([0-9]+)y)?(([0-9]+)w)?(([0-9]+)d)?(([0-9]+)h)?(([0-9]+)m)?(([0-9]+)s)?(([0-9]+)ms)?)$" +kubebuilder:validation:MinLength=1

type OAuth2

type OAuth2 struct {
	// clientId defines a key of a Secret or ConfigMap containing the
	// OAuth2 client's ID.
	// +required
	ClientID SecretOrConfigMap `json:"clientId"`

	// clientSecret defines a key of a Secret containing the OAuth2
	// client's secret.
	// +required
	ClientSecret v1.SecretKeySelector `json:"clientSecret"`

	// 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.
	//
	// +optional.
	Scopes []string `json:"scopes,omitempty"`

	// endpointParams configures the HTTP parameters to append to the token
	// URL.
	//
	// +optional
	EndpointParams map[string]string `json:"endpointParams,omitempty"`

	// tlsConfig defines the TLS configuration to use when connecting to the OAuth2 server.
	// It requires Prometheus >= v2.43.0.
	//
	// +optional
	TLSConfig *SafeTLSConfig `json:"tlsConfig,omitempty"`

	// Proxy configuration to use when connecting to the OAuth2 server.
	// It requires Prometheus >= v2.43.0.
	//
	// +optional
	ProxyConfig `json:",inline"`
}

OAuth2 configures OAuth2 settings.

+k8s:openapi-gen=true

func (*OAuth2) DeepCopy

func (in *OAuth2) DeepCopy() *OAuth2

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new OAuth2.

func (*OAuth2) DeepCopyInto

func (in *OAuth2) DeepCopyInto(out *OAuth2)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*OAuth2) Validate

func (o *OAuth2) Validate() error

type OTLPConfig

type OTLPConfig struct {
	// 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"`

	// 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.
	// +kubebuilder:validation:MinItems=1
	// +kubebuilder:validation:items:MinLength=1
	// +listType=set
	// +optional
	IgnoreResourceAttributes []string `json:"ignoreResourceAttributes,omitempty"`

	// 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
	// +kubebuilder:validation:items:MinLength=1
	// +listType=set
	// +optional
	PromoteResourceAttributes []string `json:"promoteResourceAttributes,omitempty"`

	// translationStrategy defines how the OTLP receiver endpoint translates the incoming metrics.
	//
	// It requires Prometheus >= v3.0.0.
	// +optional
	TranslationStrategy *TranslationStrategyOption `json:"translationStrategy,omitempty"`

	// 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"`

	// 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"`
}

OTLPConfig is the configuration for writing to the OTLP endpoint.

+k8s:openapi-gen=true

func (*OTLPConfig) DeepCopy

func (in *OTLPConfig) DeepCopy() *OTLPConfig

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new OTLPConfig.

func (*OTLPConfig) DeepCopyInto

func (in *OTLPConfig) DeepCopyInto(out *OTLPConfig)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*OTLPConfig) Validate

func (c *OTLPConfig) Validate() error

Validate semantically validates the given OTLPConfig section.

type ObjectReference

type ObjectReference struct {
	// group of the referent. When not specified, it defaults to `monitoring.rhobs`
	// +optional
	// +kubebuilder:default:="monitoring.rhobs"
	// +kubebuilder:validation:Enum=monitoring.rhobs
	Group string `json:"group"`
	// resource of the referent.
	// +required
	// +kubebuilder:validation:Enum=prometheusrules;servicemonitors;podmonitors;probes;scrapeconfigs
	Resource string `json:"resource"`
	// namespace of the referent.
	// More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/
	// +required
	// +kubebuilder:validation:MinLength=1
	Namespace string `json:"namespace"`
	// name of the referent. When not set, all resources in the namespace are matched.
	// +optional
	Name string `json:"name,omitempty"`
}

ObjectReference references a PodMonitor, ServiceMonitor, Probe or PrometheusRule object.

func (*ObjectReference) DeepCopy

func (in *ObjectReference) DeepCopy() *ObjectReference

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ObjectReference.

func (*ObjectReference) DeepCopyInto

func (in *ObjectReference) DeepCopyInto(out *ObjectReference)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*ObjectReference) GroupKind

func (obj *ObjectReference) GroupKind() schema.GroupKind

func (*ObjectReference) GroupResource

func (obj *ObjectReference) GroupResource() schema.GroupResource

type PodDNSConfig

type PodDNSConfig struct {
	// nameservers defines the list of DNS name server IP addresses.
	// This will be appended to the base nameservers generated from DNSPolicy.
	// +optional
	// +listType:=set
	// +kubebuilder:validation:items:MinLength:=1
	Nameservers []string `json:"nameservers,omitempty"`

	// searches defines the list of DNS search domains for host-name lookup.
	// This will be appended to the base search paths generated from DNSPolicy.
	// +optional
	// +listType:=set
	// +kubebuilder:validation:items:MinLength:=1
	Searches []string `json:"searches,omitempty"`

	// 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.
	// +optional
	// +listType=map
	// +listMapKey=name
	Options []PodDNSConfigOption `json:"options,omitempty"`
}

PodDNSConfig defines the DNS parameters of a pod in addition to those generated from DNSPolicy.

func (*PodDNSConfig) DeepCopy

func (in *PodDNSConfig) DeepCopy() *PodDNSConfig

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PodDNSConfig.

func (*PodDNSConfig) DeepCopyInto

func (in *PodDNSConfig) DeepCopyInto(out *PodDNSConfig)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type PodDNSConfigOption

type PodDNSConfigOption struct {
	// name is required and must be unique.
	// +kubebuilder:validation:MinLength=1
	// +required
	Name string `json:"name"`

	// value is optional.
	// +optional
	Value *string `json:"value,omitempty"`
}

PodDNSConfigOption defines DNS resolver options of a pod.

func (*PodDNSConfigOption) DeepCopy

func (in *PodDNSConfigOption) DeepCopy() *PodDNSConfigOption

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PodDNSConfigOption.

func (*PodDNSConfigOption) DeepCopyInto

func (in *PodDNSConfigOption) DeepCopyInto(out *PodDNSConfigOption)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type PodMetricsEndpoint

type PodMetricsEndpoint struct {
	// 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"`

	// portNumber defines the `Pod` port number which exposes the endpoint.
	// +kubebuilder:validation:Minimum=1
	// +kubebuilder:validation:Maximum=65535
	// +optional
	PortNumber *int32 `json:"portNumber,omitempty"`

	// 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"`

	// 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"`

	// 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"`

	// params define optional HTTP URL parameters.
	// +optional
	Params map[string][]string `json:"params,omitempty"`

	// interval at which Prometheus scrapes the metrics from the target.
	//
	// If empty, Prometheus uses the global scrape interval.
	// +optional
	Interval Duration `json:"interval,omitempty"`

	// 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"`

	// honorLabels when true preserves the metric's labels when they collide
	// with the target's labels.
	// +optional
	HonorLabels bool `json:"honorLabels,omitempty"`

	// 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
	// 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"`

	// metricRelabelings defines the relabeling rules to apply to the
	// samples before ingestion.
	//
	// +optional
	MetricRelabelConfigs []RelabelConfig `json:"metricRelabelings,omitempty"`

	// relabelings defines the relabeling rules to apply the target's
	// metadata labels.
	//
	// The 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
	//
	// +optional
	RelabelConfigs []RelabelConfig `json:"relabelings,omitempty"`

	// 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.
	//
	// More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle/#pod-phase
	//
	// +optional
	FilterRunning *bool `json:"filterRunning,omitempty"`

	HTTPConfig `json:",inline"`
}

PodMetricsEndpoint defines an endpoint serving Prometheus metrics to be scraped by Prometheus.

+k8s:openapi-gen=true

func (*PodMetricsEndpoint) DeepCopy

func (in *PodMetricsEndpoint) DeepCopy() *PodMetricsEndpoint

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PodMetricsEndpoint.

func (*PodMetricsEndpoint) DeepCopyInto

func (in *PodMetricsEndpoint) DeepCopyInto(out *PodMetricsEndpoint)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type PodMonitor

type PodMonitor struct {
	// 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"`
	// 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"`
}

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: * The pods to scrape via label selectors. * The container ports to scrape. * Authentication credentials to use. * Target and metric relabeling.

`Prometheus` and `PrometheusAgent` objects select `PodMonitor` objects using label and namespace selectors.

func (*PodMonitor) Bindings

func (l *PodMonitor) Bindings() []WorkloadBinding

func (*PodMonitor) DeepCopy

func (in *PodMonitor) DeepCopy() *PodMonitor

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PodMonitor.

func (*PodMonitor) DeepCopyInto

func (in *PodMonitor) DeepCopyInto(out *PodMonitor)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*PodMonitor) DeepCopyObject

func (l *PodMonitor) DeepCopyObject() runtime.Object

DeepCopyObject implements the runtime.Object interface.

type PodMonitorList

type PodMonitorList struct {
	// TypeMeta defines the versioned schema of this representation of an object.
	// +optional
	metav1.TypeMeta `json:",inline"`
	// metadata defines ListMeta as metadata for collection responses.
	metav1.ListMeta `json:"metadata,omitempty"`
	// List of PodMonitors
	Items []PodMonitor `json:"items"`
}

PodMonitorList is a list of PodMonitors. +k8s:openapi-gen=true

func (*PodMonitorList) DeepCopy

func (in *PodMonitorList) DeepCopy() *PodMonitorList

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PodMonitorList.

func (*PodMonitorList) DeepCopyInto

func (in *PodMonitorList) DeepCopyInto(out *PodMonitorList)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*PodMonitorList) DeepCopyObject

func (l *PodMonitorList) DeepCopyObject() runtime.Object

DeepCopyObject implements the runtime.Object interface.

type PodMonitorSpec

type PodMonitorSpec struct {
	// 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.
	//
	// For example if `jobLabel` is set to `foo` and the Kubernetes `Pod`
	// object is labeled with `foo: bar`, then Prometheus adds the `job="bar"`
	// label to all ingested metrics.
	//
	// 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. `<namespace>/<name>`).
	// +optional
	JobLabel string `json:"jobLabel,omitempty"`

	// podTargetLabels defines the labels which are transferred from the
	// associated Kubernetes `Pod` object onto the ingested metrics.
	//
	// +optional
	PodTargetLabels []string `json:"podTargetLabels,omitempty"`

	// podMetricsEndpoints defines how to scrape metrics from the selected pods.
	//
	// +optional
	PodMetricsEndpoints []PodMetricsEndpoint `json:"podMetricsEndpoints"`

	// selector defines the label selector to select the Kubernetes `Pod` objects to scrape metrics from.
	// +required
	Selector metav1.LabelSelector `json:"selector"`

	// 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.
	//
	// It requires Prometheus >= v2.17.0.
	//
	// +optional
	SelectorMechanism *SelectorMechanism `json:"selectorMechanism,omitempty"`

	// 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
	// that will be accepted.
	//
	// +optional
	SampleLimit *uint64 `json:"sampleLimit,omitempty"`

	// 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
	// protocols supported by Prometheus in order of preference (from most to least preferred).
	//
	// If unset, Prometheus uses its default value.
	//
	// It requires Prometheus >= v2.49.0.
	//
	// +listType=set
	// +optional
	ScrapeProtocols []ScrapeProtocol `json:"scrapeProtocols,omitempty"`

	// 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"`

	// 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"`
	// 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"`
	// 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"`

	NativeHistogramConfig `json:",inline"`

	// 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"`

	// attachMetadata defines additional metadata which is added to the
	// discovered targets.
	//
	// It requires Prometheus >= v2.35.0.
	//
	// +optional
	AttachMetadata *AttachMetadata `json:"attachMetadata,omitempty"`

	// scrapeClass defines the scrape class to apply.
	// +optional
	// +kubebuilder:validation:MinLength=1
	ScrapeClassName *string `json:"scrapeClass,omitempty"`

	// 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.
	//
	// +optional
	BodySizeLimit *ByteSize `json:"bodySizeLimit,omitempty"`
}

PodMonitorSpec contains specification parameters for a PodMonitor. +k8s:openapi-gen=true

func (*PodMonitorSpec) DeepCopy

func (in *PodMonitorSpec) DeepCopy() *PodMonitorSpec

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PodMonitorSpec.

func (*PodMonitorSpec) DeepCopyInto

func (in *PodMonitorSpec) DeepCopyInto(out *PodMonitorSpec)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type Probe

type Probe struct {
	// 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"`
	// 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"`
}

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).

The `Probe` resource needs 2 pieces of information: * The list of probed addresses which can be defined statically or by discovering Kubernetes Ingress objects. * The prober which exposes the availability of probed endpoints (over various protocols such HTTP, TCP, ICMP, ...) as Prometheus metrics.

`Prometheus` and `PrometheusAgent` objects select `Probe` objects using label and namespace selectors.

func (*Probe) Bindings

func (l *Probe) Bindings() []WorkloadBinding

func (*Probe) DeepCopy

func (in *Probe) DeepCopy() *Probe

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Probe.

func (*Probe) DeepCopyInto

func (in *Probe) DeepCopyInto(out *Probe)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*Probe) DeepCopyObject

func (l *Probe) DeepCopyObject() runtime.Object

DeepCopyObject implements the runtime.Object interface.

type ProbeList

type ProbeList struct {
	// TypeMeta defines the versioned schema of this representation of an object.
	// +optional
	metav1.TypeMeta `json:",inline"`
	// metadata defines ListMeta as metadata for collection responses.
	// +optional
	metav1.ListMeta `json:"metadata,omitempty"`
	// List of Probes
	// +required
	Items []Probe `json:"items"`
}

ProbeList is a list of Probes. +k8s:openapi-gen=true

func (*ProbeList) DeepCopy

func (in *ProbeList) DeepCopy() *ProbeList

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ProbeList.

func (*ProbeList) DeepCopyInto

func (in *ProbeList) DeepCopyInto(out *ProbeList)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*ProbeList) DeepCopyObject

func (l *ProbeList) DeepCopyObject() runtime.Object

DeepCopyObject implements the runtime.Object interface.

type ProbeParam

type ProbeParam struct {
	// name defines the parameter name
	// +kubebuilder:validation:MinLength=1
	// +required
	Name string `json:"name,omitempty"`
	// values defines the parameter values
	// +kubebuilder:validation:MinItems=1
	// +kubebuilder:validation:items:MinLength=1
	// +optional
	Values []string `json:"values,omitempty"`
}

ProbeParam defines specification of extra parameters for a Probe. +k8s:openapi-gen=true

func (*ProbeParam) DeepCopy

func (in *ProbeParam) DeepCopy() *ProbeParam

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ProbeParam.

func (*ProbeParam) DeepCopyInto

func (in *ProbeParam) DeepCopyInto(out *ProbeParam)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type ProbeSpec

type ProbeSpec struct {
	// jobName assigned to scraped metrics by default.
	// +optional
	JobName string `json:"jobName,omitempty"`
	// 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"`
	// 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.
	// +optional
	Targets ProbeTargets `json:"targets,omitempty"`
	// 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"`
	// 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"`
	// tlsConfig defines the TLS configuration to use when scraping the endpoint.
	// +optional
	TLSConfig *SafeTLSConfig `json:"tlsConfig,omitempty"`
	// 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.
	// 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.
	// +optional
	OAuth2 *OAuth2 `json:"oauth2,omitempty"`
	// metricRelabelings defines the RelabelConfig to apply to samples before ingestion.
	// +optional
	MetricRelabelConfigs []RelabelConfig `json:"metricRelabelings,omitempty"`
	// 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.
	// +optional
	SampleLimit *uint64 `json:"sampleLimit,omitempty"`
	// 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
	// protocols supported by Prometheus in order of preference (from most to least preferred).
	//
	// If unset, Prometheus uses its default value.
	//
	// It requires Prometheus >= v2.49.0.
	//
	// +listType=set
	// +optional
	ScrapeProtocols []ScrapeProtocol `json:"scrapeProtocols,omitempty"`
	// 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"`
	// 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"`
	// 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"`
	// 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"`
	// 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"`

	// scrapeClass defines the scrape class to apply.
	// +optional
	// +kubebuilder:validation:MinLength=1
	ScrapeClassName *string `json:"scrapeClass,omitempty"`

	// 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
	// +kubebuilder:validation:MinItems=1
	// +listType=map
	// +listMapKey=name
	Params []ProbeParam `json:"params,omitempty"`
}

ProbeSpec contains specification parameters for a Probe. +k8s:openapi-gen=true

func (*ProbeSpec) DeepCopy

func (in *ProbeSpec) DeepCopy() *ProbeSpec

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ProbeSpec.

func (*ProbeSpec) DeepCopyInto

func (in *ProbeSpec) DeepCopyInto(out *ProbeSpec)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type ProbeTargetIngress

type ProbeTargetIngress struct {
	// selector to select the Ingress objects.
	// +optional
	Selector metav1.LabelSelector `json:"selector,omitempty"`
	// namespaceSelector defines from which namespaces to select Ingress objects.
	// +optional
	NamespaceSelector NamespaceSelector `json:"namespaceSelector,omitempty"`
	// 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"`
}

ProbeTargetIngress defines the set of Ingress objects considered for probing. The operator configures a target for each host/path combination of each ingress object. +k8s:openapi-gen=true

func (*ProbeTargetIngress) DeepCopy

func (in *ProbeTargetIngress) DeepCopy() *ProbeTargetIngress

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ProbeTargetIngress.

func (*ProbeTargetIngress) DeepCopyInto

func (in *ProbeTargetIngress) DeepCopyInto(out *ProbeTargetIngress)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type ProbeTargetStaticConfig

type ProbeTargetStaticConfig struct {
	// static defines the list of hosts to probe.
	// +optional
	Targets []string `json:"static,omitempty"`
	// labels defines all labels assigned to all metrics scraped from the targets.
	// +optional
	Labels map[string]string `json:"labels,omitempty"`
	// 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"`
}

ProbeTargetStaticConfig defines the set of static targets considered for probing. +k8s:openapi-gen=true

func (*ProbeTargetStaticConfig) DeepCopy

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ProbeTargetStaticConfig.

func (*ProbeTargetStaticConfig) DeepCopyInto

func (in *ProbeTargetStaticConfig) DeepCopyInto(out *ProbeTargetStaticConfig)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type ProbeTargets

type ProbeTargets struct {
	// staticConfig defines the static list of targets to probe and the
	// 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"`
}

ProbeTargets defines how to discover the probed targets. One of the `staticConfig` or `ingress` must be defined. If both are defined, `staticConfig` takes precedence. +k8s:openapi-gen=true

func (*ProbeTargets) DeepCopy

func (in *ProbeTargets) DeepCopy() *ProbeTargets

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ProbeTargets.

func (*ProbeTargets) DeepCopyInto

func (in *ProbeTargets) DeepCopyInto(out *ProbeTargets)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*ProbeTargets) Validate

func (it *ProbeTargets) Validate() error

Validate semantically validates the given ProbeTargets.

type ProberSpec

type ProberSpec struct {
	// url defines the mandatory URL of the prober.
	// +required
	URL string `json:"url"`
	// 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.
	// Defaults to `/probe`.
	// +kubebuilder:default:="/probe"
	// +optional
	Path string `json:"path,omitempty"`

	// +optional
	ProxyConfig `json:",inline"`
}

ProberSpec contains specification parameters for the Prober used for probing. +k8s:openapi-gen=true

func (*ProberSpec) DeepCopy

func (in *ProberSpec) DeepCopy() *ProberSpec

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ProberSpec.

func (*ProberSpec) DeepCopyInto

func (in *ProberSpec) DeepCopyInto(out *ProberSpec)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type Prometheus

type Prometheus struct {
	// 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 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"`
	// 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"`
}

The `Prometheus` custom resource definition (CRD) defines a desired Prometheus(https://prometheus.io/docs/prometheus) setup to run in a Kubernetes cluster. It allows to specify many options such as the number of replicas, persistent storage, and Alertmanagers where firing alerts should be sent and many more.

For each `Prometheus` resource, the Operator deploys one or several `StatefulSet` objects in the same namespace. The number of StatefulSets is equal to the number of shards which is 1 by default.

The resource defines via label and namespace selectors which `ServiceMonitor`, `PodMonitor`, `Probe` and `PrometheusRule` objects should be associated to the deployed Prometheus instances.

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.

func (*Prometheus) DeepCopy

func (in *Prometheus) DeepCopy() *Prometheus

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Prometheus.

func (*Prometheus) DeepCopyInto

func (in *Prometheus) DeepCopyInto(out *Prometheus)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*Prometheus) DeepCopyObject

func (l *Prometheus) DeepCopyObject() runtime.Object

DeepCopyObject implements the runtime.Object interface.

func (*Prometheus) GetCommonPrometheusFields

func (l *Prometheus) GetCommonPrometheusFields() CommonPrometheusFields

func (*Prometheus) GetStatus

func (l *Prometheus) GetStatus() PrometheusStatus

func (*Prometheus) SetCommonPrometheusFields

func (l *Prometheus) SetCommonPrometheusFields(f CommonPrometheusFields)

type PrometheusInterface

type PrometheusInterface interface {
	metav1.ObjectMetaAccessor
	schema.ObjectKind

	GetCommonPrometheusFields() CommonPrometheusFields
	SetCommonPrometheusFields(CommonPrometheusFields)

	GetStatus() PrometheusStatus
}

PrometheusInterface is used by Prometheus and PrometheusAgent to share common methods, e.g. config generation. +k8s:deepcopy-gen=false

type PrometheusList

type PrometheusList struct {
	// TypeMeta defines the versioned schema of this representation of an object.
	// +optional
	metav1.TypeMeta `json:",inline"`
	// metadata defines ListMeta as metadata for collection responses.
	// +optional
	metav1.ListMeta `json:"metadata,omitempty"`
	// List of Prometheuses
	Items []Prometheus `json:"items"`
}

PrometheusList is a list of Prometheuses. +k8s:openapi-gen=true

func (*PrometheusList) DeepCopy

func (in *PrometheusList) DeepCopy() *PrometheusList

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PrometheusList.

func (*PrometheusList) DeepCopyInto

func (in *PrometheusList) DeepCopyInto(out *PrometheusList)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*PrometheusList) DeepCopyObject

func (l *PrometheusList) DeepCopyObject() runtime.Object

DeepCopyObject implements the runtime.Object interface.

type PrometheusRule

type PrometheusRule struct {
	// 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 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"`
}

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.

func (*PrometheusRule) DeepCopy

func (in *PrometheusRule) DeepCopy() *PrometheusRule

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PrometheusRule.

func (*PrometheusRule) DeepCopyInto

func (in *PrometheusRule) DeepCopyInto(out *PrometheusRule)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*PrometheusRule) DeepCopyObject

func (f *PrometheusRule) DeepCopyObject() runtime.Object

DeepCopyObject implements the runtime.Object interface.

type PrometheusRuleExcludeConfig

type PrometheusRuleExcludeConfig struct {
	// ruleNamespace defines the namespace of the excluded PrometheusRule object.
	// +required
	RuleNamespace string `json:"ruleNamespace"`
	// ruleName defines the name of the excluded PrometheusRule object.
	// +required
	RuleName string `json:"ruleName"`
}

PrometheusRuleExcludeConfig enables users to configure excluded PrometheusRule names and their namespaces to be ignored while enforcing namespace label for alerts and metrics.

func (*PrometheusRuleExcludeConfig) DeepCopy

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PrometheusRuleExcludeConfig.

func (*PrometheusRuleExcludeConfig) DeepCopyInto

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type PrometheusRuleList

type PrometheusRuleList struct {
	// TypeMeta defines the versioned schema of this representation of an object.
	metav1.TypeMeta `json:",inline"`
	// metadata defines ListMeta as metadata for collection responses.
	// +optional
	metav1.ListMeta `json:"metadata,omitempty"`
	// List of Rules
	// +required
	Items []PrometheusRule `json:"items"`
}

PrometheusRuleList is a list of PrometheusRules. +k8s:openapi-gen=true

func (*PrometheusRuleList) DeepCopy

func (in *PrometheusRuleList) DeepCopy() *PrometheusRuleList

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PrometheusRuleList.

func (*PrometheusRuleList) DeepCopyInto

func (in *PrometheusRuleList) DeepCopyInto(out *PrometheusRuleList)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*PrometheusRuleList) DeepCopyObject

func (l *PrometheusRuleList) DeepCopyObject() runtime.Object

DeepCopyObject implements the runtime.Object interface.

type PrometheusRuleSpec

type PrometheusRuleSpec struct {
	// groups defines the content of Prometheus rule file
	// +listType=map
	// +listMapKey=name
	// +optional
	Groups []RuleGroup `json:"groups,omitempty"`
}

PrometheusRuleSpec contains specification parameters for a Rule. +k8s:openapi-gen=true

func (*PrometheusRuleSpec) DeepCopy

func (in *PrometheusRuleSpec) DeepCopy() *PrometheusRuleSpec

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PrometheusRuleSpec.

func (*PrometheusRuleSpec) DeepCopyInto

func (in *PrometheusRuleSpec) DeepCopyInto(out *PrometheusRuleSpec)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type PrometheusSpec

type PrometheusSpec struct {
	// +optional
	CommonPrometheusFields `json:",inline"`

	// baseImage is deprecated: use 'spec.image' instead.
	// +optional
	BaseImage string `json:"baseImage,omitempty"`
	// 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"`
	// 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"`

	// 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"`
	// 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.
	// (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/rhobs/obo-prometheus-operator/blob/main/Documentation/proposals/202310-shard-autoscaling.md#graceful-scale-down-of-prometheus-servers,
	// however, the feature is not yet fully implemented in this PR. The limitation being:
	// * Retention duration is not settable, for now, shards are retained forever.
	//
	// +optional
	ShardRetentionPolicy *ShardRetentionPolicy `json:"shardRetentionPolicy,omitempty"`

	// 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"`

	// rules defines the configuration of the Prometheus rules' engine.
	// +optional
	Rules Rules `json:"rules,omitempty"`
	// 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"`
	// 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"`
	// 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"`

	// query defines the configuration of the Prometheus query service.
	// +optional
	Query *QuerySpec `json:"query,omitempty"`

	// alerting defines the settings related to Alertmanager.
	// +optional
	Alerting *AlertingSpec `json:"alerting,omitempty"`
	// 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
	// Prometheus documentation:
	//
	// https://prometheus.io/docs/prometheus/latest/configuration/configuration/#alert_relabel_configs
	//
	// The user is responsible for making sure that the configurations are valid
	//
	// Note that using this feature may expose the possibility to break
	// upgrades of Prometheus. It is advised to review Prometheus release notes
	// to ensure that no incompatible alert relabel configs are going to break
	// Prometheus after the upgrade.
	// +optional
	AdditionalAlertRelabelConfigs *v1.SecretKeySelector `json:"additionalAlertRelabelConfigs,omitempty"`
	// 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
	// Prometheus documentation:
	//
	// https://prometheus.io/docs/prometheus/latest/configuration/configuration/#alertmanager_config
	//
	// The user is responsible for making sure that the configurations are valid
	//
	// Note that using this feature may expose the possibility to break
	// upgrades of Prometheus. It is advised to review Prometheus release notes
	// to ensure that no incompatible AlertManager configs are going to break
	// Prometheus after the upgrade.
	// +optional
	AdditionalAlertManagerConfigs *v1.SecretKeySelector `json:"additionalAlertManagerConfigs,omitempty"`

	// remoteRead defines the list of remote read configurations.
	// +optional
	RemoteRead []RemoteReadSpec `json:"remoteRead,omitempty"`

	// thanos defines the configuration of the optional Thanos sidecar.
	//
	// +optional
	Thanos *ThanosSpec `json:"thanos,omitempty"`

	// queryLogFile specifies where the file to which PromQL queries are logged.
	//
	// If the filename has an empty path, e.g. 'query.log', The Prometheus Pods
	// will mount the file into an emptyDir volume at `/var/log/prometheus`.
	// If a full path is provided, e.g. '/var/log/prometheus/query.log', you
	// must mount a volume in the specified directory and it must be writable.
	// This is because the prometheus container runs with a read-only root
	// filesystem for security reasons.
	// 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
	// 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.
	// It requires to enable the `exemplar-storage` feature flag to be effective.
	// +optional
	Exemplars *Exemplars `json:"exemplars,omitempty"`

	// evaluationInterval defines the interval between rule evaluations.
	// Default: "30s"
	// +kubebuilder:default:="30s"
	// +optional
	EvaluationInterval Duration `json:"evaluationInterval,omitempty"`

	// 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"`

	// 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
	// user is advised to add additional authentication authorization via a proxy to
	// ensure only clients authorized to perform these actions can do so.
	//
	// For more information:
	// https://prometheus.io/docs/prometheus/latest/querying/api/#tsdb-admin-apis
	// +optional
	EnableAdminAPI bool `json:"enableAdminAPI,omitempty"`
}

PrometheusSpec is a 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 +k8s:openapi-gen=true

func (*PrometheusSpec) DeepCopy

func (in *PrometheusSpec) DeepCopy() *PrometheusSpec

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PrometheusSpec.

func (*PrometheusSpec) DeepCopyInto

func (in *PrometheusSpec) DeepCopyInto(out *PrometheusSpec)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type PrometheusStatus

type PrometheusStatus struct {
	// paused defines whether any actions on the underlying managed objects are
	// being performed. Only delete actions will be performed.
	// +optional
	Paused bool `json:"paused"`
	// replicas defines the total number of non-terminated pods targeted by this Prometheus deployment
	// (their labels match the selector).
	// +optional
	Replicas int32 `json:"replicas"`
	// 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"`
	// availableReplicas defines the total number of available pods (ready for at least minReadySeconds)
	// targeted by this Prometheus deployment.
	// +optional
	AvailableReplicas int32 `json:"availableReplicas"`
	// unavailableReplicas defines the total number of unavailable pods targeted by this Prometheus deployment.
	// +optional
	UnavailableReplicas int32 `json:"unavailableReplicas"`
	// conditions defines the current state of the Prometheus deployment.
	// +listType=map
	// +listMapKey=type
	// +optional
	Conditions []Condition `json:"conditions,omitempty"`
	// 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 defines the most recently observed number of shards.
	// +optional
	Shards int32 `json:"shards,omitempty"`
	// selector used to match the pods targeted by this Prometheus resource.
	// +optional
	Selector string `json:"selector,omitempty"`
}

PrometheusStatus is the most recent observed status of the Prometheus cluster. More info: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#spec-and-status +k8s:openapi-gen=true

func (*PrometheusStatus) DeepCopy

func (in *PrometheusStatus) DeepCopy() *PrometheusStatus

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PrometheusStatus.

func (*PrometheusStatus) DeepCopyInto

func (in *PrometheusStatus) DeepCopyInto(out *PrometheusStatus)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type PrometheusTracingConfig

type PrometheusTracingConfig struct {
	// 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 <host>:<port>.
	// +kubebuilder:validation:MinLength:=1
	// +required
	Endpoint string `json:"endpoint"`

	// samplingFraction defines the probability a given trace will be sampled. Must be a float from 0 through 1.
	// +optional
	SamplingFraction *resource.Quantity `json:"samplingFraction"`

	// insecure if disabled, the client will use a secure connection.
	// +optional
	Insecure *bool `json:"insecure"`

	// 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`.
	// +kubebuilder:validation:Enum=gzip
	// +optional
	Compression *string `json:"compression"`

	// timeout defines the maximum time the exporter will wait for each batch export.
	// +optional
	Timeout *Duration `json:"timeout"`

	// tlsConfig to use when sending traces.
	// +optional
	TLSConfig *TLSConfig `json:"tlsConfig"`
}

func (*PrometheusTracingConfig) DeepCopy

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PrometheusTracingConfig.

func (*PrometheusTracingConfig) DeepCopyInto

func (in *PrometheusTracingConfig) DeepCopyInto(out *PrometheusTracingConfig)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type PrometheusWebSpec

type PrometheusWebSpec struct {
	// +optional
	WebConfigFileFields `json:",inline"`
	// pageTitle defines the prometheus web page title.
	// +optional
	PageTitle *string `json:"pageTitle,omitempty"`

	// 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
	MaxConnections *int32 `json:"maxConnections,omitempty"`
}

PrometheusWebSpec defines the configuration of the Prometheus web server. +k8s:openapi-gen=true

func (*PrometheusWebSpec) DeepCopy

func (in *PrometheusWebSpec) DeepCopy() *PrometheusWebSpec

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PrometheusWebSpec.

func (*PrometheusWebSpec) DeepCopyInto

func (in *PrometheusWebSpec) DeepCopyInto(out *PrometheusWebSpec)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type ProxyConfig

type ProxyConfig struct {
	// proxyUrl defines the HTTP proxy server to use.
	//
	// +kubebuilder:validation:Pattern:="^(http|https|socks5)://.+$"
	// +optional
	ProxyURL *string `json:"proxyUrl,omitempty"`
	// 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"`
	// 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
	// proxies during CONNECT requests.
	//
	// It requires Prometheus >= v2.43.0, Alertmanager >= v0.25.0 or Thanos >= v0.32.0.
	// +optional
	// +mapType:=atomic
	ProxyConnectHeader map[string][]v1.SecretKeySelector `json:"proxyConnectHeader,omitempty"`
}

func (*ProxyConfig) DeepCopy

func (in *ProxyConfig) DeepCopy() *ProxyConfig

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ProxyConfig.

func (*ProxyConfig) DeepCopyInto

func (in *ProxyConfig) DeepCopyInto(out *ProxyConfig)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*ProxyConfig) Validate

func (pc *ProxyConfig) Validate() error

Validate semantically validates the given ProxyConfig.

type QuerySpec

type QuerySpec struct {
	// lookbackDelta defines the delta difference allowed for retrieving metrics during expression evaluations.
	// +optional
	LookbackDelta *string `json:"lookbackDelta,omitempty"`
	// maxConcurrency defines the number of concurrent queries that can be run at once.
	// +kubebuilder:validation:Minimum:=1
	// +optional
	MaxConcurrency *int32 `json:"maxConcurrency,omitempty"`
	// 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"`
	// timeout defines the maximum time a query may take before being aborted.
	// +optional
	Timeout *Duration `json:"timeout,omitempty"`
}

QuerySpec defines the query command line flags when starting Prometheus. +k8s:openapi-gen=true

func (*QuerySpec) DeepCopy

func (in *QuerySpec) DeepCopy() *QuerySpec

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new QuerySpec.

func (*QuerySpec) DeepCopyInto

func (in *QuerySpec) DeepCopyInto(out *QuerySpec)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type QueueConfig

type QueueConfig struct {
	// capacity defines the number of samples to buffer per shard before we start
	// dropping them.
	// +optional
	Capacity int `json:"capacity,omitempty"`
	// minShards defines the minimum number of shards, i.e. amount of concurrency.
	// +optional
	MinShards int `json:"minShards,omitempty"`
	// maxShards defines the maximum number of shards, i.e. amount of concurrency.
	// +optional
	MaxShards int `json:"maxShards,omitempty"`
	// maxSamplesPerSend defines the maximum number of samples per send.
	// +optional
	MaxSamplesPerSend int `json:"maxSamplesPerSend,omitempty"`
	// batchSendDeadline defines the maximum time a sample will wait in buffer.
	// +optional
	BatchSendDeadline *Duration `json:"batchSendDeadline,omitempty"`
	// maxRetries defines the maximum number of times to retry a batch on recoverable errors.
	// +optional
	MaxRetries int `json:"maxRetries,omitempty"`
	// minBackoff defines the initial retry delay. Gets doubled for every retry.
	// +optional
	MinBackoff *Duration `json:"minBackoff,omitempty"`
	// maxBackoff defines the maximum retry delay.
	// +optional
	MaxBackoff *Duration `json:"maxBackoff,omitempty"`
	// 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.
	// It requires Prometheus >= v2.50.0 or Thanos >= v0.32.0.
	//
	// +optional
	SampleAgeLimit *Duration `json:"sampleAgeLimit,omitempty"`
}

QueueConfig allows the tuning of remote write's queue_config parameters. This object is referenced in the RemoteWriteSpec object. +k8s:openapi-gen=true

func (*QueueConfig) DeepCopy

func (in *QueueConfig) DeepCopy() *QueueConfig

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new QueueConfig.

func (*QueueConfig) DeepCopyInto

func (in *QueueConfig) DeepCopyInto(out *QueueConfig)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type RelabelConfig

type RelabelConfig struct {
	// 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 defines the string between concatenated SourceLabels.
	// +optional
	Separator *string `json:"separator,omitempty"`

	// 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"`

	// 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.
	//
	// Only applicable when the action is `HashMod`.
	// +optional
	Modulus uint64 `json:"modulus,omitempty"`

	// replacement value against which a Replace action is performed if the
	// regular expression matches.
	//
	// Regex capture groups are available.
	//
	// +optional
	Replacement *string `json:"replacement,omitempty"`

	// 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.
	//
	// Default: "Replace"
	//
	// +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"`
}

RelabelConfig allows dynamic rewriting of the label set for targets, alerts, scraped samples and remote write samples.

More info: https://prometheus.io/docs/prometheus/latest/configuration/configuration/#relabel_config

+k8s:openapi-gen=true

func (*RelabelConfig) DeepCopy

func (in *RelabelConfig) DeepCopy() *RelabelConfig

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RelabelConfig.

func (*RelabelConfig) DeepCopyInto

func (in *RelabelConfig) DeepCopyInto(out *RelabelConfig)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type ReloadStrategyType

type ReloadStrategyType string

+kubebuilder:validation:Enum=HTTP;ProcessSignal

const (
	// HTTPReloadStrategyType reloads the configuration using the /-/reload HTTP endpoint.
	HTTPReloadStrategyType ReloadStrategyType = "HTTP"

	// ProcessSignalReloadStrategyType reloads the configuration by sending a SIGHUP signal to the process.
	ProcessSignalReloadStrategyType ReloadStrategyType = "ProcessSignal"
)

type RemoteReadSpec

type RemoteReadSpec struct {
	// url defines the URL of the endpoint to query from.
	// +required
	URL string `json:"url"`

	// 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"`

	// 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"`

	// remoteTimeout defines the timeout for requests to the remote read endpoint.
	// +optional
	RemoteTimeout *Duration `json:"remoteTimeout,omitempty"`

	// 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"`

	// 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.
	//
	// It requires Prometheus >= v2.27.0.
	//
	// Cannot be set at the same time as `authorization`, or `basicAuth`.
	//
	// +optional
	OAuth2 *OAuth2 `json:"oauth2,omitempty"`
	// basicAuth configuration for the URL.
	//
	// Cannot be set at the same time as `authorization`, or `oauth2`.
	//
	// +optional
	BasicAuth *BasicAuth `json:"basicAuth,omitempty"`
	// 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.
	//
	// It requires Prometheus >= v2.26.0.
	//
	// Cannot be set at the same time as `basicAuth`, or `oauth2`.
	//
	// +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`.*
	//
	// +optional
	BearerToken string `json:"bearerToken,omitempty"`

	// tlsConfig to use for the URL.
	// +optional
	TLSConfig *TLSConfig `json:"tlsConfig,omitempty"`

	// Optional ProxyConfig.
	// +optional
	ProxyConfig `json:",inline"`

	// followRedirects defines whether HTTP requests follow HTTP 3xx redirects.
	//
	// It requires Prometheus >= v2.26.0.
	//
	// +optional
	FollowRedirects *bool `json:"followRedirects,omitempty"`

	// filterExternalLabels defines whether to use the external labels as selectors for the remote read endpoint.
	//
	// It requires Prometheus >= v2.34.0.
	//
	// +optional
	FilterExternalLabels *bool `json:"filterExternalLabels,omitempty"`
}

RemoteReadSpec defines the configuration for Prometheus to read back samples from a remote endpoint. +k8s:openapi-gen=true

func (*RemoteReadSpec) DeepCopy

func (in *RemoteReadSpec) DeepCopy() *RemoteReadSpec

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RemoteReadSpec.

func (*RemoteReadSpec) DeepCopyInto

func (in *RemoteReadSpec) DeepCopyInto(out *RemoteReadSpec)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type RemoteWriteMessageVersion

type RemoteWriteMessageVersion string

+kubebuilder:validation:Enum=V1.0;V2.0

type RemoteWriteSpec

type RemoteWriteSpec struct {
	// url defines the URL of the endpoint to send samples to.
	// +kubebuilder:validation:MinLength=1
	// +required
	URL string `json:"url"`

	// 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
	Name *string `json:"name,omitempty"`

	// 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.
	//
	// When `Version2.0` is selected, Prometheus will automatically be
	// configured to append the metadata of scraped metrics to the WAL.
	//
	// Before setting this field, consult with your remote storage provider
	// what message version it supports.
	//
	// It requires Prometheus >= v2.54.0 or Thanos >= v0.37.0.
	//
	// +optional
	MessageVersion *RemoteWriteMessageVersion `json:"messageVersion,omitempty"`

	// 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.
	//
	// It requires Prometheus >= v2.27.0 or Thanos >= v0.24.0.
	//
	// +optional
	SendExemplars *bool `json:"sendExemplars,omitempty"`

	// 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.
	//
	// +optional
	SendNativeHistograms *bool `json:"sendNativeHistograms,omitempty"`

	// remoteTimeout defines the timeout for requests to the remote write endpoint.
	// +optional
	RemoteTimeout *Duration `json:"remoteTimeout,omitempty"`

	// 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.
	//
	// +optional
	Headers map[string]string `json:"headers,omitempty"`

	// writeRelabelConfigs defines the list of remote write relabel configurations.
	// +optional
	WriteRelabelConfigs []RelabelConfig `json:"writeRelabelConfigs,omitempty"`

	// oauth2 configuration for the URL.
	//
	// It requires Prometheus >= v2.27.0 or Thanos >= v0.24.0.
	//
	// Cannot be set at the same time as `sigv4`, `authorization`, `basicAuth`, or `azureAd`.
	// +optional
	OAuth2 *OAuth2 `json:"oauth2,omitempty"`

	// basicAuth configuration for the URL.
	//
	// Cannot be set at the same time as `sigv4`, `authorization`, `oauth2`, or `azureAd`.
	//
	// +optional
	BasicAuth *BasicAuth `json:"basicAuth,omitempty"`

	// 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.
	//
	// It requires Prometheus >= v2.26.0 or Thanos >= v0.24.0.
	//
	// Cannot be set at the same time as `sigv4`, `basicAuth`, `oauth2`, or `azureAd`.
	//
	// +optional
	Authorization *Authorization `json:"authorization,omitempty"`

	// sigv4 defines the AWS's Signature Verification 4 for the URL.
	//
	// It requires Prometheus >= v2.26.0 or Thanos >= v0.24.0.
	//
	// Cannot be set at the same time as `authorization`, `basicAuth`, `oauth2`, or `azureAd`.
	//
	// +optional
	Sigv4 *Sigv4 `json:"sigv4,omitempty"`

	// azureAd for the URL.
	//
	// It requires Prometheus >= v2.45.0 or Thanos >= v0.31.0.
	//
	// Cannot be set at the same time as `authorization`, `basicAuth`, `oauth2`, or `sigv4`.
	//
	// +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`.*
	//
	// +optional
	BearerToken string `json:"bearerToken,omitempty"`

	// tlsConfig to use for the URL.
	// +optional
	TLSConfig *TLSConfig `json:"tlsConfig,omitempty"`

	// Optional ProxyConfig.
	// +optional
	ProxyConfig `json:",inline"`

	// 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.
	// +optional
	QueueConfig *QueueConfig `json:"queueConfig,omitempty"`

	// metadataConfig defines how to send a series metadata to the remote storage.
	// +optional
	MetadataConfig *MetadataConfig `json:"metadataConfig,omitempty"`

	// 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.
	//
	// When disabled (default behavior):
	//   - 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.
	//
	// It requires Prometheus >= v3.1.0 or Thanos >= v0.38.0.
	//
	// +optional
	RoundRobinDNS *bool `json:"roundRobinDNS,omitempty"`
}

RemoteWriteSpec defines the configuration to write samples from Prometheus to a remote endpoint. +k8s:openapi-gen=true

func (*RemoteWriteSpec) DeepCopy

func (in *RemoteWriteSpec) DeepCopy() *RemoteWriteSpec

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RemoteWriteSpec.

func (*RemoteWriteSpec) DeepCopyInto

func (in *RemoteWriteSpec) DeepCopyInto(out *RemoteWriteSpec)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type RetainConfig

type RetainConfig struct {
	// retentionPeriod defines the retentionPeriod for shard retention policy.
	// +required
	RetentionPeriod Duration `json:"retentionPeriod"`
}

func (*RetainConfig) DeepCopy

func (in *RetainConfig) DeepCopy() *RetainConfig

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RetainConfig.

func (*RetainConfig) DeepCopyInto

func (in *RetainConfig) DeepCopyInto(out *RetainConfig)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type Rule

type Rule struct {
	// 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"`
	// 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"`
	// expr defines the PromQL expression to evaluate.
	// +required
	Expr intstr.IntOrString `json:"expr"`
	// for defines how alerts are considered firing once they have been returned for this long.
	// +optional
	For *Duration `json:"for,omitempty"`
	// 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 defines labels to add or overwrite.
	// +optional
	Labels map[string]string `json:"labels,omitempty"`
	// annotations defines annotations to add to each alert.
	// Only valid for alerting rules.
	// +optional
	Annotations map[string]string `json:"annotations,omitempty"`
}

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

func (*Rule) DeepCopy

func (in *Rule) DeepCopy() *Rule

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Rule.

func (*Rule) DeepCopyInto

func (in *Rule) DeepCopyInto(out *Rule)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type RuleGroup

type RuleGroup struct {
	// name defines the name of the rule group.
	// +kubebuilder:validation:MinLength=1
	// +required
	Name string `json:"name"`
	// 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 defines how often rules in the group are evaluated.
	// +optional
	Interval *Duration `json:"interval,omitempty"`
	// 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"`
	// rules defines the list of alerting and recording rules.
	// +optional
	Rules []Rule `json:"rules,omitempty"`
	// 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 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
	Limit *int `json:"limit,omitempty"`
}

RuleGroup is a list of sequentially evaluated recording and alerting rules. +k8s:openapi-gen=true

func (*RuleGroup) DeepCopy

func (in *RuleGroup) DeepCopy() *RuleGroup

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RuleGroup.

func (*RuleGroup) DeepCopyInto

func (in *RuleGroup) DeepCopyInto(out *RuleGroup)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type Rules

type Rules struct {
	// 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

func (*Rules) DeepCopy

func (in *Rules) DeepCopy() *Rules

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Rules.

func (*Rules) DeepCopyInto

func (in *Rules) DeepCopyInto(out *Rules)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type RulesAlert

type RulesAlert struct {
	// forOutageTolerance defines the max time to tolerate prometheus outage for restoring 'for' state of
	// alert.
	// +optional
	ForOutageTolerance string `json:"forOutageTolerance,omitempty"`

	// 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"`

	// resendDelay defines the minimum amount of time to wait before resending an alert to
	// Alertmanager.
	// +optional
	ResendDelay string `json:"resendDelay,omitempty"`
}

+k8s:openapi-gen=true

func (*RulesAlert) DeepCopy

func (in *RulesAlert) DeepCopy() *RulesAlert

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RulesAlert.

func (*RulesAlert) DeepCopyInto

func (in *RulesAlert) DeepCopyInto(out *RulesAlert)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type RuntimeConfig

type RuntimeConfig struct {
	// 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
	GoGC *int32 `json:"goGC,omitempty"`
}

RuntimeConfig configures the values for the process behavior.

func (*RuntimeConfig) DeepCopy

func (in *RuntimeConfig) DeepCopy() *RuntimeConfig

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RuntimeConfig.

func (*RuntimeConfig) DeepCopyInto

func (in *RuntimeConfig) DeepCopyInto(out *RuntimeConfig)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type SafeAuthorization

type SafeAuthorization struct {
	// type defines the authentication type. The value is case-insensitive.
	//
	// "Basic" is not a supported value.
	//
	// Default: "Bearer"
	// +optional
	Type string `json:"type,omitempty"`

	// credentials defines a key of a Secret in the namespace that contains the credentials for authentication.
	// +optional
	Credentials *v1.SecretKeySelector `json:"credentials,omitempty"`
}

SafeAuthorization specifies a subset of the Authorization struct, that is safe for use because it doesn't provide access to the Prometheus container's filesystem.

+k8s:openapi-gen=true

func (*SafeAuthorization) DeepCopy

func (in *SafeAuthorization) DeepCopy() *SafeAuthorization

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SafeAuthorization.

func (*SafeAuthorization) DeepCopyInto

func (in *SafeAuthorization) DeepCopyInto(out *SafeAuthorization)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*SafeAuthorization) Validate

func (c *SafeAuthorization) Validate() error

Validate semantically validates the given Authorization section.

type SafeTLSConfig

type SafeTLSConfig struct {
	// ca defines the Certificate authority used when verifying server certificates.
	// +optional
	CA SecretOrConfigMap `json:"ca,omitempty"`

	// cert defines the Client certificate to present when doing client-authentication.
	// +optional
	Cert SecretOrConfigMap `json:"cert,omitempty"`

	// keySecret defines the Secret containing the client key file for the targets.
	// +optional
	KeySecret *v1.SecretKeySelector `json:"keySecret,omitempty"`

	// serverName is used to verify the hostname for the targets.
	// +optional
	ServerName *string `json:"serverName,omitempty"`

	// insecureSkipVerify defines how to disable target certificate validation.
	// +optional
	InsecureSkipVerify *bool `json:"insecureSkipVerify,omitempty"`

	// minVersion defines the minimum acceptable TLS version.
	//
	// It requires Prometheus >= v2.35.0 or Thanos >= v0.28.0.
	// +optional
	MinVersion *TLSVersion `json:"minVersion,omitempty"`

	// maxVersion defines the maximum acceptable TLS version.
	//
	// It requires Prometheus >= v2.41.0 or Thanos >= v0.31.0.
	// +optional
	MaxVersion *TLSVersion `json:"maxVersion,omitempty"`
}

SafeTLSConfig specifies safe TLS configuration parameters. +k8s:openapi-gen=true

func (*SafeTLSConfig) DeepCopy

func (in *SafeTLSConfig) DeepCopy() *SafeTLSConfig

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SafeTLSConfig.

func (*SafeTLSConfig) DeepCopyInto

func (in *SafeTLSConfig) DeepCopyInto(out *SafeTLSConfig)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*SafeTLSConfig) Validate

func (c *SafeTLSConfig) Validate() error

Validate semantically validates the given SafeTLSConfig.

type ScrapeClass

type ScrapeClass struct {
	// name of the scrape class.
	//
	// +kubebuilder:validation:MinLength=1
	// +required
	Name string `json:"name"`

	// 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.
	//
	// +optional
	Default *bool `json:"default,omitempty"`

	// 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
	// scrape objects define their own CA, certificate and/or key, they take
	// precedence over the corresponding scrape class fields.
	//
	// For now only the `caFile`, `certFile` and `keyFile` fields are supported.
	//
	// +optional
	TLSConfig *TLSConfig `json:"tlsConfig,omitempty"`

	// 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 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`.
	// Then the Operator adds the scrape class relabelings defined here.
	// Then the Operator adds the target-specific relabelings defined in the scrape object.
	//
	// More info: https://prometheus.io/docs/prometheus/latest/configuration/configuration/#relabel_config
	//
	// +optional
	Relabelings []RelabelConfig `json:"relabelings,omitempty"`

	// 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.
	// Then the Operator adds namespace enforcement relabeling rule, specified in '.spec.enforcedNamespaceLabel'.
	//
	// More info: https://prometheus.io/docs/prometheus/latest/configuration/configuration/#metric_relabel_configs
	//
	// +optional
	MetricRelabelings []RelabelConfig `json:"metricRelabelings,omitempty"`

	// attachMetadata defines additional metadata to the discovered targets.
	// When the scrape object defines its own configuration, it takes
	// precedence over the scrape class configuration.
	//
	// +optional
	AttachMetadata *AttachMetadata `json:"attachMetadata,omitempty"`
}

func (*ScrapeClass) DeepCopy

func (in *ScrapeClass) DeepCopy() *ScrapeClass

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ScrapeClass.

func (*ScrapeClass) DeepCopyInto

func (in *ScrapeClass) DeepCopyInto(out *ScrapeClass)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type ScrapeProtocol

type ScrapeProtocol string

ScrapeProtocol represents a protocol used by Prometheus for scraping metrics. Supported values are: * `OpenMetricsText0.0.1` * `OpenMetricsText1.0.0` * `PrometheusProto` * `PrometheusText0.0.4` * `PrometheusText1.0.0` +kubebuilder:validation:Enum=PrometheusProto;OpenMetricsText0.0.1;OpenMetricsText1.0.0;PrometheusText0.0.4;PrometheusText1.0.0

const (
	PrometheusProto      ScrapeProtocol = "PrometheusProto"
	PrometheusText0_0_4  ScrapeProtocol = "PrometheusText0.0.4"
	PrometheusText1_0_0  ScrapeProtocol = "PrometheusText1.0.0"
	OpenMetricsText0_0_1 ScrapeProtocol = "OpenMetricsText0.0.1"
	OpenMetricsText1_0_0 ScrapeProtocol = "OpenMetricsText1.0.0"
)

type SecretOrConfigMap

type SecretOrConfigMap struct {
	// secret defines the Secret containing data to use for the targets.
	// +optional
	Secret *v1.SecretKeySelector `json:"secret,omitempty"`
	// configMap defines the ConfigMap containing data to use for the targets.
	// +optional
	ConfigMap *v1.ConfigMapKeySelector `json:"configMap,omitempty"`
}

SecretOrConfigMap allows to specify data as a Secret or ConfigMap. Fields are mutually exclusive.

func (*SecretOrConfigMap) DeepCopy

func (in *SecretOrConfigMap) DeepCopy() *SecretOrConfigMap

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SecretOrConfigMap.

func (*SecretOrConfigMap) DeepCopyInto

func (in *SecretOrConfigMap) DeepCopyInto(out *SecretOrConfigMap)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*SecretOrConfigMap) String

func (c *SecretOrConfigMap) String() string

func (*SecretOrConfigMap) Validate

func (c *SecretOrConfigMap) Validate() error

Validate semantically validates the given SecretOrConfigMap.

type SelectorMechanism

type SelectorMechanism string

+kubebuilder:validation:Enum=RelabelConfig;RoleSelector

const (
	SelectorMechanismRelabel SelectorMechanism = "RelabelConfig"
	SelectorMechanismRole    SelectorMechanism = "RoleSelector"
)

type ServiceDiscoveryRole

type ServiceDiscoveryRole string

+kubebuilder:validation:Enum=Endpoints;EndpointSlice

const (
	EndpointsRole     ServiceDiscoveryRole = "Endpoints"
	EndpointSliceRole ServiceDiscoveryRole = "EndpointSlice"
)

type ServiceMonitor

type ServiceMonitor struct {
	// 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 desired Service selection for target discovery by
	// Prometheus.
	// +required
	Spec ServiceMonitorSpec `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 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,omitzero"`
}

The `ServiceMonitor` custom resource definition (CRD) defines how `Prometheus` and `PrometheusAgent` can scrape metrics from a group of services. Among other things, it allows to specify: * The services to scrape via label selectors. * The container ports to scrape. * Authentication credentials to use. * Target and metric relabeling.

`Prometheus` and `PrometheusAgent` objects select `ServiceMonitor` objects using label and namespace selectors.

func (*ServiceMonitor) Bindings

func (l *ServiceMonitor) Bindings() []WorkloadBinding

func (*ServiceMonitor) DeepCopy

func (in *ServiceMonitor) DeepCopy() *ServiceMonitor

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ServiceMonitor.

func (*ServiceMonitor) DeepCopyInto

func (in *ServiceMonitor) DeepCopyInto(out *ServiceMonitor)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*ServiceMonitor) DeepCopyObject

func (l *ServiceMonitor) DeepCopyObject() runtime.Object

DeepCopyObject implements the runtime.Object interface.

type ServiceMonitorList

type ServiceMonitorList struct {
	// TypeMeta defines the versioned schema of this representation of an object
	metav1.TypeMeta `json:",inline"`
	// metadata defines ListMeta as metadata for collection responses.
	// +optional
	metav1.ListMeta `json:"metadata,omitempty"`
	// List of ServiceMonitors
	// +required
	Items []ServiceMonitor `json:"items"`
}

ServiceMonitorList is a list of ServiceMonitors. +k8s:openapi-gen=true

func (*ServiceMonitorList) DeepCopy

func (in *ServiceMonitorList) DeepCopy() *ServiceMonitorList

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ServiceMonitorList.

func (*ServiceMonitorList) DeepCopyInto

func (in *ServiceMonitorList) DeepCopyInto(out *ServiceMonitorList)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*ServiceMonitorList) DeepCopyObject

func (l *ServiceMonitorList) DeepCopyObject() runtime.Object

DeepCopyObject implements the runtime.Object interface.

type ServiceMonitorSpec

type ServiceMonitorSpec struct {
	// 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`
	// object is labeled with `foo: bar`, then Prometheus adds the `job="bar"`
	// label to all ingested metrics.
	//
	// 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
	// associated Kubernetes `Service` object onto the ingested metrics.
	//
	// +optional
	TargetLabels []string `json:"targetLabels,omitempty"`
	// podTargetLabels defines the labels which are transferred from the
	// associated Kubernetes `Pod` object onto the ingested metrics.
	//
	// +optional
	PodTargetLabels []string `json:"podTargetLabels,omitempty"`

	// 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"`

	// selector defines the label selector to select the Kubernetes `Endpoints` objects to scrape metrics from.
	// +required
	Selector metav1.LabelSelector `json:"selector"`

	// 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.
	//
	// It requires Prometheus >= v2.17.0.
	//
	// +optional
	SelectorMechanism *SelectorMechanism `json:"selectorMechanism,omitempty"`

	// 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
	// that will be accepted.
	//
	// +optional
	SampleLimit *uint64 `json:"sampleLimit,omitempty"`

	// 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.
	//
	// It requires Prometheus >= v2.49.0.
	//
	// +listType=set
	// +optional
	ScrapeProtocols []ScrapeProtocol `json:"scrapeProtocols,omitempty"`

	// 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
	// be accepted.
	//
	// +optional
	TargetLimit *uint64 `json:"targetLimit,omitempty"`

	// 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"`
	// 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"`
	// 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"`

	// 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"`

	// attachMetadata defines additional metadata which is added to the
	// discovered targets.
	//
	// It requires Prometheus >= v2.37.0.
	//
	// +optional
	AttachMetadata *AttachMetadata `json:"attachMetadata,omitempty"`

	// scrapeClass defines the scrape class to apply.
	// +optional
	// +kubebuilder:validation:MinLength=1
	ScrapeClassName *string `json:"scrapeClass,omitempty"`

	// 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"`
}

ServiceMonitorSpec defines the specification parameters for a ServiceMonitor. +k8s:openapi-gen=true

func (*ServiceMonitorSpec) DeepCopy

func (in *ServiceMonitorSpec) DeepCopy() *ServiceMonitorSpec

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ServiceMonitorSpec.

func (*ServiceMonitorSpec) DeepCopyInto

func (in *ServiceMonitorSpec) DeepCopyInto(out *ServiceMonitorSpec)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type ShardRetentionPolicy

type ShardRetentionPolicy struct {
	// 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.
	//
	// If not defined, the operator assumes the `Delete` value.
	// +kubebuilder:validation:Enum=Retain;Delete
	// +optional
	WhenScaled *WhenScaledRetentionType `json:"whenScaled,omitempty"`
	// 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"`
}

func (*ShardRetentionPolicy) DeepCopy

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ShardRetentionPolicy.

func (*ShardRetentionPolicy) DeepCopyInto

func (in *ShardRetentionPolicy) DeepCopyInto(out *ShardRetentionPolicy)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type ShardStatus

type ShardStatus struct {
	// shardID defines the identifier of the shard.
	// +required
	ShardID string `json:"shardID"`
	// replicas defines the total number of pods targeted by this shard.
	// +required
	Replicas int32 `json:"replicas"`
	// updatedReplicas defines the total number of non-terminated pods targeted by this shard
	// that have the desired spec.
	// +required
	UpdatedReplicas int32 `json:"updatedReplicas"`
	// availableReplicas defines the total number of available pods (ready for at least minReadySeconds)
	// targeted by this shard.
	// +required
	AvailableReplicas int32 `json:"availableReplicas"`
	// unavailableReplicas defines the Total number of unavailable pods targeted by this shard.
	// +required
	UnavailableReplicas int32 `json:"unavailableReplicas"`
}

func (*ShardStatus) DeepCopy

func (in *ShardStatus) DeepCopy() *ShardStatus

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ShardStatus.

func (*ShardStatus) DeepCopyInto

func (in *ShardStatus) DeepCopyInto(out *ShardStatus)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type Sigv4

type Sigv4 struct {
	// region defines the AWS region. If blank, the region from the default credentials chain used.
	// +optional
	Region string `json:"region,omitempty"`
	// 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 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 defines the named AWS profile used to authenticate.
	// +optional
	Profile string `json:"profile,omitempty"`
	// 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"`
}

Sigv4 defines AWS's Signature Verification 4 signing process to sign requests. +k8s:openapi-gen=true

func (*Sigv4) DeepCopy

func (in *Sigv4) DeepCopy() *Sigv4

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Sigv4.

func (*Sigv4) DeepCopyInto

func (in *Sigv4) DeepCopyInto(out *Sigv4)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type StorageSpec

type StorageSpec struct {
	// disableMountSubPath deprecated: subPath usage will be removed in a future release.
	// +optional
	DisableMountSubPath bool `json:"disableMountSubPath,omitempty"`
	// 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"`
	// 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"`
	// 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"`
}

StorageSpec defines the configured storage for a group Prometheus servers. If no storage option is specified, then by default an [EmptyDir](https://kubernetes.io/docs/concepts/storage/volumes/#emptydir) will be used.

If multiple storage options are specified, priority will be given as follows:

  1. emptyDir
  2. ephemeral
  3. volumeClaimTemplate

+k8s:openapi-gen=true

func (*StorageSpec) DeepCopy

func (in *StorageSpec) DeepCopy() *StorageSpec

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new StorageSpec.

func (*StorageSpec) DeepCopyInto

func (in *StorageSpec) DeepCopyInto(out *StorageSpec)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type TLSConfig

type TLSConfig struct {
	// +optional
	SafeTLSConfig `json:",inline"`
	// caFile defines the path to the CA cert in the Prometheus container to use for the targets.
	// +optional
	CAFile string `json:"caFile,omitempty"`
	// certFile defines the path to the client cert file in the Prometheus container for the targets.
	// +optional
	CertFile string `json:"certFile,omitempty"`
	// keyFile defines the path to the client key file in the Prometheus container for the targets.
	// +optional
	KeyFile string `json:"keyFile,omitempty"`
}

TLSConfig extends the safe TLS configuration with file parameters. +k8s:openapi-gen=true

func (*TLSConfig) DeepCopy

func (in *TLSConfig) DeepCopy() *TLSConfig

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TLSConfig.

func (*TLSConfig) DeepCopyInto

func (in *TLSConfig) DeepCopyInto(out *TLSConfig)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*TLSConfig) Validate

func (c *TLSConfig) Validate() error

Validate semantically validates the given TLSConfig.

type TLSVersion

type TLSVersion string

+kubebuilder:validation:Enum=TLS10;TLS11;TLS12;TLS13

const (
	TLSVersion10 TLSVersion = "TLS10"
	TLSVersion11 TLSVersion = "TLS11"
	TLSVersion12 TLSVersion = "TLS12"
	TLSVersion13 TLSVersion = "TLS13"
)

type TSDBSpec

type TSDBSpec struct {
	// 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
	// the timestamp of the sample is >= (TSDB.MaxTime - outOfOrderTimeWindow).
	//
	// This is an *experimental feature*, it may change in any upcoming release
	// in a breaking way.
	//
	// It requires Prometheus >= v2.39.0 or PrometheusAgent >= v2.54.0.
	// +optional
	OutOfOrderTimeWindow *Duration `json:"outOfOrderTimeWindow,omitempty"`
}

func (*TSDBSpec) DeepCopy

func (in *TSDBSpec) DeepCopy() *TSDBSpec

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TSDBSpec.

func (*TSDBSpec) DeepCopyInto

func (in *TSDBSpec) DeepCopyInto(out *TSDBSpec)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type ThanosRuler

type ThanosRuler struct {
	// 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 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"`
	// 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"`
}

The `ThanosRuler` custom resource definition (CRD) defines a desired [Thanos Ruler](https://github.com/thanos-io/thanos/blob/main/docs/components/rule.md) setup to run in a Kubernetes cluster.

A `ThanosRuler` instance requires at least one compatible Prometheus API endpoint (either Thanos Querier or Prometheus services).

The resource defines via label and namespace selectors which `PrometheusRule` objects should be associated to the deployed Thanos Ruler instances.

func (*ThanosRuler) DeepCopy

func (in *ThanosRuler) DeepCopy() *ThanosRuler

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ThanosRuler.

func (*ThanosRuler) DeepCopyInto

func (in *ThanosRuler) DeepCopyInto(out *ThanosRuler)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*ThanosRuler) DeepCopyObject

func (l *ThanosRuler) DeepCopyObject() runtime.Object

DeepCopyObject implements the runtime.Object interface.

func (*ThanosRuler) ExpectedReplicas

func (tr *ThanosRuler) ExpectedReplicas() int

func (*ThanosRuler) SetAvailableReplicas

func (tr *ThanosRuler) SetAvailableReplicas(i int)

func (*ThanosRuler) SetReplicas

func (tr *ThanosRuler) SetReplicas(i int)

func (*ThanosRuler) SetUnavailableReplicas

func (tr *ThanosRuler) SetUnavailableReplicas(i int)

func (*ThanosRuler) SetUpdatedReplicas

func (tr *ThanosRuler) SetUpdatedReplicas(i int)

type ThanosRulerList

type ThanosRulerList struct {
	// TypeMeta defines the versioned schema of this representation of an object.
	metav1.TypeMeta `json:",inline"`
	// metadata defines ListMeta as metadata for collection responses.
	// +optional
	metav1.ListMeta `json:"metadata,omitempty"`
	// List of Prometheuses
	// +required
	Items []ThanosRuler `json:"items"`
}

ThanosRulerList is a list of ThanosRulers. +k8s:openapi-gen=true

func (*ThanosRulerList) DeepCopy

func (in *ThanosRulerList) DeepCopy() *ThanosRulerList

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ThanosRulerList.

func (*ThanosRulerList) DeepCopyInto

func (in *ThanosRulerList) DeepCopyInto(out *ThanosRulerList)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*ThanosRulerList) DeepCopyObject

func (l *ThanosRulerList) DeepCopyObject() runtime.Object

DeepCopyObject implements the runtime.Object interface.

type ThanosRulerSpec

type ThanosRulerSpec struct {
	// version of Thanos to be deployed.
	// +optional
	Version *string `json:"version,omitempty"`

	// 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".
	// * "app.kubernetes.io/managed-by" label, set to "prometheus-operator".
	// * "app.kubernetes.io/instance" label, set to the name of the ThanosRuler instance.
	// * "thanos-ruler" label, set to the name of the ThanosRuler instance.
	// * "kubectl.kubernetes.io/default-container" annotation, set to "thanos-ruler".
	// +optional
	PodMetadata *EmbeddedObjectMetadata `json:"podMetadata,omitempty"`

	// image defines Thanos container image URL.
	// +optional
	Image string `json:"image,omitempty"`

	// 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"`

	// 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"`

	// 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"`

	// replicas defines the number of thanos ruler instances to deploy.
	// +optional
	Replicas *int32 `json:"replicas,omitempty"`

	// 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.
	// If not provided, no requests/limits will be set
	// +optional
	Resources v1.ResourceRequirements `json:"resources,omitempty"`

	// affinity defines when specified, the pod's scheduling constraints.
	// +optional
	Affinity *v1.Affinity `json:"affinity,omitempty"`

	// tolerations defines when specified, the pod's tolerations.
	// +optional
	Tolerations []v1.Toleration `json:"tolerations,omitempty"`

	// topologySpreadConstraints defines the pod's topology spread constraints.
	// +optional
	TopologySpreadConstraints []v1.TopologySpreadConstraint `json:"topologySpreadConstraints,omitempty"`

	// securityContext defines the pod-level security attributes and common container settings.
	// This defaults to the default PodSecurityContext.
	// +optional
	SecurityContext *v1.PodSecurityContext `json:"securityContext,omitempty"`

	// dnsPolicy defines the DNS policy for the pods.
	//
	// +optional
	DNSPolicy *DNSPolicy `json:"dnsPolicy,omitempty"`
	// dnsConfig defines Defines the DNS configuration for the pods.
	//
	// +optional
	DNSConfig *PodDNSConfig `json:"dnsConfig,omitempty"`

	// enableServiceLinks defines whether information about services should be injected into pod's environment variables
	// +optional
	EnableServiceLinks *bool `json:"enableServiceLinks,omitempty"`

	// priorityClassName defines the priority class assigned to the Pods
	// +optional
	PriorityClassName string `json:"priorityClassName,omitempty"`

	// 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.
	// 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 defines the name of the ServiceAccount to use to run the
	// Thanos Ruler Pods.
	// +optional
	ServiceAccountName string `json:"serviceAccountName,omitempty"`

	// storage defines the specification of how storage shall be used.
	// +optional
	Storage *StorageSpec `json:"storage,omitempty"`

	// 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 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"`

	// 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.
	//
	// `objectStorageConfigFile` takes precedence over this field.
	//
	// +optional
	ObjectStorageConfig *v1.SecretKeySelector `json:"objectStorageConfig,omitempty"`
	// 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
	//
	// The operator performs no validation of the configuration file.
	//
	// This field takes precedence over `objectStorageConfig`.
	//
	// +optional
	ObjectStorageConfigFile *string `json:"objectStorageConfigFile,omitempty"`

	// listenLocal defines the Thanos ruler listen on loopback, so that it
	// does not bind against the Pod IP.
	// +optional
	ListenLocal bool `json:"listenLocal,omitempty"`

	// 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.
	//
	// `queryConfig` takes precedence over this field.
	//
	// +optional
	QueryEndpoints []string `json:"queryEndpoints,omitempty"`

	// 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
	//
	// It requires Thanos >= v0.11.0.
	//
	// The operator performs no validation of the configuration.
	//
	// This field takes precedence over `queryEndpoints`.
	//
	// +optional
	QueryConfig *v1.SecretKeySelector `json:"queryConfig,omitempty"`

	// alertmanagersUrl defines the list of Alertmanager endpoints to send alerts to.
	//
	// For Thanos >= v0.10.0, it is recommended to use `alertmanagersConfig` instead.
	//
	// `alertmanagersConfig` takes precedence over this field.
	//
	// +optional
	AlertManagersURL []string `json:"alertmanagersUrl,omitempty"`
	// 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.
	//
	// It requires Thanos >= v0.10.0.
	//
	// The operator performs no validation of the configuration.
	//
	// This field takes precedence over `alertmanagersUrl`.
	//
	// +optional
	AlertManagersConfig *v1.SecretKeySelector `json:"alertmanagersConfig,omitempty"`

	// 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"`
	// 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
	// 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"`
	// 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 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"`

	// logLevel for ThanosRuler to be configured with.
	// +kubebuilder:validation:Enum="";debug;info;warn;error
	// +optional
	LogLevel string `json:"logLevel,omitempty"`
	// logFormat for ThanosRuler to be configured with.
	// +kubebuilder:validation:Enum="";logfmt;json
	// +optional
	LogFormat string `json:"logFormat,omitempty"`

	// portName defines the port name used for the pods and governing service.
	// Defaults to `web`.
	// +kubebuilder:default:="web"
	// +optional
	PortName string `json:"portName,omitempty"`

	// evaluationInterval defines the interval between consecutive evaluations.
	// +kubebuilder:default:="15s"
	// +optional
	EvaluationInterval Duration `json:"evaluationInterval,omitempty"`

	// resendDelay defines the minimum amount of time to wait before resending an alert to Alertmanager.
	// +optional
	ResendDelay *Duration `json:"resendDelay,omitempty"`

	// 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"`

	// ruleQueryOffset defines the default rule group's query offset duration to use.
	// It requires Thanos >= v0.38.0.
	// +optional
	RuleQueryOffset *Duration `json:"ruleQueryOffset,omitempty"`

	// 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"`

	// 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"`

	// 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).
	//
	// The field has no effect when remote-write is configured since the Ruler
	// operates in stateless mode.
	//
	// +kubebuilder:default:="24h"
	// +optional
	Retention Duration `json:"retention,omitempty"`

	// 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
	// strategic merge patch. The current container names are: `thanos-ruler` and `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.
	// 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/
	// Using initContainers for any use case other then secret fetching 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"`

	// tracingConfig defines the tracing configuration.
	//
	// The configuration format is defined at https://thanos.io/tip/thanos/tracing.md/#configuration
	//
	// This is an *experimental feature*, it may change in any upcoming release
	// in a breaking way.
	//
	// The operator performs no validation of the configuration.
	//
	// `tracingConfigFile` takes precedence over this field.
	//
	// +optional
	TracingConfig *v1.SecretKeySelector `json:"tracingConfig,omitempty"`
	// tracingConfigFile defines the path of the tracing configuration file.
	//
	// The configuration format is defined at https://thanos.io/tip/thanos/tracing.md/#configuration
	//
	// This is an *experimental feature*, it may change in any upcoming release
	// in a breaking way.
	//
	// The operator performs no validation of the configuration file.
	//
	// This field takes precedence over `tracingConfig`.
	//
	// +optional
	TracingConfigFile string `json:"tracingConfigFile,omitempty"`

	// 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.
	//
	// +optional
	Labels map[string]string `json:"labels,omitempty"`

	// 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.
	//
	// +optional
	AlertDropLabels []string `json:"alertDropLabels,omitempty"`

	// 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"`
	// 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 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"`

	// 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"`

	// 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.
	//
	// +kubebuilder:validation:Minimum:=0
	// +optional
	MinReadySeconds *int32 `json:"minReadySeconds,omitempty"`

	// alertRelabelConfigs defines the alert relabeling in Thanos Ruler.
	//
	// Alert relabel configuration must have the form as specified in the
	// official Prometheus documentation:
	// https://prometheus.io/docs/prometheus/latest/configuration/configuration/#alert_relabel_configs
	//
	// The operator performs no validation of the configuration.
	//
	// `alertRelabelConfigFile` takes precedence over this field.
	//
	// +optional
	AlertRelabelConfigs *v1.SecretKeySelector `json:"alertRelabelConfigs,omitempty"`
	// alertRelabelConfigFile defines the path to the alert relabeling configuration file.
	//
	// Alert relabel configuration must have the form as specified in the
	// official Prometheus documentation:
	// https://prometheus.io/docs/prometheus/latest/configuration/configuration/#alert_relabel_configs
	//
	// The operator performs no validation of the configuration file.
	//
	// This field takes precedence over `alertRelabelConfig`.
	//
	// +optional
	AlertRelabelConfigFile *string `json:"alertRelabelConfigFile,omitempty"`

	// hostAliases defines pods' hostAliases configuration
	// +listType=map
	// +listMapKey=ip
	// +optional
	HostAliases []HostAlias `json:"hostAliases,omitempty"`

	// 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
	// by the given ThanosRuler version.
	// In case of an argument conflict (e.g. an argument which is already set by the
	// operator itself) or when providing an invalid argument the reconciliation will
	// fail and an error will be logged.
	// +optional
	AdditionalArgs []Argument `json:"additionalArgs,omitempty"`

	// web defines the configuration of the ThanosRuler web server.
	// +optional
	Web *ThanosRulerWebSpec `json:"web,omitempty"`

	// remoteWrite defines the list of remote write configurations.
	//
	// When the list isn't empty, the ruler is configured with stateless mode.
	//
	// It requires Thanos >= 0.24.0.
	//
	// +optional
	RemoteWrite []RemoteWriteSpec `json:"remoteWrite,omitempty"`

	// 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.
	//
	// Defaults to 120 seconds.
	//
	// +kubebuilder:validation:Minimum:=0
	// +optional
	TerminationGracePeriodSeconds *int64 `json:"terminationGracePeriodSeconds,omitempty"`

	// 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
	// that this behaviour may break at any time without notice.
	//
	// For more information see https://thanos.io/tip/components/rule.md/
	//
	// It requires Thanos >= 0.39.0.
	// +listType:=set
	// +optional
	EnableFeatures []EnableFeature `json:"enableFeatures,omitempty"`

	// hostUsers supports the user space in Kubernetes.
	//
	// More info: https://kubernetes.io/docs/tasks/configure-pod-container/user-namespaces/
	//
	//
	// The feature requires at least Kubernetes 1.28 with the `UserNamespacesSupport` feature gate enabled.
	// Starting Kubernetes 1.33, the feature is enabled by default.
	//
	// +optional
	HostUsers *bool `json:"hostUsers,omitempty"`
}

ThanosRulerSpec is a specification of the desired behavior of the ThanosRuler. More info: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#spec-and-status +k8s:openapi-gen=true

func (*ThanosRulerSpec) DeepCopy

func (in *ThanosRulerSpec) DeepCopy() *ThanosRulerSpec

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ThanosRulerSpec.

func (*ThanosRulerSpec) DeepCopyInto

func (in *ThanosRulerSpec) DeepCopyInto(out *ThanosRulerSpec)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type ThanosRulerStatus

type ThanosRulerStatus struct {
	// paused defines whether any actions on the underlying managed objects are
	// being performed. Only delete actions will be performed.
	// +optional
	Paused bool `json:"paused"`
	// replicas defines the total number of non-terminated pods targeted by this ThanosRuler deployment
	// (their labels match the selector).
	// +optional
	Replicas int32 `json:"replicas"`
	// 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"`
	// availableReplicas defines the total number of available pods (ready for at least minReadySeconds)
	// targeted by this ThanosRuler deployment.
	// +optional
	AvailableReplicas int32 `json:"availableReplicas"`
	// unavailableReplicas defines the total number of unavailable pods targeted by this ThanosRuler deployment.
	// +optional
	UnavailableReplicas int32 `json:"unavailableReplicas"`
	// conditions defines the current state of the ThanosRuler object.
	// +listType=map
	// +listMapKey=type
	// +optional
	Conditions []Condition `json:"conditions,omitempty"`
}

ThanosRulerStatus is the most recent observed status of the ThanosRuler. 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

func (*ThanosRulerStatus) DeepCopy

func (in *ThanosRulerStatus) DeepCopy() *ThanosRulerStatus

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ThanosRulerStatus.

func (*ThanosRulerStatus) DeepCopyInto

func (in *ThanosRulerStatus) DeepCopyInto(out *ThanosRulerStatus)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type ThanosRulerWebSpec

type ThanosRulerWebSpec struct {
	// +optional
	WebConfigFileFields `json:",inline"`
}

ThanosRulerWebSpec defines the configuration of the ThanosRuler web server. +k8s:openapi-gen=true

func (*ThanosRulerWebSpec) DeepCopy

func (in *ThanosRulerWebSpec) DeepCopy() *ThanosRulerWebSpec

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ThanosRulerWebSpec.

func (*ThanosRulerWebSpec) DeepCopyInto

func (in *ThanosRulerWebSpec) DeepCopyInto(out *ThanosRulerWebSpec)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type ThanosSpec

type ThanosSpec struct {
	// 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.
	//
	// Specifying `spec.thanos.version` is still necessary to ensure the
	// Prometheus Operator knows which version of Thanos is being configured.
	//
	// If neither `spec.thanos.image` nor `spec.thanos.baseImage` are defined,
	// the operator will use the latest upstream version of Thanos available at
	// the time when the operator was released.
	//
	// +optional
	Image *string `json:"image,omitempty"`

	// 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
	// Thanos available at the time when the version of the operator was
	// released.
	//
	// +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
	Tag *string `json:"tag,omitempty"`
	// sha is deprecated: use 'image' instead.  The image digest can be specified as part of the image name.
	// +optional
	SHA *string `json:"sha,omitempty"`
	// baseImage is deprecated: use 'image' instead.
	// +optional
	BaseImage *string `json:"baseImage,omitempty"`

	// resources defines the resources requests and limits of the Thanos sidecar.
	// +optional
	Resources v1.ResourceRequirements `json:"resources,omitempty"`

	// 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"`
	// objectStorageConfigFile defines the Thanos sidecar's configuration file to upload TSDB blocks to object storage.
	//
	// More info: https://thanos.io/tip/thanos/storage.md/
	//
	// This field takes precedence over objectStorageConfig.
	// +optional
	ObjectStorageConfigFile *string `json:"objectStorageConfigFile,omitempty"`

	// listenLocal is deprecated: use `grpcListenLocal` and `httpListenLocal` instead.
	// +optional
	ListenLocal bool `json:"listenLocal,omitempty"`

	// 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"`

	// 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"`

	// tracingConfig defines the tracing configuration for the Thanos sidecar.
	//
	// `tracingConfigFile` takes precedence over this field.
	//
	// More info: https://thanos.io/tip/thanos/tracing.md/
	//
	// This is an *experimental feature*, it may change in any upcoming release
	// in a breaking way.
	//
	// +optional
	TracingConfig *v1.SecretKeySelector `json:"tracingConfig,omitempty"`
	// tracingConfigFile defines the tracing configuration file for the Thanos sidecar.
	//
	// This field takes precedence over `tracingConfig`.
	//
	// More info: https://thanos.io/tip/thanos/tracing.md/
	//
	// This is an *experimental feature*, it may change in any upcoming release
	// in a breaking way.
	// +optional
	TracingConfigFile string `json:"tracingConfigFile,omitempty"`

	// 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"`

	// logLevel for the Thanos sidecar.
	// +kubebuilder:validation:Enum="";debug;info;warn;error
	// +optional
	LogLevel string `json:"logLevel,omitempty"`
	// logFormat for the Thanos sidecar.
	// +kubebuilder:validation:Enum="";logfmt;json
	// +optional
	LogFormat string `json:"logFormat,omitempty"`

	// 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"`

	// 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
	// efficiency of the entire Prometheus/Thanos stack due to how it interacts
	// with memory and Thanos compactors. It is recommended to keep this value
	// set to a multiple of 120 times your longest scrape or rule interval. For
	// example, 30s * 120 = 1h.
	//
	// +kubebuilder:default:="2h"
	// +optional
	BlockDuration Duration `json:"blockSize,omitempty"`

	// readyTimeout defines the maximum time that the Thanos sidecar will wait for
	// Prometheus to start.
	// +optional
	ReadyTimeout Duration `json:"readyTimeout,omitempty"`
	// getConfigInterval defines how often to retrieve the Prometheus configuration.
	// +optional
	GetConfigInterval Duration `json:"getConfigInterval,omitempty"`
	// 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 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.
	// 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
	// operator itself) or when providing an invalid argument, the reconciliation will
	// fail and an error will be logged.
	// +optional
	AdditionalArgs []Argument `json:"additionalArgs,omitempty"`
}

ThanosSpec defines the configuration of the Thanos sidecar. +k8s:openapi-gen=true

func (*ThanosSpec) DeepCopy

func (in *ThanosSpec) DeepCopy() *ThanosSpec

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ThanosSpec.

func (*ThanosSpec) DeepCopyInto

func (in *ThanosSpec) DeepCopyInto(out *ThanosSpec)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type TopologySpreadConstraint

type TopologySpreadConstraint struct {
	CoreV1TopologySpreadConstraint `json:",inline"`

	// additionalLabelSelectors Defines what Prometheus Operator managed labels should be added to labelSelector on the topologySpreadConstraint.
	// +optional
	AdditionalLabelSelectors *AdditionalLabelSelectors `json:"additionalLabelSelectors,omitempty"`
}

func (*TopologySpreadConstraint) DeepCopy

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TopologySpreadConstraint.

func (*TopologySpreadConstraint) DeepCopyInto

func (in *TopologySpreadConstraint) DeepCopyInto(out *TopologySpreadConstraint)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type TranslationStrategyOption

type TranslationStrategyOption string

TranslationStrategyOption represents a translation strategy option for the OTLP endpoint. Supported values are: * `NoUTF8EscapingWithSuffixes` * `UnderscoreEscapingWithSuffixes` * `UnderscoreEscapingWithoutSuffixes` * `NoTranslation` +kubebuilder:validation:Enum=NoUTF8EscapingWithSuffixes;UnderscoreEscapingWithSuffixes;NoTranslation;UnderscoreEscapingWithoutSuffixes

const (
	NoUTF8EscapingWithSuffixes     TranslationStrategyOption = "NoUTF8EscapingWithSuffixes"
	UnderscoreEscapingWithSuffixes TranslationStrategyOption = "UnderscoreEscapingWithSuffixes"
	// It requires Prometheus >= v3.4.0.
	NoTranslation TranslationStrategyOption = "NoTranslation"
	// It requires Prometheus >= v3.6.0.
	UnderscoreEscapingWithoutSuffixes TranslationStrategyOption = "UnderscoreEscapingWithoutSuffixes"
)

type URL

type URL string

URL represents a valid URL +kubebuilder:validation:Pattern:="^(http|https)://.+$"

type WebConfigFileFields

type WebConfigFileFields struct {
	// tlsConfig defines the TLS parameters for HTTPS.
	// +optional
	TLSConfig *WebTLSConfig `json:"tlsConfig,omitempty"`
	// httpConfig defines HTTP parameters for web server.
	// +optional
	HTTPConfig *WebHTTPConfig `json:"httpConfig,omitempty"`
}

WebConfigFileFields defines the file content for --web.config.file flag. +k8s:deepcopy-gen=true

func (*WebConfigFileFields) DeepCopy

func (in *WebConfigFileFields) DeepCopy() *WebConfigFileFields

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new WebConfigFileFields.

func (*WebConfigFileFields) DeepCopyInto

func (in *WebConfigFileFields) DeepCopyInto(out *WebConfigFileFields)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type WebHTTPConfig

type WebHTTPConfig struct {
	// 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"`
	// headers defines a list of headers that can be added to HTTP responses.
	// +optional
	Headers *WebHTTPHeaders `json:"headers,omitempty"`
}

WebHTTPConfig defines HTTP parameters for web server. +k8s:openapi-gen=true

func (*WebHTTPConfig) DeepCopy

func (in *WebHTTPConfig) DeepCopy() *WebHTTPConfig

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new WebHTTPConfig.

func (*WebHTTPConfig) DeepCopyInto

func (in *WebHTTPConfig) DeepCopyInto(out *WebHTTPConfig)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type WebHTTPHeaders

type WebHTTPHeaders struct {
	// contentSecurityPolicy defines the Content-Security-Policy header to HTTP responses.
	// Unset if blank.
	// +optional
	ContentSecurityPolicy string `json:"contentSecurityPolicy,omitempty"`
	// 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
	// +optional
	XFrameOptions string `json:"xFrameOptions,omitempty"`
	// 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
	// +optional
	XContentTypeOptions string `json:"xContentTypeOptions,omitempty"`
	// 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"`
	// 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"`
}

WebHTTPHeaders defines the list of headers that can be added to HTTP responses. +k8s:openapi-gen=true

func (*WebHTTPHeaders) DeepCopy

func (in *WebHTTPHeaders) DeepCopy() *WebHTTPHeaders

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new WebHTTPHeaders.

func (*WebHTTPHeaders) DeepCopyInto

func (in *WebHTTPHeaders) DeepCopyInto(out *WebHTTPHeaders)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type WebTLSConfig

type WebTLSConfig struct {
	// cert defines the Secret or ConfigMap containing the TLS certificate for the web server.
	//
	// Either `keySecret` or `keyFile` must be defined.
	//
	// It is mutually exclusive with `certFile`.
	//
	// +optional
	Cert SecretOrConfigMap `json:"cert,omitempty"`
	// certFile defines the path to the TLS certificate file in the container for the web server.
	//
	// Either `keySecret` or `keyFile` must be defined.
	//
	// It is mutually exclusive with `cert`.
	//
	// +optional
	CertFile *string `json:"certFile,omitempty"`

	// keySecret defines the secret containing the TLS private key for the web server.
	//
	// Either `cert` or `certFile` must be defined.
	//
	// It is mutually exclusive with `keyFile`.
	//
	// +optional
	KeySecret v1.SecretKeySelector `json:"keySecret,omitempty"`
	// 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.
	//
	// It is mutually exclusive with `keySecret`.
	//
	// +optional
	KeyFile *string `json:"keyFile,omitempty"`

	// 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"`
	// 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"`
	// clientAuthType defines the server policy for client TLS authentication.
	//
	// For more detail on clientAuth options:
	// https://golang.org/pkg/crypto/tls/#ClientAuthType
	//
	// +optional
	ClientAuthType *string `json:"clientAuthType,omitempty"`

	// minVersion defines the minimum TLS version that is acceptable.
	//
	// +optional
	MinVersion *string `json:"minVersion,omitempty"`
	// maxVersion defines the Maximum TLS version that is acceptable.
	//
	// +optional
	MaxVersion *string `json:"maxVersion,omitempty"`

	// 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:
	// https://golang.org/pkg/crypto/tls/#pkg-constants
	//
	// +optional
	CipherSuites []string `json:"cipherSuites,omitempty"`

	// 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
	// the order of elements in cipherSuites, is used.
	//
	// +optional
	PreferServerCipherSuites *bool `json:"preferServerCipherSuites,omitempty"`

	// curvePreferences defines elliptic curves that will be used in an ECDHE handshake, in preference
	// order.
	//
	// Available curves are documented in the Go documentation:
	// https://golang.org/pkg/crypto/tls/#CurveID
	//
	// +optional
	CurvePreferences []string `json:"curvePreferences,omitempty"`
}

WebTLSConfig defines the TLS parameters for HTTPS. +k8s:openapi-gen=true

func (*WebTLSConfig) DeepCopy

func (in *WebTLSConfig) DeepCopy() *WebTLSConfig

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new WebTLSConfig.

func (*WebTLSConfig) DeepCopyInto

func (in *WebTLSConfig) DeepCopyInto(out *WebTLSConfig)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*WebTLSConfig) Validate

func (c *WebTLSConfig) Validate() error

Validate returns an error if one of the WebTLSConfig fields is invalid. A valid WebTLSConfig should have (Cert or CertFile) and (KeySecret or KeyFile) fields which are not zero values.

type WhenScaledRetentionType

type WhenScaledRetentionType string
var (
	RetainWhenScaledRetentionType WhenScaledRetentionType = "Retain"
	DeleteWhenScaledRetentionType WhenScaledRetentionType = "Delete"
)

type WorkloadBinding

type WorkloadBinding struct {
	// group defines the group of the referenced resource.
	// +kubebuilder:validation:Enum=monitoring.rhobs
	// +required
	Group string `json:"group"`
	// 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"`
	// name defines the name of the referenced object.
	// +kubebuilder:validation:MinLength=1
	// +required
	Name string `json:"name"`
	// namespace defines the namespace of the referenced object.
	// +kubebuilder:validation:MinLength=1
	// +required
	Namespace string `json:"namespace"`
	// 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"`
}

WorkloadBinding is a link between a configuration resource and a workload resource. +k8s:openapi-gen=true

func (*WorkloadBinding) DeepCopy

func (in *WorkloadBinding) DeepCopy() *WorkloadBinding

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new WorkloadBinding.

func (*WorkloadBinding) DeepCopyInto

func (in *WorkloadBinding) DeepCopyInto(out *WorkloadBinding)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL