prometheus

package
v1.107.1 Latest Latest
Warning

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

Go to latest
Published: Nov 12, 2024 License: Apache-2.0 Imports: 38 Imported by: 0

Documentation

Index

Constants

View Source
const (

	// ServicePortName is the name of the port in the Service specification.
	ServicePortName = "web"
)

Variables

View Source
var TimeoutWaitForManagedResource = 5 * time.Minute

TimeoutWaitForManagedResource is the timeout used while waiting for the ManagedResources to become healthy or deleted.

Functions

func CentralLoggingConfiguration added in v1.95.0

func CentralLoggingConfiguration() (component.CentralLoggingConfig, error)

CentralLoggingConfiguration returns a fluent-bit parser and filter for the monitoring logs.

Types

type AlertingValues

type AlertingValues struct {
	// Alertmanagers is a slice containing the alertmanager names (and namespaces) to which alerts should be sent.
	Alertmanagers []*Alertmanager
	// AdditionalAlertmanager contains the data of the 'alerting' secret (url, credentials, etc.).
	AdditionalAlertmanager map[string][]byte
}

AlertingValues contains alerting configuration for this Prometheus instance.

type Alertmanager added in v1.95.3

type Alertmanager struct {
	// Name is the name of the alertmanager to which alerts should be sent.
	Name string
	// Namespace is the namespace of the alertmanager to which alerts should be sent.
	// If not set, the namespace of the Prometheus instance is used.
	Namespace *string
}

Alertmanager contains the name and namespace of an alertmanager to which alerts should be sent.

type CentralConfigs

type CentralConfigs struct {
	// AdditionalScrapeConfigs are additional scrape configs which cannot be modelled with the CRDs of the Prometheus
	// operator.
	AdditionalScrapeConfigs []string
	// PrometheusRules is a list of central PrometheusRule objects for this prometheus instance.
	PrometheusRules []*monitoringv1.PrometheusRule
	// ScrapeConfigs is a list of central ScrapeConfig objects for this prometheus instance.
	ScrapeConfigs []*monitoringv1alpha1.ScrapeConfig
	// ServiceMonitors is a list of central ServiceMonitor objects for this prometheus instance.
	ServiceMonitors []*monitoringv1.ServiceMonitor
	// PodMonitors is a list of central PodMonitor objects for this prometheus instance.
	PodMonitors []*monitoringv1.PodMonitor
}

CentralConfigs contains configuration for this Prometheus instance that is created together with it. This should only contain configuration that cannot be directly assigned to another component package.

type CortexValues added in v1.94.0

type CortexValues struct {
	// Image defines the container image of cortex.
	Image string
	// CacheValidity defines the validity of the FIFO cache.
	CacheValidity time.Duration
}

CortexValues contains configuration for the cortex frontend sidecar container.

type IngressValues

type IngressValues struct {
	// AuthSecretName is the name of the auth secret.
	AuthSecretName string
	// Host is the hostname under which the Prometheus instance should be exposed.
	Host string
	// SecretsManager is the secrets manager used for generating the TLS certificate if no wildcard certificate is
	// provided.
	SecretsManager secretsmanager.Interface
	// SigningCA is the name of the CA that should be used the sign a self-signed server certificate. Only needed when
	// no wildcard certificate secret is provided.
	SigningCA string
	// WildcardCertSecretName is name of a secret containing the wildcard TLS certificate which is issued for the
	// ingress domain. If not provided, a self-signed server certificate will be created.
	WildcardCertSecretName *string
	// BlockManagementAndTargetAPIAccess controls whether access to the management and target APIs is blocked when
	// accessing Prometheus via ingress.
	BlockManagementAndTargetAPIAccess bool
}

IngressValues contains configuration for exposing this Prometheus instance via an Ingress resource.

type Interface added in v1.93.0

type Interface interface {
	component.DeployWaiter
	// SetIngressAuthSecret sets the ingress authentication secret name.
	SetIngressAuthSecret(*corev1.Secret)
	// SetIngressWildcardCertSecret sets the ingress wildcard certificate secret name.
	SetIngressWildcardCertSecret(*corev1.Secret)
	// SetCentralScrapeConfigs sets the central scrape configs.
	SetCentralScrapeConfigs([]*monitoringv1alpha1.ScrapeConfig)
	// SetNamespaceUID sets the namespace UID.
	SetNamespaceUID(name types.UID)
}

