kube

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Nov 2, 2022 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ExporterMetricName = "kube_annotations_exporter"
)

Functions

func ResourceMapping

func ResourceMapping(kubeLabelNames, kubeAnnotationsNames []string, maxRevisions int, onlyLabelsAndAnnotations bool, referenceLabels, referenceAnnotations []string) collector.Mapping

ResourceMapping creates the mapping for the prometheus metrics vault. The order of the labels here should match the one from the sample converter function.

func ResourceToSample

func ResourceToSample(resource *unstructured.Unstructured) collector.Sample

ResourceToSample converts Kubernetes unstructured.Unstructured to the prometheus metric sample.

Types

type InformerController

type InformerController struct {
	// contains filtered or unexported fields
}

InformerController handles Kubernetes events for resourcess. The is the shim between metrics storage and Kubernetes cluster.

func NewResourcesInformer

func NewResourcesInformer(config *rest.Config, namespaces []string, resources []schema.GroupVersionResource,
	metricCollector *collector.MetricsVault) (*InformerController, error)

NewResourcesInformer creates cached informer to track resources from a Kubernetes cluster.

func (*InformerController) Run

func (c *InformerController) Run(ctx context.Context, errorCh chan<- error)

Run starts the informers for different resources with various handlers and waits for the first cache synchronization.

Jump to

Keyboard shortcuts

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