config

package
v0.66.1 Latest Latest
Warning

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

Go to latest
Published: Mar 19, 2026 License: Apache-2.0 Imports: 5 Imported by: 1

Documentation

Index

Constants

View Source
const (
	AWSClusterKind         = "AWSCluster"
	AWSClusterKindProvider = "capa"

	AWSManagedClusterKind         = "AWSManagedCluster"
	AWSManagedClusterKindProvider = "eks"

	AzureClusterKind         = "AzureCluster"
	AzureClusterKindProvider = "capz"

	AzureManagedClusterKind         = "AzureManagedCluster"
	AzureManagedClusterKindProvider = "aks"

	VCDClusterKind         = "VCDCluster"
	VCDClusterKindProvider = "cloud-director"

	VSphereClusterKind         = "VSphereCluster"
	VSphereClusterKindProvider = "vsphere"

	GCPClusterKind         = "GCPCluster"
	GCPClusterKindProvider = "gcp"

	GCPManagedClusterKind         = "GCPManagedCluster"
	GCPManagedClusterKindProvider = "gke"
)
View Source
const KEDAAuthenticationLabel = "observability.giantswarm.io/keda-authentication"
View Source
const KEDADefaultNamespace = "keda"
View Source
const KEDANamespaceAnnotation = "observability.giantswarm.io/keda-namespace"
View Source
const LegacyKEDAAuthenticationLabel = "giantswarm.io/keda-authentication"
View Source
const LegacyKEDANamespaceAnnotation = "giantswarm.io/keda-namespace"
View Source
const LegacyLoggingLabel = "giantswarm.io/logging"
View Source
const LegacyMonitoringLabel = "giantswarm.io/monitoring"
View Source
const LegacyNetworkMonitoringLabel = "giantswarm.io/network-monitoring"
View Source
const LegacyTracingLabel = "giantswarm.io/tracing"
View Source
const LoggingLabel = "observability.giantswarm.io/logging"
View Source
const MonitoringLabel = "observability.giantswarm.io/monitoring"
View Source
const NetworkMonitoringLabel = "observability.giantswarm.io/network-monitoring"
View Source
const TracingLabel = "observability.giantswarm.io/tracing"

Variables

This section is empty.

Functions

func GetKEDANamespace added in v0.59.0

func GetKEDANamespace(cluster *clusterv1.Cluster) string

GetKEDANamespace returns the KEDA operator namespace configured for a cluster via annotation. Defaults to "keda" if the annotation is not set.

Types

type ClusterConfig added in v0.43.0

type ClusterConfig struct {
	// BaseDomain is the base domain of the management cluster.
	BaseDomain string
	// Customer is the customer name of the management cluster.
	Customer string
	// InsecureCA is a flag to indicate if the management cluster has an insecure CA that should be trusted
	InsecureCA bool
	// Name is the name of the management cluster.
	Name string
	// Pipeline is the pipeline name of the management cluster.
	Pipeline string
	// Region is the region of the management cluster.
	Region string
}

ClusterConfig represents the configuration for the management cluster.

func (ClusterConfig) GetClusterProvider added in v0.43.0

func (c ClusterConfig) GetClusterProvider(cluster *clusterv1.Cluster) (string, error)

GetClusterProvider returns the provider for the given cluster.

func (ClusterConfig) GetClusterType added in v0.43.0

func (c ClusterConfig) GetClusterType(cluster *clusterv1.Cluster) string

GetClusterType returns the type of the cluster (management_cluster or workload_cluster).

func (ClusterConfig) IsWorkloadCluster added in v0.43.0

func (c ClusterConfig) IsWorkloadCluster(cluster *clusterv1.Cluster) bool

IsWorkloadCluster determines if the given cluster is a workload cluster (not the management cluster).

func (ClusterConfig) Validate added in v0.43.0

func (c ClusterConfig) Validate() error

Validate validates the cluster configuration.

type Config

type Config struct {
	// Operator-level configuration
	Operator OperatorConfig

	// Subsystem configurations
	Logging    LoggingConfig
	Grafana    GrafanaConfig
	Monitoring MonitoringConfig
	Tracing    TracingConfig

	// Management cluster configuration
	Cluster ClusterConfig

	// Environment and runtime settings
	Environment EnvironmentConfig
}

Config represents the main configuration for the observability operator.

func (Config) Validate added in v0.43.0

func (c Config) Validate() error

Validate validates the entire configuration.

type EnvironmentConfig added in v0.43.0

type EnvironmentConfig struct {
	CronitorHeartbeatManagementKey string `env:"CRONITOR_HEARTBEAT_MANAGEMENT_KEY"`
	CronitorHeartbeatPingKey       string `env:"CRONITOR_HEARTBEAT_PING_KEY"`
}

EnvironmentConfig represents environment-specific configuration.

type GrafanaConfig added in v0.43.0

type GrafanaConfig struct {
	URL *url.URL
}

GrafanaConfig represents the Grafana-specific configuration.

func (GrafanaConfig) Validate added in v0.43.0

func (c GrafanaConfig) Validate() error

Validate validates the Grafana configuration

type LoggingConfig added in v0.43.0

