kubernetes

package
v1.9.1 Latest Latest
Warning

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

Go to latest
Published: Jun 5, 2025 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultClientArguments = ClientArguments{
	HTTPClientConfig: commoncfg.DefaultHTTPClientConfig,
}

DefaultClientArguments holds default values for Arguments.

Functions

func ConvertSelectorToListOptions

func ConvertSelectorToListOptions(selector LabelSelector) (labels.Selector, error)

func NewQueuedEventHandler

func NewQueuedEventHandler(log log.Logger, queue workqueue.TypedRateLimitingInterface[Event]) *queuedEventHandler

Types

type ClientArguments

type ClientArguments struct {
	APIServer        commoncfg.URL              `alloy:"api_server,attr,optional"`
	KubeConfig       string                     `alloy:"kubeconfig_file,attr,optional"`
	HTTPClientConfig commoncfg.HTTPClientConfig `alloy:",squash"`
}

ClientArguments controls how to connect to a Kubernetes cluster.

func (*ClientArguments) BuildRESTConfig

func (args *ClientArguments) BuildRESTConfig(l log.Logger) (*rest.Config, error)

BuildRESTConfig converts ClientArguments to a Kubernetes REST config.

func (*ClientArguments) SetToDefault

func (args *ClientArguments) SetToDefault()

SetToDefault implements syntax.Defaulter.

func (*ClientArguments) Validate

func (args *ClientArguments) Validate() error

Validate implements syntax.Validator.

type Event

type Event struct {
	Typ       EventType
	ObjectKey string
}

This type must be hashable, so it is kept simple. The indexer will maintain a cache of current state, so this is mostly used for logging.

type EventType

type EventType string
const (
	EventTypeResourceChanged EventType = "resource-changed"
)

type LabelSelector

type LabelSelector struct {
	MatchLabels      map[string]string `alloy:"match_labels,attr,optional"`
	MatchExpressions []MatchExpression `alloy:"match_expression,block,optional"`
}

type MatchExpression

type MatchExpression struct {
	Key      string   `alloy:"key,attr"`
	Operator string   `alloy:"operator,attr"`
	Values   []string `alloy:"values,attr,optional"`
}

type MimirRuleGroupDiff added in v1.9.0

type MimirRuleGroupDiff struct {
	Kind    RuleGroupDiffKind
	Actual  client.MimirRuleGroup
	Desired client.MimirRuleGroup
}

type MimirRuleGroupDiffsByNamespace added in v1.9.0

type MimirRuleGroupDiffsByNamespace map[string][]MimirRuleGroupDiff

func DiffMimirRuleGroupState added in v1.9.0

func DiffMimirRuleGroupState(desired, actual MimirRuleGroupsByNamespace) MimirRuleGroupDiffsByNamespace

type MimirRuleGroupsByNamespace added in v1.9.0

type MimirRuleGroupsByNamespace map[string][]client.MimirRuleGroup

type PrometheusRuleGroupDiff added in v1.9.0

type PrometheusRuleGroupDiff struct {
	Kind    RuleGroupDiffKind
	Actual  rulefmt.RuleGroup
	Desired rulefmt.RuleGroup
}

type PrometheusRuleGroupDiffsByNamespace added in v1.9.0

type PrometheusRuleGroupDiffsByNamespace map[string][]PrometheusRuleGroupDiff

func DiffPrometheusRuleGroupState added in v1.9.0

func DiffPrometheusRuleGroupState(desired, actual PrometheusRuleGroupsByNamespace) PrometheusRuleGroupDiffsByNamespace

type PrometheusRuleGroupsByNamespace added in v1.9.0

type PrometheusRuleGroupsByNamespace map[string][]rulefmt.RuleGroup

type RuleGroupDiffKind

type RuleGroupDiffKind string
const (
	RuleGroupDiffKindAdd    RuleGroupDiffKind = "add"
	RuleGroupDiffKindRemove RuleGroupDiffKind = "remove"
	RuleGroupDiffKindUpdate RuleGroupDiffKind = "update"
)

Jump to

Keyboard shortcuts

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