kubernetes

package
v0.27.0-rc.1 Latest Latest
Warning

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

Go to latest
Published: Aug 29, 2022 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultConfig = SDConfig{
	HTTPClientConfig: config.DefaultHTTPClientConfig,
}

DefaultConfig holds defaults for SDConfig. (copied from prometheus)

Functions

This section is empty.

Types

type Component

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

Component implements the discovery.k8s component.

func New

func New(o component.Options, args SDConfig) (*Component, error)

New creates a new discovery.k8s component.

func (*Component) Run

func (c *Component) Run(ctx context.Context) error

Run implements component.Component.

func (*Component) Update

func (c *Component) Update(args component.Arguments) error

Update implements component.Compnoent.

type Exports

type Exports struct {
	Targets []discovery.Target `river:"targets,attr"`
}

Exports holds values which are exported by the discovery.k8s component.

type NamespaceDiscovery

type NamespaceDiscovery struct {
	IncludeOwnNamespace bool     `river:"own_namespace,attr,optional"`
	Names               []string `river:"names,attr,optional"`
}

NamespaceDiscovery mirroring prometheus type

type SDConfig

type SDConfig struct {
	APIServer          config.URL              `river:"api_server,attr,optional"`
	Role               string                  `river:"role,attr"`
	KubeConfig         string                  `river:"kubeconfig_file,attr,optional"`
	HTTPClientConfig   config.HTTPClientConfig `river:"http_client_config,block,optional"`
	NamespaceDiscovery NamespaceDiscovery      `river:"namespaces,block,optional"`
	Selectors          []SelectorConfig        `river:"selectors,block,optional"`
}

SDConfig is a conversion of discover/kubernetes/SDConfig to be compatible with flow

func (*SDConfig) Convert

func (sd *SDConfig) Convert() *promk8s.SDConfig

Convert to prometheus config type

func (*SDConfig) UnmarshalRiver

func (sd *SDConfig) UnmarshalRiver(f func(interface{}) error) error

UnmarshalRiver simply applies defaults then unmarshals regularly

type SelectorConfig

type SelectorConfig struct {
	Role  string `river:"role,attr"`
	Label string `river:"label,attr,optional"`
	Field string `river:"field,attr,optional"`
}

SelectorConfig mirroring prometheus type

Jump to

Keyboard shortcuts

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