Documentation
¶
Index ¶
- Constants
- Variables
- func Resource(resource string) schema.GroupResource
- type APIServerConfig
- type AdditionalLabelSelectors
- type AlertingSpec
- type Alertmanager
- type AlertmanagerAPIVersion
- type AlertmanagerConfigMatcherStrategy
- type AlertmanagerConfigMatcherStrategyType
- type AlertmanagerConfiguration
- type AlertmanagerEndpoints
- type AlertmanagerGlobalConfig
- type AlertmanagerList
- type AlertmanagerSpec
- type AlertmanagerStatus
- type AlertmanagerWebSpec
- type ArbitraryFSAccessThroughSMsConfig
- type Argument
- type AttachMetadata
- type Authorization
- type AzureAD
- type AzureOAuth
- type AzureSDK
- type BasicAuth
- type ByteSize
- type CommonPrometheusFields
- type Condition
- type ConditionStatus
- type ConditionType
- type CoreV1TopologySpreadConstraint
- type DNSPolicy
- type Duration
- type EmbeddedObjectMetadata
- type EmbeddedPersistentVolumeClaim
- type EnableFeature
- type Endpoint
- type Exemplars
- type GlobalSMTPConfig
- type GoDuration
- type HTTPConfig
- type HostAlias
- type HostPort
- type LabelName
- type ManagedIdentity
- type MetadataConfig
- type NameValidationSchemeOptions
- type NamespaceSelector
- type NativeHistogramConfig
- type NonEmptyDuration
- type OAuth2
- type OTLPConfig
- type ObjectReference
- type PodDNSConfig
- type PodDNSConfigOption
- type PodMetricsEndpoint
- type PodMonitor
- type PodMonitorList
- type PodMonitorSpec
- type Probe
- type ProbeList
- type ProbeSpec
- type ProbeTargetIngress
- type ProbeTargetStaticConfig
- type ProbeTargets
- type ProberSpec
- type Prometheus
- type PrometheusList
- type PrometheusRule
- type PrometheusRuleExcludeConfig
- type PrometheusRuleList
- type PrometheusRuleSpec
- type PrometheusSpec
- type PrometheusStatus
- type PrometheusTracingConfig
- type PrometheusWebSpec
- type ProxyConfig
- type QuerySpec
- type QueueConfig
- type RelabelConfig
- type ReloadStrategyType
- type RemoteReadSpec
- type RemoteWriteMessageVersion
- type RemoteWriteSpec
- type Rule
- type RuleGroup
- type Rules
- type RulesAlert
- type RuntimeConfig
- type SafeAuthorization
- type SafeTLSConfig
- type ScrapeClass
- type ScrapeProtocol
- type SecretOrConfigMap
- type SelectorMechanism
- type ServiceDiscoveryRole
- type ServiceMonitor
- type ServiceMonitorList
- type ServiceMonitorSpec
- type ShardStatus
- type Sigv4
- type StorageSpec
- type TLSConfig
- type TLSVersion
- type TSDBSpec
- type ThanosRuler
- type ThanosRulerList
- type ThanosRulerSpec
- type ThanosRulerStatus
- type ThanosRulerWebSpec
- type ThanosSpec
- type TopologySpreadConstraint
- type TranslationStrategyOption
- type WebConfigFileFields
- type WebHTTPConfig
- type WebHTTPHeaders
- type WebTLSConfig
Constants ¶
const ( RoleNode = "node" RolePod = "pod" RoleService = "service" RoleEndpoint = "endpoints" RoleEndpointSlice = "endpointslice" RoleIngress = "ingress" )
The valid options for Role.
const ( AlertmanagersKind = "Alertmanager" AlertmanagerName = "alertmanagers" AlertManagerKindKey = "alertmanager" )
const ( PodMonitorsKind = "PodMonitor" PodMonitorName = "podmonitors" PodMonitorKindKey = "podmonitor" )
const ( ProbesKind = "Probe" ProbeName = "probes" ProbeKindKey = "probe" )
const ( PrometheusesKind = "Prometheus" PrometheusName = "prometheuses" PrometheusKindKey = "prometheus" )
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") )
const ( AlertmanagerAPIVersion1 = AlertmanagerAPIVersion("V1") AlertmanagerAPIVersion2 = AlertmanagerAPIVersion("V2") )
const ( PrometheusRuleKind = "PrometheusRule" PrometheusRuleName = "prometheusrules" PrometheusRuleKindKey = "prometheusrule" )
const ( ServiceMonitorsKind = "ServiceMonitor" ServiceMonitorName = "servicemonitors" ServiceMonitorKindKey = "servicemonitor" )
const ( ThanosRulerKind = "ThanosRuler" ThanosRulerName = "thanosrulers" ThanosRulerKindKey = "thanosrulers" )
const (
Version = "v1"
)
Variables ¶
var ( GroupName = "monitoring.coreos.com" GroupVersion = schema.GroupVersion{Group: GroupName, Version: "v1"} // Install is a function which adds this version to a scheme Install = schemeBuilder.AddToScheme // SchemeGroupVersion generated code relies on this name // Deprecated SchemeGroupVersion = GroupVersion // AddToScheme exists solely to keep the old generators creating valid code // DEPRECATED AddToScheme = schemeBuilder.AddToScheme )
Functions ¶
func Resource ¶
func Resource(resource string) schema.GroupResource
Resource generated code relies on this being here, but it logically belongs to the group DEPRECATED
Types ¶
type APIServerConfig ¶
type APIServerConfig struct {
// Kubernetes API address consisting of a hostname or IP address followed
// by an optional port number.
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"`
// 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`.
BearerTokenFile string `json:"bearerTokenFile,omitempty"`
// TLS Config 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"`
// *Warning: this field shouldn't be used because the token value appears
// in clear-text. Prefer using `authorization`.*
//
// Deprecated: this will be removed in a future release.
BearerToken string `json:"bearerToken,omitempty"`
}
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
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 ¶ added in v1.16.0
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 {
// Alertmanager endpoints where Prometheus should send alerts to.
Alertmanagers []AlertmanagerEndpoints `json:"alertmanagers"`
}
AlertingSpec defines parameters for alerting configuration of Prometheus servers.
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 {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`
// 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
Spec AlertmanagerSpec `json:"spec"`
// 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
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 (in *Alertmanager) DeepCopyObject() runtime.Object
DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
type AlertmanagerAPIVersion ¶ added in v1.16.0
type AlertmanagerAPIVersion string
+kubebuilder:validation:Enum=v1;V1;v2;V2
type AlertmanagerConfigMatcherStrategy ¶
type AlertmanagerConfigMatcherStrategy struct {
// AlertmanagerConfigMatcherStrategyType 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";"None"
// +kubebuilder:default:="OnNamespace"
Type AlertmanagerConfigMatcherStrategyType `json:"type,omitempty"`
}
func (*AlertmanagerConfigMatcherStrategy) DeepCopy ¶
func (in *AlertmanagerConfigMatcherStrategy) DeepCopy() *AlertmanagerConfigMatcherStrategy
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AlertmanagerConfigMatcherStrategy.
func (*AlertmanagerConfigMatcherStrategy) DeepCopyInto ¶
func (in *AlertmanagerConfigMatcherStrategy) DeepCopyInto(out *AlertmanagerConfigMatcherStrategy)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type AlertmanagerConfigMatcherStrategyType ¶ added in v1.16.0
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 `None`, the route and inhbition rules of an AlertmanagerConfig // object process all incoming alerts. NoneConfigMatcherStrategyType AlertmanagerConfigMatcherStrategyType = "None" )
type AlertmanagerConfiguration ¶
type AlertmanagerConfiguration struct {
// The name of the AlertmanagerConfig 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
Name string `json:"name,omitempty"`
// Defines the global parameters of the Alertmanager configuration.
// +optional
Global *AlertmanagerGlobalConfig `json:"global,omitempty"`
// Custom notification templates.
// +optional
Templates []SecretOrConfigMap `json:"templates,omitempty"`
}
AlertmanagerConfiguration defines the Alertmanager configuration.
func (*AlertmanagerConfiguration) DeepCopy ¶
func (in *AlertmanagerConfiguration) DeepCopy() *AlertmanagerConfiguration
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AlertmanagerConfiguration.
func (*AlertmanagerConfiguration) DeepCopyInto ¶
func (in *AlertmanagerConfiguration) DeepCopyInto(out *AlertmanagerConfiguration)
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.
Port intstr.IntOrString `json:"port"`
// Scheme to use when firing alerts.
Scheme string `json:"scheme,omitempty"`
// Prefix for the HTTP path alerts are pushed to.
PathPrefix string `json:"pathPrefix,omitempty"`
// TLS Config 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"`
// 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`.
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 allows to configures 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
ProxyConfig `json:",inline"`
// Version of the Alertmanager API that Prometheus uses to send alerts.
// It can be "V1" or "V2".
// The field has no effect for Prometheus >= v3.0.0 because only the v2 API is supported.
//
// +optional
APIVersion *AlertmanagerAPIVersion `json:"apiVersion,omitempty"`
// Timeout is a per-target Alertmanager timeout when pushing alerts.
//
// +optional
Timeout *Duration `json:"timeout,omitempty"`
// Whether to enable HTTP2.
//
// +optional
EnableHttp2 *bool `json:"enableHttp2,omitempty"`
// Relabel configuration applied to the discovered Alertmanagers.
//
// +optional
RelabelConfigs []RelabelConfig `json:"relabelings,omitempty"`
// 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.
func (*AlertmanagerEndpoints) DeepCopy ¶
func (in *AlertmanagerEndpoints) DeepCopy() *AlertmanagerEndpoints
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 {
// Configures global SMTP parameters.
// +optional
SMTPConfig *GlobalSMTPConfig `json:"smtp,omitempty"`
// ResolveTimeout is 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.
ResolveTimeout Duration `json:"resolveTimeout,omitempty"`
// HTTP client configuration.
HTTPConfig *HTTPConfig `json:"httpConfig,omitempty"`
// The default Slack API URL.
SlackAPIURL *v1.SecretKeySelector `json:"slackApiUrl,omitempty"`
// The default OpsGenie API URL.
OpsGenieAPIURL *v1.SecretKeySelector `json:"opsGenieApiUrl,omitempty"`
// The default OpsGenie API Key.
OpsGenieAPIKey *v1.SecretKeySelector `json:"opsGenieApiKey,omitempty"`
// The default Pagerduty URL.
PagerdutyURL *string `json:"pagerdutyUrl,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 ¶
func (in *AlertmanagerGlobalConfig) DeepCopy() *AlertmanagerGlobalConfig
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 AlertmanagerList ¶
type AlertmanagerList struct {
metav1.TypeMeta `json:",inline"`
// Standard list metadata
// More info: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#metadata
metav1.ListMeta `json:"metadata,omitempty"`
// List of Alertmanagers
Items []Alertmanager `json:"items"`
}
AlertmanagerList is a list of Alertmanagers.
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 (in *AlertmanagerList) DeepCopyObject() runtime.Object
DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
type AlertmanagerSpec ¶
type AlertmanagerSpec struct {
// PodMetadata configures 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".
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.
Image *string `json:"image,omitempty"`
// Image pull policy 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
ImagePullPolicy v1.PullPolicy `json:"imagePullPolicy,omitempty"`
// Version the cluster should be on.
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.
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.
SHA string `json:"sha,omitempty"`
// Base image that is used to deploy pods, without tag.
// Deprecated: use 'image' instead.
BaseImage string `json:"baseImage,omitempty"`
// An optional list of references to secrets in the same namespace
// to use for pulling prometheus and alertmanager images from registries
// see http://kubernetes.io/docs/user-guide/images#specifying-imagepullsecrets-on-a-pod
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.
Secrets []string `json:"secrets,omitempty"`
// ConfigMaps is 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.
ConfigMaps []string `json:"configMaps,omitempty"`
// ConfigSecret is 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).
ConfigSecret string `json:"configSecret,omitempty"`
// Log level for Alertmanager to be configured with.
// +kubebuilder:validation:Enum="";debug;info;warn;error
LogLevel string `json:"logLevel,omitempty"`
// Log format for Alertmanager to be configured with.
// +kubebuilder:validation:Enum="";logfmt;json
LogFormat string `json:"logFormat,omitempty"`
// Size is the expected size of the alertmanager cluster. The controller will
// eventually make the size of the running cluster equal to the expected
// size.
Replicas *int32 `json:"replicas,omitempty"`
// 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"
Retention GoDuration `json:"retention,omitempty"`
// Storage is the definition of how storage will be used by the Alertmanager
// instances.
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.
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.
VolumeMounts []v1.VolumeMount `json:"volumeMounts,omitempty"`
// 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"`
// The external URL the Alertmanager instances will be available under. This is
// necessary to generate correct URLs. This is necessary if Alertmanager is not
// served from root of a DNS name.
ExternalURL string `json:"externalUrl,omitempty"`
// The route prefix 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`.
RoutePrefix string `json:"routePrefix,omitempty"`
// If set to true all actions on the underlying managed objects are not
// goint to be performed, except for delete actions.
Paused bool `json:"paused,omitempty"`
// Define which Nodes the Pods are scheduled on.
NodeSelector map[string]string `json:"nodeSelector,omitempty"`
// Define resources requests and limits for single Pods.
Resources v1.ResourceRequirements `json:"resources,omitempty"`
// If specified, the pod's scheduling constraints.
Affinity *v1.Affinity `json:"affinity,omitempty"`
// If specified, the pod's tolerations.
Tolerations []v1.Toleration `json:"tolerations,omitempty"`
// If specified, the pod's topology spread constraints.
TopologySpreadConstraints []v1.TopologySpreadConstraint `json:"topologySpreadConstraints,omitempty"`
// SecurityContext holds pod-level security attributes and common container settings.
// This defaults to the default PodSecurityContext.
SecurityContext *v1.PodSecurityContext `json:"securityContext,omitempty"`
// Defines the DNS policy for the pods.
//
// +optional
DNSPolicy *DNSPolicy `json:"dnsPolicy,omitempty"`
// Defines the DNS configuration for the pods.
//
// +optional
DNSConfig *PodDNSConfig `json:"dnsConfig,omitempty"`
// ServiceAccountName is the name of the ServiceAccount to use to run the
// Prometheus Pods.
ServiceAccountName string `json:"serviceAccountName,omitempty"`
// ListenLocal makes 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.
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.
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.
InitContainers []v1.Container `json:"initContainers,omitempty"`
// Priority class assigned to the Pods
PriorityClassName string `json:"priorityClassName,omitempty"`
// AdditionalPeers allows injecting a set of additional Alertmanagers to peer with to form a highly available cluster.
AdditionalPeers []string `json:"additionalPeers,omitempty"`
// ClusterAdvertiseAddress is 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
ClusterAdvertiseAddress string `json:"clusterAdvertiseAddress,omitempty"`
// Interval between gossip attempts.
ClusterGossipInterval GoDuration `json:"clusterGossipInterval,omitempty"`
// 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.
ClusterLabel *string `json:"clusterLabel,omitempty"`
// Interval between pushpull attempts.
ClusterPushpullInterval GoDuration `json:"clusterPushpullInterval,omitempty"`
// Timeout for cluster peering.
ClusterPeerTimeout GoDuration `json:"clusterPeerTimeout,omitempty"`
// Port name used for the pods and governing service.
// Defaults to `web`.
// +kubebuilder:default:="web"
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.
ForceEnableClusterMode bool `json:"forceEnableClusterMode,omitempty"`
// AlertmanagerConfigs to be selected for to merge and configure Alertmanager with.
AlertmanagerConfigSelector *metav1.LabelSelector `json:"alertmanagerConfigSelector,omitempty"`
// Namespaces to be selected for AlertmanagerConfig discovery. If nil, only
// check own namespace.
AlertmanagerConfigNamespaceSelector *metav1.LabelSelector `json:"alertmanagerConfigNamespaceSelector,omitempty"`
// AlertmanagerConfigMatcherStrategy defines how AlertmanagerConfig objects
// process incoming alerts.
AlertmanagerConfigMatcherStrategy AlertmanagerConfigMatcherStrategy `json:"alertmanagerConfigMatcherStrategy,omitempty"`
// 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.
// Defaults to 0 (pod will be considered available as soon as it is ready)
// This is an alpha field from kubernetes 1.22 until 1.24 which requires enabling the StatefulSetMinReadySeconds feature gate.
// +optional
MinReadySeconds *uint32 `json:"minReadySeconds,omitempty"`
// Pods' hostAliases configuration
// +listType=map
// +listMapKey=ip
HostAliases []HostAlias `json:"hostAliases,omitempty"`
// Defines the web command line flags when starting Alertmanager.
Web *AlertmanagerWebSpec `json:"web,omitempty"`
// alertmanagerConfiguration specifies 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 indicates whether a service account token should be automatically mounted in the pod.
// If the service account has `automountServiceAccountToken: true`, set the field to `false` to opt out of automounting API credentials.
// +optional
AutomountServiceAccountToken *bool `json:"automountServiceAccountToken,omitempty"`
// Enable access to Alertmanager feature flags. By default, no features are enabled.
// 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"`
}
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
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 {
// Represents whether any actions on the underlying managed objects are
// being performed. Only delete actions will be performed.
Paused bool `json:"paused"`
// Total number of non-terminated pods targeted by this Alertmanager
// object (their labels match the selector).
Replicas int32 `json:"replicas"`
// Total number of non-terminated pods targeted by this Alertmanager
// object that have the desired version spec.
UpdatedReplicas int32 `json:"updatedReplicas"`
// Total number of available pods (ready for at least minReadySeconds)
// targeted by this Alertmanager cluster.
AvailableReplicas int32 `json:"availableReplicas"`
UnavailableReplicas int32 `json:"unavailableReplicas"`
// The selector used to match the pods targeted by this Alertmanager object.
Selector string `json:"selector,omitempty"`
// 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
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"`
// 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.
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 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 ¶
func (in *ArbitraryFSAccessThroughSMsConfig) DeepCopy() *ArbitraryFSAccessThroughSMsConfig
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ArbitraryFSAccessThroughSMsConfig.
func (*ArbitraryFSAccessThroughSMsConfig) DeepCopyInto ¶
func (in *ArbitraryFSAccessThroughSMsConfig) DeepCopyInto(out *ArbitraryFSAccessThroughSMsConfig)
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
Name string `json:"name"`
// Argument value, e.g. 30s. Can be empty for name-only arguments (e.g. --storage.tsdb.no-lockfile)
Value string `json:"value,omitempty"`
}
Argument as part of the AdditionalArgs list.
func (*Argument) DeepCopy ¶
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Argument.
func (*Argument) DeepCopyInto ¶
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type AttachMetadata ¶
type AttachMetadata struct {
// 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 {
SafeAuthorization `json:",inline"`
// File to read a secret from, mutually exclusive with `credentials`.
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.
type AzureAD ¶ added in v1.16.0
type AzureAD struct {
// 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.
//
// +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 >= 2.52.0.
// +optional
SDK *AzureSDK `json:"sdk,omitempty"`
}
AzureAD defines the configuration for remote write's azuread parameters.
func (*AzureAD) DeepCopy ¶ added in v1.16.0
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AzureAD.
func (*AzureAD) DeepCopyInto ¶ added in v1.16.0
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type AzureOAuth ¶ added in v1.16.0
type AzureOAuth struct {
// `clientID` is 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.
func (*AzureOAuth) DeepCopy ¶ added in v1.16.0
func (in *AzureOAuth) DeepCopy() *AzureOAuth
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AzureOAuth.
func (*AzureOAuth) DeepCopyInto ¶ added in v1.16.0
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 ¶ added in v1.16.0
type AzureSDK struct {
// `tenantId` is 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 ¶ added in v1.16.0
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AzureSDK.
func (*AzureSDK) DeepCopyInto ¶ added in v1.16.0
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type BasicAuth ¶
type BasicAuth struct {
// `username` specifies a key of a Secret containing the username for
// authentication.
Username v1.SecretKeySelector `json:"username,omitempty"`
// `password` specifies a key of a Secret containing the password for
// authentication.
Password v1.SecretKeySelector `json:"password,omitempty"`
}
BasicAuth configures HTTP Basic Authentication settings.
func (*BasicAuth) DeepCopy ¶
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new BasicAuth.
func (*BasicAuth) DeepCopyInto ¶
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)$"
type CommonPrometheusFields ¶
type CommonPrometheusFields struct {
// PodMetadata configures 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".
PodMetadata *EmbeddedObjectMetadata `json:"podMetadata,omitempty"`
// 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.
ServiceMonitorSelector *metav1.LabelSelector `json:"serviceMonitorSelector,omitempty"`
// Namespaces to match for ServicedMonitors discovery. An empty label selector
// matches all namespaces. A null label selector (default value) matches the current
// namespace only.
ServiceMonitorNamespaceSelector *metav1.LabelSelector `json:"serviceMonitorNamespaceSelector,omitempty"`
// 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.
PodMonitorSelector *metav1.LabelSelector `json:"podMonitorSelector,omitempty"`
// Namespaces to match for PodMonitors discovery. An empty label selector
// matches all namespaces. A null label selector (default value) matches the current
// namespace only.
PodMonitorNamespaceSelector *metav1.LabelSelector `json:"podMonitorNamespaceSelector,omitempty"`
// 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.
ProbeSelector *metav1.LabelSelector `json:"probeSelector,omitempty"`
// Namespaces to match for Probe discovery. An empty label
// selector matches all namespaces. A null label selector matches the
// current namespace only.
ProbeNamespaceSelector *metav1.LabelSelector `json:"probeNamespaceSelector,omitempty"`
// 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"`
// 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.
Version string `json:"version,omitempty"`
// When a Prometheus deployment is paused, no actions except for deletion
// will be performed on the underlying objects.
Paused bool `json:"paused,omitempty"`
// 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"`
// 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
ImagePullPolicy v1.PullPolicy `json:"imagePullPolicy,omitempty"`
// 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
ImagePullSecrets []v1.LocalObjectReference `json:"imagePullSecrets,omitempty"`
// 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"`
// Number of shards to distribute 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 Thanos sidecar and Thanos querier or
// remote write data to a central location.
// Alerting and recording rules
//
// By default, the sharding 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).
//
// +optional
Shards *int32 `json:"shards,omitempty"`
// Name of Prometheus external label used to denote the replica name.
// The external label will _not_ be added when the field is set to the
// empty string (`""`).
//
// Default: "prometheus_replica"
// +optional
ReplicaExternalLabelName *string `json:"replicaExternalLabelName,omitempty"`
// Name of Prometheus external label used to denote the Prometheus instance
// 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"`
// Log level for Prometheus and the config-reloader sidecar.
// +kubebuilder:validation:Enum="";debug;info;warn;error
LogLevel string `json:"logLevel,omitempty"`
// Log format for Log level for Prometheus and the config-reloader sidecar.
// +kubebuilder:validation:Enum="";logfmt;json
LogFormat string `json:"logFormat,omitempty"`
// Interval between consecutive scrapes.
//
// Default: "30s"
// +kubebuilder:default:="30s"
ScrapeInterval Duration `json:"scrapeInterval,omitempty"`
// 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.
ScrapeTimeout Duration `json:"scrapeTimeout,omitempty"`
// 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"`
// 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.
ExternalLabels map[string]string `json:"externalLabels,omitempty"`
// Enable 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.
EnableRemoteWriteReceiver bool `json:"enableRemoteWriteReceiver,omitempty"`
// Enable 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"`
// 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"`
// Enable 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"`
// 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).
ExternalURL string `json:"externalUrl,omitempty"`
// 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`.
RoutePrefix string `json:"routePrefix,omitempty"`
// Storage defines the storage used by Prometheus.
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.
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.
VolumeMounts []v1.VolumeMount `json:"volumeMounts,omitempty"`
// 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"`
// Defines the configuration of the Prometheus web server.
Web *PrometheusWebSpec `json:"web,omitempty"`
// Defines the resources requests and limits of the 'prometheus' container.
Resources v1.ResourceRequirements `json:"resources,omitempty"`
// Defines on which Nodes the Pods are scheduled.
NodeSelector map[string]string `json:"nodeSelector,omitempty"`
// ServiceAccountName is the name of the ServiceAccount to use to run the
// Prometheus Pods.
ServiceAccountName string `json:"serviceAccountName,omitempty"`
// AutomountServiceAccountToken indicates 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 is 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
Secrets []string `json:"secrets,omitempty"`
// ConfigMaps is 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.
ConfigMaps []string `json:"configMaps,omitempty"`
// Defines the Pods' affinity scheduling rules if specified.
// +optional
Affinity *v1.Affinity `json:"affinity,omitempty"`
// Defines the Pods' tolerations if specified.
// +optional
Tolerations []v1.Toleration `json:"tolerations,omitempty"`
// Defines the pod's topology spread constraints if specified.
//+optional
TopologySpreadConstraints []TopologySpreadConstraint `json:"topologySpreadConstraints,omitempty"`
// Defines the list of remote write configurations.
// +optional
RemoteWrite []RemoteWriteSpec `json:"remoteWrite,omitempty"`
// 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"`
// Defines the DNS policy for the pods.
//
// +optional
DNSPolicy *DNSPolicy `json:"dnsPolicy,omitempty"`
// Defines the DNS configuration for the pods.
//
// +optional
DNSConfig *PodDNSConfig `json:"dnsConfig,omitempty"`
// When true, the Prometheus server listens on the loopback address
// instead of the Pod IP's address.
ListenLocal bool `json:"listenLocal,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"`
// Priority class assigned to the Pods.
PriorityClassName string `json:"priorityClassName,omitempty"`
// Port name used for the pods and governing service.
// Default: "web"
// +kubebuilder:default:="web"
PortName string `json:"portName,omitempty"`
// 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.
ArbitraryFSAccessThroughSMs ArbitraryFSAccessThroughSMsConfig `json:"arbitraryFSAccessThroughSMs,omitempty"`
// When true, Prometheus resolves label conflicts by renaming the labels in the scraped data
// to “exported_” for all targets created from ServiceMonitor, PodMonitor and
// ScrapeConfig objects. Otherwise the HonorLabels field of the service or pod monitor applies.
// In practice,`overrideHonorLaels:true` enforces `honorLabels:false`
// for all ServiceMonitor, PodMonitor and ScrapeConfig objects.
OverrideHonorLabels bool `json:"overrideHonorLabels,omitempty"`
// 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.
OverrideHonorTimestamps bool `json:"overrideHonorTimestamps,omitempty"`
// 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.
IgnoreNamespaceSelectors bool `json:"ignoreNamespaceSelectors,omitempty"`
// 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.
EnforcedNamespaceLabel string `json:"enforcedNamespaceLabel,omitempty"`
// When defined, enforcedSampleLimit 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"`
// When defined, enforcedTargetLimit 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"`
// When defined, enforcedLabelLimit 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"`
// When defined, enforcedLabelNameLengthLimit 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"`
// When not null, enforcedLabelValueLengthLimit 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"`
// When defined, enforcedKeepDroppedTargets 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"`
// When defined, enforcedBodySizeLimit 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.
//
EnforcedBodySizeLimit ByteSize `json:"enforcedBodySizeLimit,omitempty"`
// Specifies the validation scheme for metric and label names.
// +optional
NameValidationScheme *NameValidationSchemeOptions `json:"nameValidationScheme,omitempty"`
// 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.
// Defaults to 0 (pod will be considered available as soon as it is ready)
//
// This is an alpha field from kubernetes 1.22 until 1.24 which requires
// enabling the StatefulSetMinReadySeconds feature gate.
//
// +optional
MinReadySeconds *uint32 `json:"minReadySeconds,omitempty"`
// 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"`
// Configures 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"`
// 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"`
// Use 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).
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 configures 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"`
// 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"`
// 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"`
// 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"`
// 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"`
// Defines the strategy used to reload the Prometheus configuration.
// If not specified, the configuration is reloaded using the /-/reload HTTP endpoint.
// +optional
ReloadStrategy *ReloadStrategyType `json:"reloadStrategy,omitempty"`
// Defines the maximum time that the `prometheus` container's startup probe will wait before being considered failed. The startup probe will return success after the WAL replay is complete.
// If set, the value should be greater than 60 (seconds). Otherwise it will be equal to 600 seconds (15 minutes).
// +optional
// +kubebuilder:validation:Minimum=60
MaximumStartupDurationSeconds *int32 `json:"maximumStartupDurationSeconds,omitempty"`
// 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
ScrapeClasses []ScrapeClass `json:"scrapeClasses,omitempty"`
// 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"`
// Defines the runtime reloadable configuration of the timeseries database(TSDB).
// It requires Prometheus >= v2.39.0 or PrometheusAgent >= v2.54.0.
//
// +optional
TSDB *TSDBSpec `json:"tsdb,omitempty"`
// File to which scrape failures are logged.
// 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"`
// 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"`
// RuntimeConfig configures the values for the Prometheus process behavior
// +optional
Runtime *RuntimeConfig `json:"runtime,omitempty"`
}
CommonPrometheusFields are the options available to both the Prometheus server and agent. +k8s:deepcopy-gen=true
func (*CommonPrometheusFields) DeepCopy ¶
func (in *CommonPrometheusFields) DeepCopy() *CommonPrometheusFields
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.
type Condition ¶ added in v1.16.0
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"`
// Human-readable message indicating details for the condition's last transition.
// +optional
Message string `json:"message,omitempty"`
// ObservedGeneration represents 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.
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 ¶ added in v1.16.0
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Condition.
func (*Condition) DeepCopyInto ¶ added in v1.16.0
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type ConditionStatus ¶ added in v1.16.0
type ConditionStatus string
+kubebuilder:validation:MinLength=1
const ( ConditionTrue ConditionStatus = "True" ConditionDegraded ConditionStatus = "Degraded" ConditionFalse ConditionStatus = "False" ConditionUnknown ConditionStatus = "Unknown" )
type ConditionType ¶ added in v1.16.0
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" )
type CoreV1TopologySpreadConstraint ¶ added in v1.16.0
type CoreV1TopologySpreadConstraint v1.TopologySpreadConstraint
func (*CoreV1TopologySpreadConstraint) DeepCopy ¶ added in v1.16.0
func (in *CoreV1TopologySpreadConstraint) DeepCopy() *CoreV1TopologySpreadConstraint
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CoreV1TopologySpreadConstraint.
func (*CoreV1TopologySpreadConstraint) DeepCopyInto ¶ added in v1.16.0
func (in *CoreV1TopologySpreadConstraint) DeepCopyInto(out *CoreV1TopologySpreadConstraint)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type DNSPolicy ¶ added in v1.16.0
type DNSPolicy string
DNSPolicy specifies the DNS policy for the pod. +kubebuilder:validation:Enum=ClusterFirstWithHostNet;ClusterFirst;Default;None
const ( // DNSClusterFirstWithHostNet indicates that the pod should use cluster DNS // first, if it is available, then fall back on the default // (as determined by kubelet) DNS settings. DNSClusterFirstWithHostNet DNSPolicy = "ClusterFirstWithHostNet" // DNSClusterFirst indicates that the pod should use cluster DNS // first unless hostNetwork is true, if it is available, then // fall back on the default (as determined by kubelet) DNS settings. DNSClusterFirst DNSPolicy = "ClusterFirst" // DNSDefault indicates that the pod should use the default (as // determined by kubelet) DNS settings. DNSDefault DNSPolicy = "Default" // DNSNone indicates 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)?)$"
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: http://kubernetes.io/docs/user-guide/identifiers#names
// +optional
Name string `json:"name,omitempty" protobuf:"bytes,1,opt,name=name"`
// Map of string keys and values that can be used to organize and categorize
// (scope and select) objects. May match selectors of replication controllers
// and services.
// More info: http://kubernetes.io/docs/user-guide/labels
// +optional
Labels map[string]string `json:"labels,omitempty" protobuf:"bytes,11,rep,name=labels"`
// Annotations is an unstructured key value map stored with a resource that may be
// set by external tools to store and retrieve arbitrary metadata. They are not
// queryable and should be preserved when modifying objects.
// More info: http://kubernetes.io/docs/user-guide/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 ¶
func (in *EmbeddedObjectMetadata) DeepCopy() *EmbeddedObjectMetadata
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 {
metav1.TypeMeta `json:",inline"`
// EmbeddedMetadata contains metadata relevant to an EmbeddedResource.
EmbeddedObjectMetadata `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"`
// Defines the desired 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"`
// +optional
// Deprecated: this field is never set.
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 ¶
func (in *EmbeddedPersistentVolumeClaim) DeepCopy() *EmbeddedPersistentVolumeClaim
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new EmbeddedPersistentVolumeClaim.
func (*EmbeddedPersistentVolumeClaim) DeepCopyInto ¶
func (in *EmbeddedPersistentVolumeClaim) DeepCopyInto(out *EmbeddedPersistentVolumeClaim)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type EnableFeature ¶ added in v1.16.0
type EnableFeature string
+kubebuilder:validation:MinLength:=1
type Endpoint ¶
type Endpoint struct {
// Name of the Service port which this endpoint refers to.
//
// It takes precedence over `targetPort`.
Port string `json:"port,omitempty"`
// Name or number of the target port of the `Pod` object behind the
// Service. The port must be specified with the container's port property.
//
// +optional
TargetPort *intstr.IntOrString `json:"targetPort,omitempty"`
// HTTP path from which to scrape for metrics.
//
// If empty, Prometheus uses the default value (e.g. `/metrics`).
Path string `json:"path,omitempty"`
// 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
Scheme string `json:"scheme,omitempty"`
// params define optional HTTP URL parameters.
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.
Interval Duration `json:"interval,omitempty"`
// Timeout after which Prometheus considers the scrape to be failed.
//
// If empty, Prometheus uses the global scrape timeout unless it is less
// than the target's scrape interval value in which the latter is used.
// The value cannot be greater than the scrape interval otherwise the operator will reject the resource.
ScrapeTimeout Duration `json:"scrapeTimeout,omitempty"`
// TLS configuration to use when scraping the target.
//
// +optional
TLSConfig *TLSConfig `json:"tlsConfig,omitempty"`
// File to read bearer token for scraping the target.
//
// Deprecated: use `authorization` instead.
BearerTokenFile string `json:"bearerTokenFile,omitempty"`
// `bearerTokenSecret` specifies a key of a Secret containing the bearer
// token for scraping targets. The secret needs to be in the same namespace
// as the 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"`
// When true, `honorLabels` preserves the metric's labels when they collide
// with the target's labels.
HonorLabels bool `json:"honorLabels,omitempty"`
// `honorTimestamps` controls 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` configures the Basic Authentication credentials to use when
// scraping the target.
//
// Cannot be set at the same time as `authorization`, or `oauth2`.
//
// +optional
BasicAuth *BasicAuth `json:"basicAuth,omitempty"`
// `oauth2` configures the OAuth2 settings to use when scraping the target.
//
// It requires Prometheus >= 2.27.0.
//
// Cannot be set at the same time as `authorization`, or `basicAuth`.
//
// +optional
OAuth2 *OAuth2 `json:"oauth2,omitempty"`
// `metricRelabelings` configures the relabeling rules to apply to the
// samples before ingestion.
//
// +optional
MetricRelabelConfigs []RelabelConfig `json:"metricRelabelings,omitempty"`
// `relabelings` configures the relabeling rules to apply the target's
// 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"`
// `proxyURL` configures the HTTP Proxy URL (e.g.
// "http://proxyserver:2195") to go through when scraping the target.
//
// +optional
ProxyURL *string `json:"proxyUrl,omitempty"`
// `followRedirects` defines whether the scrape requests should follow HTTP
// 3xx redirects.
//
// +optional
FollowRedirects *bool `json:"followRedirects,omitempty"`
// `enableHttp2` can be used to disable HTTP2 when scraping the target.
//
// +optional
EnableHttp2 *bool `json:"enableHttp2,omitempty"`
// When true, the pods which are not running (e.g. either in Failed or
// 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.
func (*Endpoint) DeepCopy ¶
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Endpoint.
func (*Endpoint) DeepCopyInto ¶
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type Exemplars ¶
type Exemplars struct {
// 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 ¶
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Exemplars.
func (*Exemplars) DeepCopyInto ¶
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type GlobalSMTPConfig ¶ added in v1.16.0
type GlobalSMTPConfig struct {
// The default SMTP From header field.
// +optional
From *string `json:"from,omitempty"`
// The default SMTP smarthost used for sending emails.
// +optional
SmartHost *HostPort `json:"smartHost,omitempty"`
// The default hostname to identify to the SMTP server.
// +optional
Hello *string `json:"hello,omitempty"`
// SMTP Auth using CRAM-MD5, LOGIN and PLAIN. If empty, Alertmanager doesn't authenticate to the SMTP server.
// +optional
AuthUsername *string `json:"authUsername,omitempty"`
// SMTP Auth using LOGIN and PLAIN.
// +optional
AuthPassword *v1.SecretKeySelector `json:"authPassword,omitempty"`
// SMTP Auth using PLAIN
// +optional
AuthIdentity *string `json:"authIdentity,omitempty"`
// SMTP Auth using CRAM-MD5.
// +optional
AuthSecret *v1.SecretKeySelector `json:"authSecret,omitempty"`
// The default SMTP TLS requirement.
// Note that Go does not support unencrypted connections to remote SMTP endpoints.
// +optional
RequireTLS *bool `json:"requireTLS,omitempty"`
}
GlobalSMTPConfig configures global SMTP parameters. See https://prometheus.io/docs/alerting/latest/configuration/#configuration-file
func (*GlobalSMTPConfig) DeepCopy ¶ added in v1.16.0
func (in *GlobalSMTPConfig) DeepCopy() *GlobalSMTPConfig
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GlobalSMTPConfig.
func (*GlobalSMTPConfig) DeepCopyInto ¶ added in v1.16.0
func (in *GlobalSMTPConfig) DeepCopyInto(out *GlobalSMTPConfig)
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 header configuration for the client.
// This is mutually exclusive with BasicAuth and is only available starting from Alertmanager v0.22+.
// +optional
Authorization *SafeAuthorization `json:"authorization,omitempty"`
// BasicAuth for the client.
// This is mutually exclusive with Authorization. If both are defined, BasicAuth takes precedence.
// +optional
BasicAuth *BasicAuth `json:"basicAuth,omitempty"`
// OAuth2 client credentials used to fetch a token for the targets.
// +optional
OAuth2 *OAuth2 `json:"oauth2,omitempty"`
// The secret's key that contains the bearer token to be used by the client
// for authentication.
// The secret needs to be in the same namespace as the Alertmanager
// object and accessible by the Prometheus Operator.
// +optional
BearerTokenSecret *v1.SecretKeySelector `json:"bearerTokenSecret,omitempty"`
// TLS configuration for the client.
// +optional
TLSConfig *SafeTLSConfig `json:"tlsConfig,omitempty"`
ProxyConfig `json:",inline"`
// FollowRedirects specifies whether the client should follow HTTP 3xx redirects.
// +optional
FollowRedirects *bool `json:"followRedirects,omitempty"`
}
HTTPConfig defines a client HTTP configuration. See https://prometheus.io/docs/alerting/latest/configuration/#http_config
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.
type HostAlias ¶
type HostAlias struct {
// IP address of the host file entry.
// +kubebuilder:validation:Required
IP string `json:"ip"`
// Hostnames for the above IP address.
// +kubebuilder:validation: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 ¶
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new HostAlias.
func (*HostAlias) DeepCopyInto ¶
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type HostPort ¶ added in v1.16.0
type HostPort struct {
// Defines the host's address, it can be a DNS name or a literal IP address.
// +kubebuilder:validation:MinLength=1
Host string `json:"host"`
// Defines the host's port, it can be a literal port number or a port name.
// +kubebuilder:validation:MinLength=1
Port string `json:"port"`
}
HostPort represents a "host:port" network address.
func (*HostPort) DeepCopy ¶ added in v1.16.0
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new HostPort.
func (*HostPort) DeepCopyInto ¶ added in v1.16.0
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 which may only contain ASCII letters, numbers, as well as underscores.
+kubebuilder:validation:Pattern:="^[a-zA-Z_][a-zA-Z0-9_]*$"
type ManagedIdentity ¶ added in v1.16.0
type ManagedIdentity struct {
// The client id
// +required
ClientID string `json:"clientId"`
}
ManagedIdentity defines the Azure User-assigned Managed identity.
func (*ManagedIdentity) DeepCopy ¶ added in v1.16.0
func (in *ManagedIdentity) DeepCopy() *ManagedIdentity
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ManagedIdentity.
func (*ManagedIdentity) DeepCopyInto ¶ added in v1.16.0
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 {
// Defines whether metric metadata is sent to the remote storage or not.
Send bool `json:"send,omitempty"`
// Defines how frequently metric metadata is sent to the remote storage.
SendInterval Duration `json:"sendInterval,omitempty"`
}
MetadataConfig configures the sending of series metadata to the remote storage.
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 NameValidationSchemeOptions ¶ added in v1.16.0
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 {
// Boolean describing whether all namespaces are selected in contrast to a
// list restricting them.
Any bool `json:"any,omitempty"`
// List of namespace names to select from.
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.
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 ¶ added in v1.16.0
type NativeHistogramConfig struct {
// Whether to scrape a classic histogram that is also exposed as a native histogram.
// It requires Prometheus >= v2.45.0.
//
// +optional
ScrapeClassicHistograms *bool `json:"scrapeClassicHistograms,omitempty"`
// If there are more than this many buckets in a native histogram,
// buckets will be merged to stay within the limit.
// It requires Prometheus >= v2.45.0.
//
// +optional
NativeHistogramBucketLimit *uint64 `json:"nativeHistogramBucketLimit,omitempty"`
// If the growth factor of one bucket to the next is smaller than this,
// buckets will be merged to increase the factor sufficiently.
// It requires Prometheus >= v2.50.0.
//
// +optional
NativeHistogramMinBucketFactor *resource.Quantity `json:"nativeHistogramMinBucketFactor,omitempty"`
}
NativeHistogramConfig extends the native histogram configuration settings.
func (*NativeHistogramConfig) DeepCopy ¶ added in v1.16.0
func (in *NativeHistogramConfig) DeepCopy() *NativeHistogramConfig
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NativeHistogramConfig.
func (*NativeHistogramConfig) DeepCopyInto ¶ added in v1.16.0
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 ¶ added in v1.16.0
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` specifies a key of a Secret or ConfigMap containing the
// OAuth2 client's ID.
ClientID SecretOrConfigMap `json:"clientId"`
// `clientSecret` specifies a key of a Secret containing the OAuth2
// client's secret.
ClientSecret v1.SecretKeySelector `json:"clientSecret"`
// `tokenURL` configures the URL to fetch the token from.
//
// +kubebuilder:validation:MinLength=1
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"`
// 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.
func (*OAuth2) DeepCopy ¶
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new OAuth2.
func (*OAuth2) DeepCopyInto ¶
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type OTLPConfig ¶ added in v1.16.0
type OTLPConfig struct {
// List of OpenTelemetry Attributes that should be promoted to metric labels, defaults to none.
//
// +kubebuilder:validation:MinItems=1
// +kubebuilder:validation:items:MinLength=1
// +listType=set
// +optional
PromoteResourceAttributes []string `json:"promoteResourceAttributes,omitempty"`
// Configures how the OTLP receiver endpoint translates the incoming metrics.
//
// It requires Prometheus >= v3.0.0.
// +optional
TranslationStrategy *TranslationStrategyOption `json:"translationStrategy,omitempty"`
// Enables adding `service.name`, `service.namespace` and `service.instance.id`
// 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"`
}
OTLPConfig is the configuration for writing to the OTLP endpoint.
func (*OTLPConfig) DeepCopy ¶ added in v1.16.0
func (in *OTLPConfig) DeepCopy() *OTLPConfig
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new OTLPConfig.
func (*OTLPConfig) DeepCopyInto ¶ added in v1.16.0
func (in *OTLPConfig) DeepCopyInto(out *OTLPConfig)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type ObjectReference ¶
type ObjectReference struct {
// Group of the referent. When not specified, it defaults to `monitoring.coreos.com`
// +optional
// +kubebuilder:default:="monitoring.coreos.com"
// +kubebuilder:validation:Enum=monitoring.coreos.com
Group string `json:"group"`
// Resource of the referent.
// +kubebuilder:validation:Required
// +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/
// +kubebuilder:validation: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.
type PodDNSConfig ¶ added in v1.16.0
type PodDNSConfig struct {
// A list of DNS name server IP addresses.
// This will be appended to the base nameservers generated from DNSPolicy.
// +kubebuilder:validation:Optional
// +listType:=set
// +kubebuilder:validation:items:MinLength:=1
Nameservers []string `json:"nameservers,omitempty"`
// A list of DNS search domains for host-name lookup.
// This will be appended to the base search paths generated from DNSPolicy.
// +kubebuilder:validation:Optional
// +listType:=set
// +kubebuilder:validation:items:MinLength:=1
Searches []string `json:"searches,omitempty"`
// A list of DNS resolver options.
// This will be merged with the base options generated from DNSPolicy.
// Resolution options given in Options
// will override those that appear in the base DNSPolicy.
// +kubebuilder:validation:Optional
// +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 ¶ added in v1.16.0
func (in *PodDNSConfig) DeepCopy() *PodDNSConfig
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PodDNSConfig.
func (*PodDNSConfig) DeepCopyInto ¶ added in v1.16.0
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 ¶ added in v1.16.0
type PodDNSConfigOption struct {
// Name is required and must be unique.
// +kubebuilder:validation:MinLength=1
Name string `json:"name"`
// Value is optional.
// +kubebuilder:validation:Optional
Value *string `json:"value,omitempty"`
}
PodDNSConfigOption defines DNS resolver options of a pod.
func (*PodDNSConfigOption) DeepCopy ¶ added in v1.16.0
func (in *PodDNSConfigOption) DeepCopy() *PodDNSConfigOption
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PodDNSConfigOption.
func (*PodDNSConfigOption) DeepCopyInto ¶ added in v1.16.0
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 {
// The `Pod` port name which exposes the endpoint.
//
// It takes precedence over the `portNumber` and `targetPort` fields.
// +optional
Port *string `json:"port,omitempty"`
// The `Pod` port number which exposes the endpoint.
// +kubebuilder:validation:Minimum=1
// +kubebuilder:validation:Maximum=65535
// +optional
PortNumber *int32 `json:"portNumber,omitempty"`
// Name or number of the target port of the `Pod` object behind the Service, the
// port must be specified with container port property.
//
// Deprecated: use 'port' or 'portNumber' instead.
TargetPort *intstr.IntOrString `json:"targetPort,omitempty"`
// HTTP path from which to scrape for metrics.
//
// If empty, Prometheus uses the default value (e.g. `/metrics`).
Path string `json:"path,omitempty"`
// 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
Scheme string `json:"scheme,omitempty"`
// `params` define optional HTTP URL parameters.
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.
Interval Duration `json:"interval,omitempty"`
// Timeout after which Prometheus considers the scrape to be failed.
//
// If empty, Prometheus uses the global scrape timeout unless it is less
// than the target's scrape interval value in which the latter is used.
// The value cannot be greater than the scrape interval otherwise the operator will reject the resource.
ScrapeTimeout Duration `json:"scrapeTimeout,omitempty"`
// TLS configuration to use when scraping the target.
//
// +optional
TLSConfig *SafeTLSConfig `json:"tlsConfig,omitempty"`
// `bearerTokenSecret` specifies a key of a Secret containing the bearer
// token for scraping targets. The secret needs to be in the same namespace
// as the PodMonitor object and readable by the Prometheus Operator.
//
// +optional
//
// Deprecated: use `authorization` instead.
BearerTokenSecret v1.SecretKeySelector `json:"bearerTokenSecret,omitempty"`
// When true, `honorLabels` preserves the metric's labels when they collide
// with the target's labels.
HonorLabels bool `json:"honorLabels,omitempty"`
// `honorTimestamps` controls 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` configures the Basic Authentication credentials to use when
// scraping the target.
//
// Cannot be set at the same time as `authorization`, or `oauth2`.
//
// +optional
BasicAuth *BasicAuth `json:"basicAuth,omitempty"`
// `oauth2` configures the OAuth2 settings to use when scraping the target.
//
// It requires Prometheus >= 2.27.0.
//
// Cannot be set at the same time as `authorization`, or `basicAuth`.
//
// +optional
OAuth2 *OAuth2 `json:"oauth2,omitempty"`
// `authorization` configures the Authorization header credentials to use when
// scraping the target.
//
// Cannot be set at the same time as `basicAuth`, or `oauth2`.
//
// +optional
Authorization *SafeAuthorization `json:"authorization,omitempty"`
// `metricRelabelings` configures the relabeling rules to apply to the
// samples before ingestion.
//
// +optional
MetricRelabelConfigs []RelabelConfig `json:"metricRelabelings,omitempty"`
// `relabelings` configures 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"`
// `proxyURL` configures the HTTP Proxy URL (e.g.
// "http://proxyserver:2195") to go through when scraping the target.
//
// +optional
ProxyURL *string `json:"proxyUrl,omitempty"`
// `followRedirects` defines whether the scrape requests should follow HTTP
// 3xx redirects.
//
// +optional
FollowRedirects *bool `json:"followRedirects,omitempty"`
// `enableHttp2` can be used to disable HTTP2 when scraping the target.
//
// +optional
EnableHttp2 *bool `json:"enableHttp2,omitempty"`
// When true, the pods which are not running (e.g. either in Failed or
// 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"`
}
PodMetricsEndpoint defines an endpoint serving Prometheus metrics to be scraped by Prometheus.
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 {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`
// Specification of desired Pod selection for target discovery by Prometheus.
Spec PodMonitorSpec `json:"spec"`
}
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) 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 (in *PodMonitor) DeepCopyObject() runtime.Object
DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
type PodMonitorList ¶
type PodMonitorList struct {
metav1.TypeMeta `json:",inline"`
// Standard list metadata
// More info: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#metadata
metav1.ListMeta `json:"metadata,omitempty"`
// List of PodMonitors
Items []PodMonitor `json:"items"`
}
PodMonitorList is a list of PodMonitors.
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 (in *PodMonitorList) DeepCopyObject() runtime.Object
DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
type PodMonitorSpec ¶
type PodMonitorSpec struct {
// 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>`).
JobLabel string `json:"jobLabel,omitempty"`
// `podTargetLabels` defines the labels which are transferred from the
// associated Kubernetes `Pod` object onto the ingested metrics.
//
PodTargetLabels []string `json:"podTargetLabels,omitempty"`
// Defines how to scrape metrics from the selected pods.
//
// +optional
PodMetricsEndpoints []PodMetricsEndpoint `json:"podMetricsEndpoints"`
// Label selector to select the Kubernetes `Pod` objects to scrape metrics from.
Selector metav1.LabelSelector `json:"selector"`
// 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.
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"`
// The protocol to use if a scrape returns blank, unparseable, or otherwise invalid Content-Type.
//
// It requires Prometheus >= v3.0.0.
// +optional
FallbackScrapeProtocol *ScrapeProtocol `json:"fallbackScrapeProtocol,omitempty"`
// Per-scrape limit on number of labels that will be accepted for a sample.
//
// It requires Prometheus >= v2.27.0.
//
// +optional
LabelLimit *uint64 `json:"labelLimit,omitempty"`
// Per-scrape limit on length of labels name that will be accepted for a sample.
//
// It requires Prometheus >= v2.27.0.
//
// +optional
LabelNameLengthLimit *uint64 `json:"labelNameLengthLimit,omitempty"`
// Per-scrape limit on length of labels value that will be accepted for a sample.
//
// It requires Prometheus >= v2.27.0.
//
// +optional
LabelValueLengthLimit *uint64 `json:"labelValueLengthLimit,omitempty"`
NativeHistogramConfig `json:",inline"`
// 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"`
// The scrape class to apply.
// +optional
// +kubebuilder:validation:MinLength=1
ScrapeClassName *string `json:"scrapeClass,omitempty"`
// When defined, bodySizeLimit specifies a job level limit on the size
// 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.
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 {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`
// Specification of desired Ingress selection for target discovery by Prometheus.
Spec ProbeSpec `json:"spec"`
}
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) DeepCopy ¶
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Probe.
func (*Probe) DeepCopyInto ¶
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (*Probe) DeepCopyObject ¶
DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
type ProbeList ¶
type ProbeList struct {
metav1.TypeMeta `json:",inline"`
// Standard list metadata
// More info: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#metadata
metav1.ListMeta `json:"metadata,omitempty"`
// List of Probes
Items []Probe `json:"items"`
}
ProbeList is a list of Probes.
func (*ProbeList) DeepCopy ¶
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ProbeList.
func (*ProbeList) DeepCopyInto ¶
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (*ProbeList) DeepCopyObject ¶
DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
type ProbeSpec ¶
type ProbeSpec struct {
// The job name assigned to scraped metrics by default.
JobName string `json:"jobName,omitempty"`
// Specification for the prober to use for probing targets.
// The prober.URL parameter is required. Targets cannot be probed if left empty.
ProberSpec ProberSpec `json:"prober,omitempty"`
// The 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
Module string `json:"module,omitempty"`
// Targets defines a set of static or dynamically discovered targets to probe.
Targets ProbeTargets `json:"targets,omitempty"`
// Interval at which targets are probed using the configured prober.
// If not specified Prometheus' global scrape interval is used.
Interval Duration `json:"interval,omitempty"`
// 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.
ScrapeTimeout Duration `json:"scrapeTimeout,omitempty"`
// TLS configuration to use when scraping the endpoint.
TLSConfig *SafeTLSConfig `json:"tlsConfig,omitempty"`
// 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.
BearerTokenSecret v1.SecretKeySelector `json:"bearerTokenSecret,omitempty"`
// BasicAuth allow an endpoint to authenticate over basic authentication.
// More info: https://prometheus.io/docs/operating/configuration/#endpoint
BasicAuth *BasicAuth `json:"basicAuth,omitempty"`
// OAuth2 for the URL. Only valid in Prometheus versions 2.27.0 and newer.
OAuth2 *OAuth2 `json:"oauth2,omitempty"`
// MetricRelabelConfigs to apply to samples before ingestion.
MetricRelabelConfigs []RelabelConfig `json:"metricRelabelings,omitempty"`
// Authorization section for this endpoint
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"`
// The protocol to use if a scrape returns blank, unparseable, or otherwise invalid Content-Type.
//
// It requires Prometheus >= v3.0.0.
// +optional
FallbackScrapeProtocol *ScrapeProtocol `json:"fallbackScrapeProtocol,omitempty"`
// Per-scrape limit on number of labels that will be accepted for a sample.
// Only valid in Prometheus versions 2.27.0 and newer.
// +optional
LabelLimit *uint64 `json:"labelLimit,omitempty"`
// Per-scrape limit on length of labels name that will be accepted for a sample.
// Only valid in Prometheus versions 2.27.0 and newer.
// +optional
LabelNameLengthLimit *uint64 `json:"labelNameLengthLimit,omitempty"`
// Per-scrape limit on length of labels value that will be accepted for a sample.
// Only valid in Prometheus versions 2.27.0 and newer.
// +optional
LabelValueLengthLimit *uint64 `json:"labelValueLengthLimit,omitempty"`
NativeHistogramConfig `json:",inline"`
// 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"`
// The scrape class to apply.
// +optional
// +kubebuilder:validation:MinLength=1
ScrapeClassName *string `json:"scrapeClass,omitempty"`
}
ProbeSpec contains specification parameters for a Probe.
func (*ProbeSpec) DeepCopy ¶
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ProbeSpec.
func (*ProbeSpec) DeepCopyInto ¶
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.
Selector metav1.LabelSelector `json:"selector,omitempty"`
// From which namespaces to select Ingress objects.
NamespaceSelector NamespaceSelector `json:"namespaceSelector,omitempty"`
// RelabelConfigs 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
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.
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 {
// The list of hosts to probe.
Targets []string `json:"static,omitempty"`
// Labels assigned to all metrics scraped from the targets.
Labels map[string]string `json:"labels,omitempty"`
// RelabelConfigs to apply to the label set of the targets before it gets
// scraped.
// More info: https://prometheus.io/docs/prometheus/latest/configuration/configuration/#relabel_config
RelabelConfigs []RelabelConfig `json:"relabelingConfigs,omitempty"`
}
ProbeTargetStaticConfig defines the set of static targets considered for probing.
func (*ProbeTargetStaticConfig) DeepCopy ¶
func (in *ProbeTargetStaticConfig) DeepCopy() *ProbeTargetStaticConfig
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.
StaticConfig *ProbeTargetStaticConfig `json:"staticConfig,omitempty"`
// ingress defines the Ingress objects to probe and the relabeling
// configuration.
// If `staticConfig` is also defined, `staticConfig` takes precedence.
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.
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.
type ProberSpec ¶
type ProberSpec struct {
// Mandatory URL of the prober.
URL string `json:"url"`
// 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
Scheme string `json:"scheme,omitempty"`
// Path to collect metrics from.
// Defaults to `/probe`.
// +kubebuilder:default:="/probe"
Path string `json:"path,omitempty"`
// Optional ProxyURL.
ProxyURL string `json:"proxyUrl,omitempty"`
}
ProberSpec contains specification parameters for the Prober used for probing.
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 {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`
// 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
Spec PrometheusSpec `json:"spec"`
// 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
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 (in *Prometheus) DeepCopyObject() runtime.Object
DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
type PrometheusList ¶
type PrometheusList struct {
metav1.TypeMeta `json:",inline"`
// Standard list metadata
// More info: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#metadata
metav1.ListMeta `json:"metadata,omitempty"`
// List of Prometheuses
Items []Prometheus `json:"items"`
}
PrometheusList is a list of Prometheuses.
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 (in *PrometheusList) DeepCopyObject() runtime.Object
DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
type PrometheusRule ¶
type PrometheusRule struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`
// Specification of desired alerting rule definitions for Prometheus.
Spec PrometheusRuleSpec `json:"spec"`
}
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 (in *PrometheusRule) DeepCopyObject() runtime.Object
DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
type PrometheusRuleExcludeConfig ¶
type PrometheusRuleExcludeConfig struct {
// Namespace of the excluded PrometheusRule object.
RuleNamespace string `json:"ruleNamespace"`
// Name of the excluded PrometheusRule object.
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 ¶
func (in *PrometheusRuleExcludeConfig) DeepCopy() *PrometheusRuleExcludeConfig
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PrometheusRuleExcludeConfig.
func (*PrometheusRuleExcludeConfig) DeepCopyInto ¶
func (in *PrometheusRuleExcludeConfig) DeepCopyInto(out *PrometheusRuleExcludeConfig)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type PrometheusRuleList ¶
type PrometheusRuleList struct {
metav1.TypeMeta `json:",inline"`
// Standard list metadata
// More info: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#metadata
metav1.ListMeta `json:"metadata,omitempty"`
// List of Rules
Items []PrometheusRule `json:"items"`
}
PrometheusRuleList is a list of PrometheusRules.
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 (in *PrometheusRuleList) DeepCopyObject() runtime.Object
DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
type PrometheusRuleSpec ¶
type PrometheusRuleSpec struct {
// Content of Prometheus rule file
// +listType=map
// +listMapKey=name
Groups []RuleGroup `json:"groups,omitempty"`
}
PrometheusRuleSpec contains specification parameters for a Rule.
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 {
CommonPrometheusFields `json:",inline"`
// Deprecated: use 'spec.image' instead.
BaseImage string `json:"baseImage,omitempty"`
// Deprecated: use 'spec.image' instead. The image's tag can be specified as part of the image name.
Tag string `json:"tag,omitempty"`
// Deprecated: use 'spec.image' instead. The image's digest can be specified as part of the image name.
SHA string `json:"sha,omitempty"`
// How long to retain the Prometheus data.
//
// Default: "24h" if `spec.retention` and `spec.retentionSize` are empty.
Retention Duration `json:"retention,omitempty"`
// Maximum number of bytes used by the Prometheus data.
RetentionSize ByteSize `json:"retentionSize,omitempty"`
// 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).
DisableCompaction bool `json:"disableCompaction,omitempty"`
// Defines the configuration of the Prometheus rules' engine.
Rules Rules `json:"rules,omitempty"`
// Defines the list of PrometheusRule objects to which the namespace label
// enforcement doesn't apply.
// This is only relevant when `spec.enforcedNamespaceLabel` is set to true.
// +optional
// Deprecated: use `spec.excludedFromEnforcement` instead.
PrometheusRulesExcludedFromEnforce []PrometheusRuleExcludeConfig `json:"prometheusRulesExcludedFromEnforce,omitempty"`
// PrometheusRule objects to be selected for rule evaluation. An empty
// label selector matches all objects. A null label selector matches no
// objects.
// +optional
RuleSelector *metav1.LabelSelector `json:"ruleSelector,omitempty"`
// Namespaces to match for PrometheusRule discovery. An empty label selector
// matches all namespaces. A null label selector matches the current
// namespace only.
// +optional
RuleNamespaceSelector *metav1.LabelSelector `json:"ruleNamespaceSelector,omitempty"`
// QuerySpec defines the configuration of the Promethus query service.
// +optional
Query *QuerySpec `json:"query,omitempty"`
// Defines the settings related to Alertmanager.
// +optional
Alerting *AlertingSpec `json:"alerting,omitempty"`
// AdditionalAlertRelabelConfigs specifies 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 specifies 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"`
// Defines the list of remote read configurations.
// +optional
RemoteRead []RemoteReadSpec `json:"remoteRead,omitempty"`
// 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.
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.
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"`
// Interval between rule evaluations.
// Default: "30s"
// +kubebuilder:default:="30s"
EvaluationInterval Duration `json:"evaluationInterval,omitempty"`
// Defines the offset the rule evaluation timestamp of this particular group by the specified duration into the past.
// It requires Prometheus >= v2.53.0.
// +optional
RuleQueryOffset *Duration `json:"ruleQueryOffset,omitempty"`
// Enables access to the Prometheus web admin API.
//
// 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
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
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 {
// Represents whether any actions on the underlying managed objects are
// being performed. Only delete actions will be performed.
Paused bool `json:"paused"`
// Total number of non-terminated pods targeted by this Prometheus deployment
// (their labels match the selector).
Replicas int32 `json:"replicas"`
// Total number of non-terminated pods targeted by this Prometheus deployment
// that have the desired version spec.
UpdatedReplicas int32 `json:"updatedReplicas"`
// Total number of available pods (ready for at least minReadySeconds)
// targeted by this Prometheus deployment.
AvailableReplicas int32 `json:"availableReplicas"`
UnavailableReplicas int32 `json:"unavailableReplicas"`
// The current state of the Prometheus deployment.
// +listType=map
// +listMapKey=type
// +optional
Conditions []Condition `json:"conditions,omitempty"`
// The list has one entry per shard. Each entry provides a summary of the shard status.
// +listType=map
// +listMapKey=shardID
// +optional
ShardStatuses []ShardStatus `json:"shardStatuses,omitempty"`
// Shards is the most recently observed number of shards.
Shards int32 `json:"shards,omitempty"`
// The selector used to match the pods targeted by this Prometheus resource.
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
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 ¶ added in v1.16.0
type PrometheusTracingConfig struct {
// 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"`
// Sets the probability a given trace will be sampled. Must be a float from 0 through 1.
// +optional
SamplingFraction *resource.Quantity `json:"samplingFraction"`
// If disabled, the client will use a secure connection.
// +optional
Insecure *bool `json:"insecure"`
// 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"`
// Maximum time the exporter will wait for each batch export.
// +optional
Timeout *Duration `json:"timeout"`
// TLS Config to use when sending traces.
// +optional
TLSConfig *TLSConfig `json:"tlsConfig"`
}
func (*PrometheusTracingConfig) DeepCopy ¶ added in v1.16.0
func (in *PrometheusTracingConfig) DeepCopy() *PrometheusTracingConfig
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PrometheusTracingConfig.
func (*PrometheusTracingConfig) DeepCopyInto ¶ added in v1.16.0
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 {
WebConfigFileFields `json:",inline"`
// The prometheus web page title.
// +optional
PageTitle *string `json:"pageTitle,omitempty"`
// 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.
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 ¶ added in v1.16.0
type ProxyConfig struct {
// `proxyURL` defines the HTTP proxy server to use.
//
// +kubebuilder:validation:Pattern:="^http(s)?://.+$"
// +optional
ProxyURL *string `json:"proxyUrl,omitempty"`
// `noProxy` is 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 or Alertmanager >= 0.25.0.
// +optional
NoProxy *string `json:"noProxy,omitempty"`
// Whether to use the proxy configuration defined by environment variables (HTTP_PROXY, HTTPS_PROXY, and NO_PROXY).
//
// It requires Prometheus >= v2.43.0 or Alertmanager >= 0.25.0.
// +optional
ProxyFromEnvironment *bool `json:"proxyFromEnvironment,omitempty"`
// ProxyConnectHeader optionally specifies headers to send to
// proxies during CONNECT requests.
//
// It requires Prometheus >= v2.43.0 or Alertmanager >= 0.25.0.
// +optional
// +mapType:=atomic
ProxyConnectHeader map[string][]v1.SecretKeySelector `json:"proxyConnectHeader,omitempty"`
}
func (*ProxyConfig) DeepCopy ¶ added in v1.16.0
func (in *ProxyConfig) DeepCopy() *ProxyConfig
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ProxyConfig.
func (*ProxyConfig) DeepCopyInto ¶ added in v1.16.0
func (in *ProxyConfig) DeepCopyInto(out *ProxyConfig)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type QuerySpec ¶
type QuerySpec struct {
// The delta difference allowed for retrieving metrics during expression evaluations.
// +optional
LookbackDelta *string `json:"lookbackDelta,omitempty"`
// Number of concurrent queries that can be run at once.
// +kubebuilder:validation:Minimum:=1
// +optional
MaxConcurrency *int32 `json:"maxConcurrency,omitempty"`
// Maximum number of samples a single query can load into memory. Note that
// queries will fail if they would load more samples than this into memory,
// so this also limits the number of samples a query can return.
// +optional
MaxSamples *int32 `json:"maxSamples,omitempty"`
// Maximum time a query may take before being aborted.
// +optional
Timeout *Duration `json:"timeout,omitempty"`
}
QuerySpec defines the query command line flags when starting Prometheus.
func (*QuerySpec) DeepCopy ¶
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new QuerySpec.
func (*QuerySpec) DeepCopyInto ¶
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type QueueConfig ¶
type QueueConfig struct {
// Capacity is the number of samples to buffer per shard before we start
// dropping them.
Capacity int `json:"capacity,omitempty"`
// MinShards is the minimum number of shards, i.e. amount of concurrency.
MinShards int `json:"minShards,omitempty"`
// MaxShards is the maximum number of shards, i.e. amount of concurrency.
MaxShards int `json:"maxShards,omitempty"`
// MaxSamplesPerSend is the maximum number of samples per send.
MaxSamplesPerSend int `json:"maxSamplesPerSend,omitempty"`
// BatchSendDeadline is the maximum time a sample will wait in buffer.
// +optional
BatchSendDeadline *Duration `json:"batchSendDeadline,omitempty"`
// MaxRetries is the maximum number of times to retry a batch on recoverable errors.
MaxRetries int `json:"maxRetries,omitempty"`
// MinBackoff is the initial retry delay. Gets doubled for every retry.
// +optional
MinBackoff *Duration `json:"minBackoff,omitempty"`
// MaxBackoff is the maximum retry delay.
// +optional
MaxBackoff *Duration `json:"maxBackoff,omitempty"`
// 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.
RetryOnRateLimit bool `json:"retryOnRateLimit,omitempty"`
// SampleAgeLimit drops samples older than the limit.
// It requires Prometheus >= v2.50.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.
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 {
// The source labels select values from existing labels. Their content is
// concatenated using the configured Separator and matched against the
// configured regular expression.
//
// +optional
SourceLabels []LabelName `json:"sourceLabels,omitempty"`
// Separator is the string between concatenated SourceLabels.
Separator *string `json:"separator,omitempty"`
// 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.
TargetLabel string `json:"targetLabel,omitempty"`
// Regular expression against which the extracted value is matched.
Regex string `json:"regex,omitempty"`
// Modulus to take of the hash of the source label values.
//
// Only applicable when the action is `HashMod`.
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
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
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 ¶ added in v1.16.0
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 {
// The URL of the endpoint to query from.
URL string `json:"url"`
// The name of the remote read queue, it must be unique if specified. The
// name is used in metrics and logging in order to differentiate read
// configurations.
//
// It requires Prometheus >= v2.15.0.
//
Name string `json:"name,omitempty"`
// An optional list of equality matchers which have to be present
// in a selector to query the remote read endpoint.
// +optional
RequiredMatchers map[string]string `json:"requiredMatchers,omitempty"`
// Timeout for requests to the remote read endpoint.
// +optional
RemoteTimeout *Duration `json:"remoteTimeout,omitempty"`
// Custom HTTP headers to be sent along with each remote read request.
// Be aware that headers that are set by Prometheus itself can't be overwritten.
// Only valid in Prometheus versions 2.26.0 and newer.
// +optional
Headers map[string]string `json:"headers,omitempty"`
// Whether reads should be made for queries for time ranges that
// the local storage should have complete data for.
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"`
// File from which to read the bearer token for the URL.
//
// Deprecated: this will be removed in a future release. Prefer using `authorization`.
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"`
// *Warning: this field shouldn't be used because the token value appears
// in clear-text. Prefer using `authorization`.*
//
// Deprecated: this will be removed in a future release.
BearerToken string `json:"bearerToken,omitempty"`
// TLS Config to use for the URL.
// +optional
TLSConfig *TLSConfig `json:"tlsConfig,omitempty"`
// Optional ProxyConfig.
// +optional
ProxyConfig `json:",inline"`
// Configure whether HTTP requests follow HTTP 3xx redirects.
//
// It requires Prometheus >= v2.26.0.
//
// +optional
FollowRedirects *bool `json:"followRedirects,omitempty"`
// Whether to use the external labels as selectors for the remote read endpoint.
//
// 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.
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 ¶ added in v1.16.0
type RemoteWriteMessageVersion string
+kubebuilder:validation:Enum=V1.0;V2.0
type RemoteWriteSpec ¶
type RemoteWriteSpec struct {
// The URL of the endpoint to send samples to.
// +kubebuilder:validation:MinLength=1
// +required
URL string `json:"url"`
// The name of the remote write queue, it must be unique if specified. The
// name is used in metrics and logging in order to differentiate queues.
//
// It requires Prometheus >= v2.15.0.
//
//+optional
Name *string `json:"name,omitempty"`
// 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.
//
// +optional
MessageVersion *RemoteWriteMessageVersion `json:"messageVersion,omitempty"`
// 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.
//
// +optional
SendExemplars *bool `json:"sendExemplars,omitempty"`
// Enables sending of native histograms, also known as sparse histograms
// over remote write.
//
// It requires Prometheus >= v2.40.0.
//
// +optional
SendNativeHistograms *bool `json:"sendNativeHistograms,omitempty"`
// Timeout for requests to the remote write endpoint.
// +optional
RemoteTimeout *Duration `json:"remoteTimeout,omitempty"`
// Custom HTTP headers to be sent along with each remote write request.
// Be aware that headers that are set by Prometheus itself can't be overwritten.
//
// It requires Prometheus >= v2.25.0.
//
// +optional
Headers map[string]string `json:"headers,omitempty"`
// The list of remote write relabel configurations.
// +optional
WriteRelabelConfigs []RelabelConfig `json:"writeRelabelConfigs,omitempty"`
// OAuth2 configuration for the URL.
//
// It requires Prometheus >= v2.27.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"`
// File from which to read bearer token for the URL.
//
// Deprecated: this will be removed in a future release. Prefer using `authorization`.
BearerTokenFile string `json:"bearerTokenFile,omitempty"`
// Authorization section for the URL.
//
// It requires Prometheus >= v2.26.0.
//
// Cannot be set at the same time as `sigv4`, `basicAuth`, `oauth2`, or `azureAd`.
//
// +optional
Authorization *Authorization `json:"authorization,omitempty"`
// Sigv4 allows to configures AWS's Signature Verification 4 for the URL.
//
// It requires Prometheus >= v2.26.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.
//
// Cannot be set at the same time as `authorization`, `basicAuth`, `oauth2`, or `sigv4`.
//
// +optional
AzureAD *AzureAD `json:"azureAd,omitempty"`
// *Warning: this field shouldn't be used because the token value appears
// in clear-text. Prefer using `authorization`.*
//
// Deprecated: this will be removed in a future release.
BearerToken string `json:"bearerToken,omitempty"`
// TLS Config to use for the URL.
// +optional
TLSConfig *TLSConfig `json:"tlsConfig,omitempty"`
// Optional ProxyConfig.
// +optional
ProxyConfig `json:",inline"`
// Configure whether HTTP requests follow HTTP 3xx redirects.
//
// It requires Prometheus >= v2.26.0.
//
// +optional
FollowRedirects *bool `json:"followRedirects,omitempty"`
// QueueConfig allows tuning of the remote write queue parameters.
// +optional
QueueConfig *QueueConfig `json:"queueConfig,omitempty"`
// MetadataConfig configures the sending of series metadata to the remote storage.
// +optional
MetadataConfig *MetadataConfig `json:"metadataConfig,omitempty"`
// Whether to enable HTTP2.
// +optional
EnableHttp2 *bool `json:"enableHTTP2,omitempty"`
}
RemoteWriteSpec defines the configuration to write samples from Prometheus to a remote endpoint.
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 Rule ¶
type Rule struct {
// Name of the time series to output to. Must be a valid metric name.
// Only one of `record` and `alert` must be set.
Record string `json:"record,omitempty"`
// Name of the alert. Must be a valid label value.
// Only one of `record` and `alert` must be set.
Alert string `json:"alert,omitempty"`
// PromQL expression to evaluate.
Expr intstr.IntOrString `json:"expr"`
// Alerts are considered firing once they have been returned for this long.
// +optional
For *Duration `json:"for,omitempty"`
// KeepFiringFor defines how long an alert will continue firing after the condition that triggered it has cleared.
// +optional
KeepFiringFor *NonEmptyDuration `json:"keep_firing_for,omitempty"`
// Labels to add or overwrite.
Labels map[string]string `json:"labels,omitempty"`
// Annotations to add to each alert.
// Only valid for alerting rules.
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
func (*Rule) DeepCopy ¶
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Rule.
func (*Rule) DeepCopyInto ¶
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type RuleGroup ¶
type RuleGroup struct {
// Name of the rule group.
// +kubebuilder:validation:MinLength=1
Name string `json:"name"`
// Labels to add or overwrite before storing the result for its rules.
// The labels defined at the rule level take precedence.
//
// It requires Prometheus >= 3.0.0.
// The field is ignored for Thanos Ruler.
// +optional
Labels map[string]string `json:"labels,omitempty"`
// Interval determines how often rules in the group are evaluated.
// +optional
Interval *Duration `json:"interval,omitempty"`
// 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
QueryOffset *Duration `json:"query_offset,omitempty"`
// List of alerting and recording rules.
// +optional
Rules []Rule `json:"rules,omitempty"`
// PartialResponseStrategy 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)?$"
PartialResponseStrategy string `json:"partial_response_strategy,omitempty"`
// Limit 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.
func (*RuleGroup) DeepCopy ¶
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RuleGroup.
func (*RuleGroup) DeepCopyInto ¶
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type Rules ¶
type Rules struct {
// Defines the parameters of the Prometheus rules' engine.
//
// Any update to these parameters trigger a restart of the pods.
Alert RulesAlert `json:"alert,omitempty"`
}
func (*Rules) DeepCopy ¶
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Rules.
func (*Rules) DeepCopyInto ¶
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type RulesAlert ¶
type RulesAlert struct {
// Max time to tolerate prometheus outage for restoring 'for' state of
// alert.
ForOutageTolerance string `json:"forOutageTolerance,omitempty"`
// Minimum duration between alert and restored 'for' state.
//
// This is maintained only for alerts with a configured 'for' time greater
// than the grace period.
ForGracePeriod string `json:"forGracePeriod,omitempty"`
// Minimum amount of time to wait before resending an alert to
// Alertmanager.
ResendDelay string `json:"resendDelay,omitempty"`
}
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 ¶ added in v1.16.0
type RuntimeConfig struct {
// 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 ¶ added in v1.16.0
func (in *RuntimeConfig) DeepCopy() *RuntimeConfig
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RuntimeConfig.
func (*RuntimeConfig) DeepCopyInto ¶ added in v1.16.0
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 {
// Defines the authentication type. The value is case-insensitive.
//
// "Basic" is not a supported value.
//
// Default: "Bearer"
Type string `json:"type,omitempty"`
// Selects a key of a Secret in the namespace that contains the credentials for authentication.
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.
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.
type SafeTLSConfig ¶
type SafeTLSConfig struct {
// Certificate authority used when verifying server certificates.
CA SecretOrConfigMap `json:"ca,omitempty"`
// Client certificate to present when doing client-authentication.
Cert SecretOrConfigMap `json:"cert,omitempty"`
// Secret containing the client key file for the targets.
KeySecret *v1.SecretKeySelector `json:"keySecret,omitempty"`
// Used to verify the hostname for the targets.
// +optional
ServerName *string `json:"serverName,omitempty"`
// Disable target certificate validation.
// +optional
InsecureSkipVerify *bool `json:"insecureSkipVerify,omitempty"`
// Minimum acceptable TLS version.
//
// It requires Prometheus >= v2.35.0.
// +optional
MinVersion *TLSVersion `json:"minVersion,omitempty"`
// Maximum acceptable TLS version.
//
// It requires Prometheus >= v2.41.0.
// +optional
MaxVersion *TLSVersion `json:"maxVersion,omitempty"`
}
SafeTLSConfig specifies safe TLS configuration parameters.
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.
type ScrapeClass ¶ added in v1.16.0
type ScrapeClass struct {
// Name of the scrape class.
//
// +kubebuilder:validation:MinLength=1
// +required
Name string `json:"name"`
// Default indicates that the scrape applies to all scrape objects that
// don't configure an explicit scrape class name.
//
// Only one scrape class can be set as the default.
//
// +optional
Default *bool `json:"default,omitempty"`
// 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 configures 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 configures 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 configures 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 ¶ added in v1.16.0
func (in *ScrapeClass) DeepCopy() *ScrapeClass
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ScrapeClass.
func (*ScrapeClass) DeepCopyInto ¶ added in v1.16.0
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 ¶ added in v1.16.0
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 containing data to use for the targets.
Secret *v1.SecretKeySelector `json:"secret,omitempty"`
// ConfigMap containing data to use for the targets.
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.
type SelectorMechanism ¶ added in v1.16.0
type SelectorMechanism string
+kubebuilder:validation:Enum=RelabelConfig;RoleSelector
const ( SelectorMechanismRelabel SelectorMechanism = "RelabelConfig" SelectorMechanismRole SelectorMechanism = "RoleSelector" )
type ServiceDiscoveryRole ¶ added in v1.16.0
type ServiceDiscoveryRole string
+kubebuilder:validation:Enum=Endpoints;EndpointSlice
const ( EndpointsRole ServiceDiscoveryRole = "Endpoints" EndpointSliceRole ServiceDiscoveryRole = "EndpointSlice" )
type ServiceMonitor ¶
type ServiceMonitor struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`
// Specification of desired Service selection for target discovery by
// Prometheus.
Spec ServiceMonitorSpec `json:"spec"`
}
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) 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 (in *ServiceMonitor) DeepCopyObject() runtime.Object
DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
type ServiceMonitorList ¶
type ServiceMonitorList struct {
metav1.TypeMeta `json:",inline"`
// Standard list metadata
// More info: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#metadata
metav1.ListMeta `json:"metadata,omitempty"`
// List of ServiceMonitors
Items []ServiceMonitor `json:"items"`
}
ServiceMonitorList is a list of ServiceMonitors.
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 (in *ServiceMonitorList) DeepCopyObject() runtime.Object
DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
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`.
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"`
// 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.
Endpoints []Endpoint `json:"endpoints"`
// Label selector to select the Kubernetes `Endpoints` objects to scrape metrics from.
Selector metav1.LabelSelector `json:"selector"`
// 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.
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"`
// 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"`
// Per-scrape limit on number of labels that will be accepted for a sample.
//
// It requires Prometheus >= v2.27.0.
//
// +optional
LabelLimit *uint64 `json:"labelLimit,omitempty"`
// Per-scrape limit on length of labels name that will be accepted for a sample.
//
// It requires Prometheus >= v2.27.0.
//
// +optional
LabelNameLengthLimit *uint64 `json:"labelNameLengthLimit,omitempty"`
// Per-scrape limit on length of labels value that will be accepted for a sample.
//
// It requires Prometheus >= v2.27.0.
//
// +optional
LabelValueLengthLimit *uint64 `json:"labelValueLengthLimit,omitempty"`
NativeHistogramConfig `json:",inline"`
// 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"`
// The scrape class to apply.
// +optional
// +kubebuilder:validation:MinLength=1
ScrapeClassName *string `json:"scrapeClass,omitempty"`
// When defined, bodySizeLimit specifies a job level limit on the size
// of uncompressed response body that will be accepted by Prometheus.
//
// It requires Prometheus >= v2.28.0.
//
// +optional
BodySizeLimit *ByteSize `json:"bodySizeLimit,omitempty"`
}
ServiceMonitorSpec defines the specification parameters for a ServiceMonitor.
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 ShardStatus ¶
type ShardStatus struct {
// Identifier of the shard.
// +required
ShardID string `json:"shardID"`
// Total number of pods targeted by this shard.
Replicas int32 `json:"replicas"`
// Total number of non-terminated pods targeted by this shard
// that have the desired spec.
UpdatedReplicas int32 `json:"updatedReplicas"`
// Total number of available pods (ready for at least minReadySeconds)
// targeted by this shard.
AvailableReplicas int32 `json:"availableReplicas"`
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 is the AWS region. If blank, the region from the default credentials chain used.
Region string `json:"region,omitempty"`
// AccessKey is the AWS API key. If not specified, the environment variable
// `AWS_ACCESS_KEY_ID` is used.
// +optional
AccessKey *v1.SecretKeySelector `json:"accessKey,omitempty"`
// SecretKey is the AWS API secret. If not specified, the environment
// variable `AWS_SECRET_ACCESS_KEY` is used.
// +optional
SecretKey *v1.SecretKeySelector `json:"secretKey,omitempty"`
// Profile is the named AWS profile used to authenticate.
Profile string `json:"profile,omitempty"`
// RoleArn is the named AWS profile used to authenticate.
RoleArn string `json:"roleArn,omitempty"`
}
Sigv4 optionally configures AWS's Signature Verification 4 signing process to sign requests.
func (*Sigv4) DeepCopy ¶
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Sigv4.
func (*Sigv4) DeepCopyInto ¶
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type StorageSpec ¶
type StorageSpec struct {
// Deprecated: subPath usage will be removed in a future release.
DisableMountSubPath bool `json:"disableMountSubPath,omitempty"`
// EmptyDirVolumeSource 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
EmptyDir *v1.EmptyDirVolumeSource `json:"emptyDir,omitempty"`
// EphemeralVolumeSource 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
Ephemeral *v1.EphemeralVolumeSource `json:"ephemeral,omitempty"`
// 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.
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:
- emptyDir
- ephemeral
- volumeClaimTemplate
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 {
SafeTLSConfig `json:",inline"`
// Path to the CA cert in the Prometheus container to use for the targets.
CAFile string `json:"caFile,omitempty"`
// Path to the client cert file in the Prometheus container for the targets.
CertFile string `json:"certFile,omitempty"`
// Path to the client key file in the Prometheus container for the targets.
KeyFile string `json:"keyFile,omitempty"`
}
TLSConfig extends the safe TLS configuration with file parameters.
func (*TLSConfig) DeepCopy ¶
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TLSConfig.
func (*TLSConfig) DeepCopyInto ¶
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type TLSVersion ¶ added in v1.16.0
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 {
// Configures 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 ¶
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TSDBSpec.
func (*TSDBSpec) DeepCopyInto ¶
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type ThanosRuler ¶
type ThanosRuler struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`
// 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
Spec ThanosRulerSpec `json:"spec"`
// 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
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 (in *ThanosRuler) DeepCopyObject() runtime.Object
DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
type ThanosRulerList ¶
type ThanosRulerList struct {
metav1.TypeMeta `json:",inline"`
// Standard list metadata
// More info: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#metadata
metav1.ListMeta `json:"metadata,omitempty"`
// List of Prometheuses
Items []ThanosRuler `json:"items"`
}
ThanosRulerList is a list of ThanosRulers.
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 (in *ThanosRulerList) DeepCopyObject() runtime.Object
DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
type ThanosRulerSpec ¶
type ThanosRulerSpec struct {
// Version of Thanos to be deployed.
// +optional
Version *string `json:"version,omitempty"`
// PodMetadata configures 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"`
// Thanos container image URL.
Image string `json:"image,omitempty"`
// Image pull policy 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
ImagePullPolicy v1.PullPolicy `json:"imagePullPolicy,omitempty"`
// An optional list of references to secrets in the same namespace
// to use for pulling thanos images from registries
// see http://kubernetes.io/docs/user-guide/images#specifying-imagepullsecrets-on-a-pod
// +optional
ImagePullSecrets []v1.LocalObjectReference `json:"imagePullSecrets,omitempty"`
// When a ThanosRuler deployment is paused, no actions except for deletion
// will be performed on the underlying objects.
Paused bool `json:"paused,omitempty"`
// Number of thanos ruler instances to deploy.
// +optional
Replicas *int32 `json:"replicas,omitempty"`
// Define 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
Resources v1.ResourceRequirements `json:"resources,omitempty"`
// If specified, the pod's scheduling constraints.
// +optional
Affinity *v1.Affinity `json:"affinity,omitempty"`
// If specified, the pod's tolerations.
// +optional
Tolerations []v1.Toleration `json:"tolerations,omitempty"`
// If specified, 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"`
// Defines the DNS policy for the pods.
//
// +optional
DNSPolicy *DNSPolicy `json:"dnsPolicy,omitempty"`
// Defines the DNS configuration for the pods.
//
// +optional
DNSConfig *PodDNSConfig `json:"dnsConfig,omitempty"`
// Priority class assigned to the Pods
PriorityClassName string `json:"priorityClassName,omitempty"`
// ServiceAccountName is the name of the ServiceAccount to use to run the
// Thanos Ruler Pods.
ServiceAccountName string `json:"serviceAccountName,omitempty"`
// Storage spec to specify how storage shall be used.
// +optional
Storage *StorageSpec `json:"storage,omitempty"`
// Volumes allows configuration of additional volumes on the output StatefulSet definition. Volumes specified will
// 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 ruler container,
// that are generated as a result of StorageSpec objects.
// +optional
VolumeMounts []v1.VolumeMount `json:"volumeMounts,omitempty"`
// Configures object storage.
//
// The configuration format is defined at https://thanos.io/tip/thanos/storage.md/#configuring-access-to-object-storage
//
// The operator performs no validation of the configuration.
//
// `objectStorageConfigFile` takes precedence over this field.
//
// +optional
ObjectStorageConfig *v1.SecretKeySelector `json:"objectStorageConfig,omitempty"`
// Configures 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 makes the Thanos ruler listen on loopback, so that it
// does not bind against the Pod IP.
ListenLocal bool `json:"listenLocal,omitempty"`
// Configures 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"`
// Configures 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"`
// Configures 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"`
// Configures 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"`
// PrometheusRule objects to be selected for rule evaluation. An empty
// label selector matches all objects. A null label selector matches no
// objects.
//
// +optional
RuleSelector *metav1.LabelSelector `json:"ruleSelector,omitempty"`
// Namespaces to be selected for Rules discovery. If unspecified, only
// 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.
EnforcedNamespaceLabel string `json:"enforcedNamespaceLabel,omitempty"`
// List of references to PrometheusRule objects
// to be excluded from enforcing a namespace label of origin.
// Applies only if enforcedNamespaceLabel set to true.
// +optional
ExcludedFromEnforcement []ObjectReference `json:"excludedFromEnforcement,omitempty"`
// PrometheusRulesExcludedFromEnforce - list of Prometheus rules to be excluded from enforcing
// of adding namespace labels. Works only if enforcedNamespaceLabel set to true.
// Make sure both ruleNamespace and ruleName are set for each pair
// Deprecated: use excludedFromEnforcement instead.
// +optional
PrometheusRulesExcludedFromEnforce []PrometheusRuleExcludeConfig `json:"prometheusRulesExcludedFromEnforce,omitempty"`
// Log level for ThanosRuler to be configured with.
// +kubebuilder:validation:Enum="";debug;info;warn;error
LogLevel string `json:"logLevel,omitempty"`
// Log format for ThanosRuler to be configured with.
// +kubebuilder:validation:Enum="";logfmt;json
LogFormat string `json:"logFormat,omitempty"`
// Port name used for the pods and governing service.
// Defaults to `web`.
// +kubebuilder:default:="web"
PortName string `json:"portName,omitempty"`
// Interval between consecutive evaluations.
// +kubebuilder:default:="15s"
EvaluationInterval Duration `json:"evaluationInterval,omitempty"`
// 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).
// +kubebuilder:default:="24h"
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"`
// Configures tracing.
//
// 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"`
// Configures 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"`
// Configures 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"`
// Configures 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"`
// The external URL 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.
ExternalPrefix string `json:"externalPrefix,omitempty"`
// The route prefix ThanosRuler registers HTTP handlers for. This allows thanos UI to be served on a sub-path.
RoutePrefix string `json:"routePrefix,omitempty"`
// GRPCServerTLSConfig configures the gRPC server from which Thanos Querier reads
// recorded rule data.
// Note: Currently only the CAFile, CertFile, and KeyFile fields are supported.
// Maps to the '--grpc-server-tls-*' CLI args.
// +optional
GRPCServerTLSConfig *TLSConfig `json:"grpcServerTlsConfig,omitempty"`
// The external Query URL the Thanos Ruler will set in the 'Source' field
// of all alerts.
// Maps to the '--alert.query-url' CLI arg.
AlertQueryURL string `json:"alertQueryUrl,omitempty"`
// 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.
// Defaults to 0 (pod will be considered available as soon as it is ready)
// This is an alpha field from kubernetes 1.22 until 1.24 which requires enabling the StatefulSetMinReadySeconds feature gate.
// +optional
MinReadySeconds *uint32 `json:"minReadySeconds,omitempty"`
// Configures 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"`
// Configures 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"`
// Pods' hostAliases configuration
// +listType=map
// +listMapKey=ip
HostAliases []HostAlias `json:"hostAliases,omitempty"`
// AdditionalArgs allows setting 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"`
// Defines the configuration of the ThanosRuler web server.
// +optional
Web *ThanosRulerWebSpec `json:"web,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
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 {
// Represents whether any actions on the underlying managed objects are
// being performed. Only delete actions will be performed.
Paused bool `json:"paused"`
// Total number of non-terminated pods targeted by this ThanosRuler deployment
// (their labels match the selector).
Replicas int32 `json:"replicas"`
// Total number of non-terminated pods targeted by this ThanosRuler deployment
// that have the desired version spec.
UpdatedReplicas int32 `json:"updatedReplicas"`
// Total number of available pods (ready for at least minReadySeconds)
// targeted by this ThanosRuler deployment.
AvailableReplicas int32 `json:"availableReplicas"`
UnavailableReplicas int32 `json:"unavailableReplicas"`
// 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
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 ¶ added in v1.16.0
type ThanosRulerWebSpec struct {
WebConfigFileFields `json:",inline"`
}
ThanosRulerWebSpec defines the configuration of the ThanosRuler web server.
func (*ThanosRulerWebSpec) DeepCopy ¶ added in v1.16.0
func (in *ThanosRulerWebSpec) DeepCopy() *ThanosRulerWebSpec
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ThanosRulerWebSpec.
func (*ThanosRulerWebSpec) DeepCopyInto ¶ added in v1.16.0
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 {
// 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"`
// +optional
// Deprecated: use 'image' instead. The image's tag can be specified as as part of the image name.
Tag *string `json:"tag,omitempty"`
// +optional
// Deprecated: use 'image' instead. The image digest can be specified as part of the image name.
SHA *string `json:"sha,omitempty"`
// +optional
// Deprecated: use 'image' instead.
BaseImage *string `json:"baseImage,omitempty"`
// Defines the resources requests and limits of the Thanos sidecar.
Resources v1.ResourceRequirements `json:"resources,omitempty"`
// Defines the Thanos sidecar's configuration to upload TSDB blocks to object storage.
//
// More info: https://thanos.io/tip/thanos/storage.md/
//
// objectStorageConfigFile takes precedence over this field.
// +optional
ObjectStorageConfig *v1.SecretKeySelector `json:"objectStorageConfig,omitempty"`
// Defines the Thanos sidecar's configuration file to upload TSDB blocks to object storage.
//
// More info: https://thanos.io/tip/thanos/storage.md/
//
// This field takes precedence over objectStorageConfig.
// +optional
ObjectStorageConfigFile *string `json:"objectStorageConfigFile,omitempty"`
// Deprecated: use `grpcListenLocal` and `httpListenLocal` instead.
ListenLocal bool `json:"listenLocal,omitempty"`
// 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.
GRPCListenLocal bool `json:"grpcListenLocal,omitempty"`
// 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.
HTTPListenLocal bool `json:"httpListenLocal,omitempty"`
// 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"`
// 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.
TracingConfigFile string `json:"tracingConfigFile,omitempty"`
// Configures the TLS parameters for the gRPC server providing the StoreAPI.
//
// Note: Currently only the `caFile`, `certFile`, and `keyFile` fields are supported.
//
// +optional
GRPCServerTLSConfig *TLSConfig `json:"grpcServerTlsConfig,omitempty"`
// Log level for the Thanos sidecar.
// +kubebuilder:validation:Enum="";debug;info;warn;error
LogLevel string `json:"logLevel,omitempty"`
// Log format for the Thanos sidecar.
// +kubebuilder:validation:Enum="";logfmt;json
LogFormat string `json:"logFormat,omitempty"`
// 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.
MinTime string `json:"minTime,omitempty"`
// BlockDuration 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"
BlockDuration Duration `json:"blockSize,omitempty"`
// ReadyTimeout is the maximum time that the Thanos sidecar will wait for
// Prometheus to start.
ReadyTimeout Duration `json:"readyTimeout,omitempty"`
// How often to retrieve the Prometheus configuration.
GetConfigInterval Duration `json:"getConfigInterval,omitempty"`
// Maximum time to wait when retrieving the Prometheus configuration.
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.
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 ¶ added in v1.16.0
type TopologySpreadConstraint struct {
CoreV1TopologySpreadConstraint `json:",inline"`
//+optional
// Defines what Prometheus Operator managed labels should be added to labelSelector on the topologySpreadConstraint.
AdditionalLabelSelectors *AdditionalLabelSelectors `json:"additionalLabelSelectors,omitempty"`
}
func (*TopologySpreadConstraint) DeepCopy ¶ added in v1.16.0
func (in *TopologySpreadConstraint) DeepCopy() *TopologySpreadConstraint
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TopologySpreadConstraint.
func (*TopologySpreadConstraint) DeepCopyInto ¶ added in v1.16.0
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 ¶ added in v1.16.0
type TranslationStrategyOption string
TranslationStrategyOption represents a translation strategy option for the OTLP endpoint. Supported values are: * `NoUTF8EscapingWithSuffixes` * `UnderscoreEscapingWithSuffixes` +kubebuilder:validation:Enum=NoUTF8EscapingWithSuffixes;UnderscoreEscapingWithSuffixes
const ( NoUTF8EscapingWithSuffixes TranslationStrategyOption = "NoUTF8EscapingWithSuffixes" UnderscoreEscapingWithSuffixes TranslationStrategyOption = "UnderscoreEscapingWithSuffixes" )
type WebConfigFileFields ¶
type WebConfigFileFields struct {
// Defines the TLS parameters for HTTPS.
TLSConfig *WebTLSConfig `json:"tlsConfig,omitempty"`
// Defines HTTP parameters for web server.
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 {
// 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.
HTTP2 *bool `json:"http2,omitempty"`
// List of headers that can be added to HTTP responses.
Headers *WebHTTPHeaders `json:"headers,omitempty"`
}
WebHTTPConfig defines HTTP parameters for web server.
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 {
// Set the Content-Security-Policy header to HTTP responses.
// Unset if blank.
ContentSecurityPolicy string `json:"contentSecurityPolicy,omitempty"`
// Set 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
XFrameOptions string `json:"xFrameOptions,omitempty"`
// Set 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
XContentTypeOptions string `json:"xContentTypeOptions,omitempty"`
// Set the X-XSS-Protection header to all responses.
// Unset if blank.
// https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/X-XSS-Protection
XXSSProtection string `json:"xXSSProtection,omitempty"`
// Set 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
StrictTransportSecurity string `json:"strictTransportSecurity,omitempty"`
}
WebHTTPHeaders defines the list of headers that can be added to HTTP responses.
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 {
// 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"`
// 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"`
// 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"`
// 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"`
// Secret or ConfigMap containing the CA certificate for client certificate
// authentication to the server.
//
// It is mutually exclusive with `clientCAFile`.
//
// +optional
ClientCA SecretOrConfigMap `json:"client_ca,omitempty"`
// Path to the CA certificate file for client certificate authentication to
// the server.
//
// It is mutually exclusive with `client_ca`.
//
// +optional
ClientCAFile *string `json:"clientCAFile,omitempty"`
// The server policy for client TLS authentication.
//
// For more detail on clientAuth options:
// https://golang.org/pkg/crypto/tls/#ClientAuthType
//
// +optional
ClientAuthType *string `json:"clientAuthType,omitempty"`
// Minimum TLS version that is acceptable.
//
// +optional
MinVersion *string `json:"minVersion,omitempty"`
// Maximum TLS version that is acceptable.
//
// +optional
MaxVersion *string `json:"maxVersion,omitempty"`
// List of supported cipher suites for TLS versions up to TLS 1.2.
//
// 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"`
// Controls 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"`
// 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.
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.