type LoggingConfig struct {
	// Enabled controls logging at the installation level
	Enabled bool

	// OTLPEnabled controls whether OTLP log ingestion is enabled via the events collector
	OTLPEnabled bool

	// EnableNodeFiltering enables node filtering in Alloy logging configuration
	EnableNodeFiltering bool

	// DefaultNamespaces is the list of namespaces to collect logs from by default
	DefaultNamespaces []string

	// IncludeEventsNamespaces is the list of namespaces to collect events from
	// If empty, collect from all namespaces
	IncludeEventsNamespaces []string

	// ExcludeEventsNamespaces is the list of namespaces to exclude events from
	ExcludeEventsNamespaces []string
}

LoggingConfig represents the configuration used by the logging package.

func (LoggingConfig) IsLoggingEnabled added in v0.52.0

func (l LoggingConfig) IsLoggingEnabled(cluster *clusterv1.Cluster) bool

IsLoggingEnabled checks if logging is enabled for a specific cluster. Logging is enabled when all conditions are met:

  • logging is enabled at the installation level (global flag)
  • cluster is not being deleted
  • cluster-specific logging label is set to true (or missing/invalid, defaulting to true)

func (LoggingConfig) Validate added in v0.43.0

func (l LoggingConfig) Validate() error

Validate validates the logging configuration

type MonitoringConfig added in v0.43.0

type MonitoringConfig struct {
	// Enabled controls monitoring at the installation level
	Enabled bool

	// NetworkEnabled controls network monitoring at the installation level
	NetworkEnabled bool

	// OTLPEnabled controls whether OTLP metrics ingestion is enabled via the events collector
	OTLPEnabled bool

	AlertmanagerSecretName string
	AlertmanagerURL        string
	AlertmanagerEnabled    bool

	DefaultShardingStrategy sharding.Strategy
	// WALTruncateFrequency is the frequency at which the WAL segments should be truncated.
	WALTruncateFrequency time.Duration
	MetricsQueryURL      string
	QueueConfig          QueueConfig
	// ExemplarsEnabled controls whether exemplars are forwarded in the remote write pipeline.
	// Uses opt-out model: enabled by default.
	ExemplarsEnabled bool
}

MonitoringConfig represents the configuration used by the monitoring package.

func (MonitoringConfig) IsKEDAAuthenticationEnabled added in v0.59.0

func (c MonitoringConfig) IsKEDAAuthenticationEnabled(cluster *clusterv1.Cluster) bool

IsKEDAAuthenticationEnabled checks if KEDA authentication is enabled for a cluster. Uses opt-in model: disabled by default, must be explicitly enabled. When enabled, creates a ClusterTriggerAuthentication resource for KEDA ScaledObjects to authenticate with Mimir for querying metrics.

func (MonitoringConfig) IsMonitoringEnabled added in v0.53.0

func (c MonitoringConfig) IsMonitoringEnabled(cluster *clusterv1.Cluster) bool

IsMonitoringEnabled checks if monitoring is enabled for a cluster. Uses opt-out model: enabled by default unless explicitly disabled.

func (MonitoringConfig) IsNetworkMonitoringEnabled added in v0.56.0

func (c MonitoringConfig) IsNetworkMonitoringEnabled(cluster *clusterv1.Cluster) bool

IsNetworkMonitoringEnabled checks if network monitoring is enabled for a cluster. Uses opt-in model: disabled by default, must be explicitly enabled. TODO revisit this logic in the future when network monitoring is more widely adopted.

func (MonitoringConfig) Validate added in v0.43.0

func (c MonitoringConfig) Validate() error

Validate validates the monitoring configuration

type OperatorConfig added in v0.43.0

type OperatorConfig struct {
	MetricsAddr          string
	EnableLeaderElection bool
	ProbeAddr            string
	SecureMetrics        bool
	EnableHTTP2          bool
	WebhookCertPath      string
	OperatorNamespace    string
}

OperatorConfig represents the operator-level configuration.

func (OperatorConfig) Validate added in v0.43.0

func (c OperatorConfig) Validate() error

Validate validates the operator configuration

type QueueConfig added in v0.43.0

type QueueConfig struct {
	BatchSendDeadline *string
	Capacity          *int
	MaxBackoff        *string
	MaxSamplesPerSend *int
	MaxShards         *int
	MinBackoff        *string
	MinShards         *int
	RetryOnHttp429    *bool
	SampleAgeLimit    *string
}

QueueConfig represents the configuration for the remote write queue.

type TracingConfig added in v0.43.0

type TracingConfig struct {
	// Enabled controls tracing at the installation level
	Enabled bool
}

TracingConfig represents the configuration for tracing support in Grafana.

func (TracingConfig) IsTracingEnabled added in v0.52.0

func (c TracingConfig) IsTracingEnabled(cluster *clusterv1.Cluster) bool

IsTracingEnabled checks if tracing is enabled for a specific cluster. Tracing is enabled when all conditions are met:

  • tracing is enabled at the installation level (global flag)
  • cluster is not being deleted
  • cluster-specific tracing label is set to true (or missing/invalid, defaulting to true)

func (TracingConfig) Validate added in v0.43.0

func (c TracingConfig) Validate() error

Validate validates the tracing configuration

Jump to

Keyboard shortcuts

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