Interface contains functions for a Prometheus deployer.

func New

func New(log logr.Logger, client client.Client, namespace string, values Values) Interface

New creates a new instance of DeployWaiter for the prometheus.

type RemoteWriteValues added in v1.95.0

type RemoteWriteValues struct {
	// URL is the remote url.
	URL string
	// KeptMetrics is a list of metrics to keep.
	KeptMetrics []string
	// GlobalShootRemoteWriteSecret is a secret containing basic auth credentials for the remote write endpoint.
	GlobalShootRemoteWriteSecret *corev1.Secret
}

RemoteWriteValues contains remote write configuration for this Prometheus instance.

type TargetClusterValues added in v1.95.0

type TargetClusterValues struct {
	// ServiceAccountName is the name of the ServiceAccount.
	ServiceAccountName string
	// ScrapesMetrics specifies whether this Prometheus has scrape configs for scraping metrics from components running
	// in the target cluster.
	ScrapesMetrics bool
}

TargetClusterValues contains configuration in case Prometheus scrapes metrics from another kube-apiserver (e.g., virtual garden, or shoot cluster) or other components running in this cluster.

type Values

type Values struct {
	// Name is the name of the prometheus. It will be used for the resource names of Prometheus and ManagedResource.
	Name string
	// Image defines the container image of prometheus.
	Image string
	// Version is the version of prometheus.
	Version string
	// ClusterType is the type of the cluster.
	ClusterType component.ClusterType
	// PriorityClassName is the name of the priority class for the deployment.
	PriorityClassName string
	// StorageCapacity is the storage capacity of Prometheus.
	StorageCapacity resource.Quantity
	// Replicas is the number of replicas.
	Replicas int32
	// Retention is the duration for the data retention.
	Retention *monitoringv1.Duration
	// RetentionSize is the size for the data retention.
	RetentionSize monitoringv1.ByteSize
	// RuntimeVersion is the Kubernetes version of the runtime cluster.
	RuntimeVersion *semver.Version
	// ScrapeTimeout is the timeout duration when scraping targets.
	ScrapeTimeout monitoringv1.Duration
	// VPAMinAllowed defines the resource list for the minAllowed field for the prometheus container resource policy.
	VPAMinAllowed *corev1.ResourceList
	// ExternalLabels is the set of external labels for the Prometheus configuration.
	ExternalLabels map[string]string
	// AdditionalPodLabels is a map containing additional labels for the created pods.
	AdditionalPodLabels map[string]string
	// NamespaceUID is the UID of the namespace.
	NamespaceUID *types.UID
	// CentralConfigs contains configuration for this Prometheus instance that is created together with it. This should
	// only contain configuration that cannot be directly assigned to another component package.
	CentralConfigs CentralConfigs
	// IngressValues contains configuration for exposing this Prometheus instance via an Ingress resource.
	Ingress *IngressValues
	// Alerting contains alerting configuration for this Prometheus instance.
	Alerting *AlertingValues
	// RemoteWrite contains remote write configuration for this Prometheus instance.
	RemoteWrite *RemoteWriteValues
	// AdditionalResources contains any additional resources which get added to the ManagedResource.
	AdditionalResources []client.Object
	// Cortex contains configuration for the cortex frontend sidecar container.
	Cortex *CortexValues
	// TargetCluster contains configuration in case Prometheus scrapes metrics from another kube-apiserver (e.g.,
	// virtual garden, or shoot cluster) or other components running in this cluster.
	TargetCluster *TargetClusterValues
	// AdditionalAlertRelabelConfigs contains additional alert relabel configurations.
	AdditionalAlertRelabelConfigs []monitoringv1.RelabelConfig
	// RestrictToNamespace controls whether the Prometheus instance should only scrape its targets in its own namespace.
	RestrictToNamespace bool
	// ResourceRequests defines the initial resource requests
	ResourceRequests *corev1.ResourceList
}

Values contains configuration values for the prometheus resources.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL