Documentation ¶
Overview ¶
Package mla contains controllers that are responsible for configuring MLA (Monitoring, Logging, and Alerting) for user clusters. - org grafana controller - create/update/delete Grafana organizations based on Kubermatic Projects - user grafana controller - create/update/delete Grafana Users to organizations based on Kubermatic UserProjectBindings - datasource grafana controller - create/update/delete Grafana Datasources to organizations based on Kubermatic Clusters - alertmanager configuration controller - manage alertmanager configuration based on Kubermatic Clusters
Index ¶
- Constants
- func Add(mgr manager.Manager, log *zap.SugaredLogger, numWorkers int, workerName string, ...) error
- func GatewayCAReconciler() reconciling.NamedSecretReconcilerFactory
- func GatewayCertificateReconciler(c *kubermaticv1.Cluster, ...) reconciling.NamedSecretReconcilerFactory
- func GatewayConfigMapReconciler(c *kubermaticv1.Cluster, mlaNamespace string, s *kubermaticv1.MLAAdminSetting) reconciling.NamedConfigMapReconcilerFactory
- func GatewayDeploymentReconciler(data *resources.TemplateData, settings *kubermaticv1.MLAAdminSetting) reconciling.NamedDeploymentReconcilerFactory
- func GatewayExternalServiceReconciler(c *kubermaticv1.Cluster) reconciling.NamedServiceReconcilerFactory
- func GatewayInternalServiceReconciler() reconciling.NamedServiceReconcilerFactory
- func GetGrafanaOrgUser(ctx context.Context, grafanaClient *grafanasdk.Client, orgID, uid uint) (*grafanasdk.OrgUser, error)
- func ResourcesOnDeletion(clusterNamespace string) []ctrlruntimeclient.Object
- type Overrides
- type TenantOverride
Constants ¶
const ( AlertmanagerConfigEndpoint = "/api/v1/alerts" AlertmanagerTenantHeaderName = "X-Scope-OrgID" )
const ( ControllerName = "kkp-mla-controller" GrafanaUserKey = "admin-user" GrafanaPasswordKey = "admin-password" )
const ( RuntimeConfigMap = "cortex-runtime-config" RuntimeConfigFileName = "runtime-config.yaml" )
const ( MetricsRuleGroupConfigEndpoint = "/api/v1/rules" LogRuleGroupConfigEndpoint = "/loki/api/v1/rules" RuleGroupTenantHeaderName = "X-Scope-OrgID" )
const (
GrafanaOrgAnnotationKey = "mla.k8c.io/organization"
)
const (
PrometheusType = "prometheus"
)
Variables ¶
This section is empty.
Functions ¶
func Add ¶
func Add( mgr manager.Manager, log *zap.SugaredLogger, numWorkers int, workerName string, versions kubermatic.Versions, mlaNamespace string, grafanaURL string, grafanaHeader string, grafanaSecret string, overwriteRegistry string, cortexAlertmanagerURL string, cortexRulerURL string, lokiRulerURL string, mlaEnabled bool, ) error
Add creates a new MLA controller that is responsible for managing Monitoring, Logging and Alerting for user clusters. * org grafana controller - create/update/delete Grafana organizations based on Kubermatic Projects * user grafana controller - create/update/delete Grafana Global Users based on Kubermatic User and its Group/UserProjectBindings * datasource grafana controller - create/update/delete Grafana Datasources to organizations based on Kubermatic Clusters * alertmanager configuration controller - manage alertmanager configuration based on Kubermatic Clusters * rule group controller - manager rule groups that will be used to generate alerts. * dashboard grafana controller - create/delete Grafana dashboards based on configmaps with prefix `grafana-dashboards` * ratelimit cortex controller - updates Cortex runtime configuration with rate limits based on kubermatic MLAAdminSetting * cleanup controller - this controller runs when mla disabled and clean objects that left from other MLA controller.
func GatewayCAReconciler ¶ added in v2.22.0
func GatewayCAReconciler() reconciling.NamedSecretReconcilerFactory
GatewayCAReconciler returns a function to create the ECDSA-based CA to be used for MLA Gateway.
func GatewayCertificateReconciler ¶ added in v2.22.0
func GatewayCertificateReconciler(c *kubermaticv1.Cluster, mlaGatewayCAGetter func() (*resources.ECDSAKeyPair, error)) reconciling.NamedSecretReconcilerFactory
GatewayCertificateReconciler returns a function to create/update a secret with the MLA gateway TLS certificate.
func GatewayConfigMapReconciler ¶ added in v2.22.0
func GatewayConfigMapReconciler(c *kubermaticv1.Cluster, mlaNamespace string, s *kubermaticv1.MLAAdminSetting) reconciling.NamedConfigMapReconcilerFactory
func GatewayDeploymentReconciler ¶ added in v2.22.0
func GatewayDeploymentReconciler(data *resources.TemplateData, settings *kubermaticv1.MLAAdminSetting) reconciling.NamedDeploymentReconcilerFactory
func GatewayExternalServiceReconciler ¶ added in v2.22.0
func GatewayExternalServiceReconciler(c *kubermaticv1.Cluster) reconciling.NamedServiceReconcilerFactory
func GatewayInternalServiceReconciler ¶ added in v2.22.0
func GatewayInternalServiceReconciler() reconciling.NamedServiceReconcilerFactory
func GetGrafanaOrgUser ¶ added in v2.19.0
func GetGrafanaOrgUser(ctx context.Context, grafanaClient *grafanasdk.Client, orgID, uid uint) (*grafanasdk.OrgUser, error)
func ResourcesOnDeletion ¶ added in v2.18.0
func ResourcesOnDeletion(clusterNamespace string) []ctrlruntimeclient.Object
Types ¶
type Overrides ¶ added in v2.19.0
type Overrides struct {
Overrides map[string]TenantOverride `yaml:"overrides"`
}
type TenantOverride ¶ added in v2.19.0
type TenantOverride struct { IngestionRate *int32 `yaml:"ingestion_rate,omitempty"` MaxSeriesPerMetric *int32 `yaml:"max_series_per_metric,omitempty"` MaxSeriesPerQuery *int32 `yaml:"max_series_per_query,omitempty"` MaxSamplesPerQuery *int32 `yaml:"max_samples_per_query,omitempty"` IngestionBurstSize *int32 `yaml:"ingestion_burst_size,omitempty"` MaxSeriesTotal *int32 `yaml:"max_series_per_user,omitempty"` }
Source Files ¶
- alertmanager_controller.go
- cleanup_controller.go
- dashboard_grafana_controller.go
- datasource_grafana_controller.go
- deletion.go
- doc.go
- grafana.go
- mla.go
- org_grafana_controller.go
- ratelimit_cortex_controller.go
- resources.go
- rulegroup_controller.go
- rulegroup_sync_controller.go
- upb_controller.go
- user_grafana_controller.go