config

package
v0.0.0-...-a435b9f Latest Latest
Warning

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

Go to latest
Published: Dec 19, 2024 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ClusterNameKey                  = "cluster-name"
	HubInfoSecretName               = "hub-info-secret"
	HubInfoSecretKey                = "hub-info.yaml" // #nosec G101 -- Not a hardcoded credential.
	ObservatoriumAPIRemoteWritePath = "/api/metrics/v1/default/api/v1/receive"
	AnnotationSkipCreation          = "skip-creation-if-exist"

	ClusterLabelKeyForAlerts = "managed_cluster"

	CollectorImage               = "COLLECTOR_IMAGE"
	InstallPrometheus            = "INSTALL_PROM"
	PullSecret                   = "PULL_SECRET"
	ImageConfigMap               = "images-list"
	AllowlistConfigMapName       = "observability-metrics-allowlist"
	AllowlistCustomConfigMapName = "observability-metrics-custom-allowlist"
	MetricsConfigMapKey          = "metrics_list.yaml"
	UwlMetricsConfigMapKey       = "uwl_metrics_list.yaml"
	PrometheusUserWorkload       = "prometheus-user-workload"
	MetricsOcp311ConfigMapKey    = "ocp311_metrics_list.yaml"
	CaConfigmapName              = "metrics-collector-serving-certs-ca-bundle"
	HubMetricsCollectorMtlsCert  = "observability-controller-open-cluster-management.io-observability-signer-client-cert"
	ClientCACertificateCN        = "observability-client-ca-certificate"
)
View Source
const (
	OCPClusterMonitoringNamespace         = "openshift-monitoring"
	OCPClusterMonitoringConfigMapName     = "cluster-monitoring-config"
	OCPClusterMonitoringConfigMapKey      = "config.yaml"
	OCPClusterMonitoringPrometheusService = "prometheus-k8s"
)
View Source
const (
	MetricsCollectorImgName = "metrics-collector"
	MetricsCollectorKey     = "metrics_collector"

	PrometheusImgName = "prometheus"
	PrometheusKey     = "prometheus"

	KubeStateMetricsImgName = "kube-state-metrics"
	KubeStateMetricsKey     = "kube_state_metrics"

	NodeExporterImgName = "node-exporter"
	NodeExporterKey     = "node_exporter"

	KubeRbacProxyImgName = "kube-rbac-proxy"
	KubeRbacProxyKey     = "kube_rbac_proxy"

	PrometheusOperatorImgName = "prometheus-operator"
	PrometheusOperatorKey     = "prometheus_operator"

	PrometheusConfigmapReloaderImgName = "prometheus-config-reloader"
	PrometheusConfigmapReloaderKey     = "prometheus_config_reloader"
)
View Source
const (
	WorkloadPartitioningPodAnnotationKey = "target.workload.openshift.io/management"
	WorkloadPodExpectedValueJSON         = "{\"effect\":\"PreferredDuringScheduling\"}"
	WorkloadPartitioningNSAnnotationsKey = "workload.openshift.io/allowed"
	WorkloadPartitioningNSExpectedValue  = "management"
)

Annotations to uspport OpenShift workload partitioning.

View Source
const (
	DefaultClusterType  = ""
	OcpThreeClusterType = "ocp3"
	SnoClusterType      = "SNO"
)

Variables

View Source
var (
	IsMCOTerminating = false
)

Functions

This section is empty.

Types

type CollectRule

type CollectRule struct {
	Collect     string            `yaml:"collect"`
	Annotations map[string]string `yaml:"annotations"`
	Expr        string            `yaml:"expr"`
	For         string            `yaml:"for"`
	Metrics     DynamicMetrics    `yaml:"dynamic_metrics"`
}

type CollectRuleGroup

type CollectRuleGroup struct {
	Name            string              `yaml:"group"`
	Annotations     map[string]string   `yaml:"annotations"`
	Selector        CollectRuleSelector `yaml:"selector"`
	CollectRuleList []CollectRule       `yaml:"rules"`
}

CollectRuleGroup structure contains information of a group of collect rules used for dnamically collecting metrics.

type CollectRuleSelector

type CollectRuleSelector struct {
	MatchExpression []metav1.LabelSelectorRequirement `yaml:"matchExpressions"`
}

type DynamicMetrics

type DynamicMetrics struct {
	NameList  []string `yaml:"names"`
	MatchList []string `yaml:"matches"`
}

type HubInfo

type HubInfo struct {
	ClusterName              string `yaml:"cluster-name"`
	ObservatoriumAPIEndpoint string `yaml:"observatorium-api-endpoint"`
	AlertmanagerEndpoint     string `yaml:"alertmanager-endpoint"`
	AlertmanagerRouterCA     string `yaml:"alertmanager-router-ca"`
}

HubInfo is the struct that contains the common information about the hub cluster, for example the name of managed cluster on the hub, the URL of observatorium api gateway, the URL of hub alertmanager and the CA for the hub router.

type MetricsAllowlist

type MetricsAllowlist struct {
	NameList             []string           `yaml:"names"`
	MatchList            []string           `yaml:"matches"`
	RenameMap            map[string]string  `yaml:"renames"`
	RuleList             []RecordingRule    `yaml:"rules"` //deprecated
	RecordingRuleList    []RecordingRule    `yaml:"recording_rules"`
	CollectRuleGroupList []CollectRuleGroup `yaml:"collect_rules"`
}

type RecordingRule

type RecordingRule struct {
	Record string `yaml:"record"`
	Expr   string `yaml:"expr"`
}

Jump to

Keyboard shortcuts

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