kubernetes

package
v0.0.0-...-d596a3d Latest Latest
Warning

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

Go to latest
Published: Dec 10, 2021 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Alertmanagers

func Alertmanagers(kubeconfig string) (monitoringv1typed.AlertmanagerInterface, error)

Alertmanagers returns Alertmanager CRD client in monitoring namespace.

func MatchLabel

func MatchLabel(key, value string) (labels.Selector, error)

MatchLabel matches a resource with the specified label

func NewMonitoringClient

func NewMonitoringClient(kubeconfig string) (*monitoring.Clientset, error)

NewMonitoringClient returns a new in-cluster Prometheus CRD API client.

func Prometheuses

func Prometheuses(kubeconfig string) (monitoringv1typed.PrometheusInterface, error)

Prometheuses returns Prometheus CRD client in monitoring namespace.

Types

type Client

type Client struct {
	*kubernetes.Clientset
}

Client is the Kubernetes API client

func NewClient

func NewClient(kubeconfig string) (*Client, error)

NewClient returns a new Kubernetes API client

func (*Client) WatchConfigMaps

func (c *Client) WatchConfigMaps(ctx context.Context, configs ...ConfigMap)

WatchConfigMaps watches Kubernetes API for ConfigMaps using specified configs to match and send updates

func (*Client) WatchSecrets

func (c *Client) WatchSecrets(ctx context.Context, configs ...Secret)

WatchSecrets watches Kubernetes API for Secrets using specified configs to match and send updates

type ConfigMap

type ConfigMap struct {
	// Selector specifies the selector for this ConfigMap
	Selector labels.Selector
	// RecvCh specifies the channel that receives updates on the matched resource
	RecvCh chan ConfigMapUpdate
}

ConfigMap describes matching and sending updates for ConfigMaps. If Match matches a resource, RecvCh channel receives the data from the matched resource

type ConfigMapUpdate

type ConfigMapUpdate struct {
	// ResourceUpdate describes the common resource update metadata
	ResourceUpdate
	// Data descrines the update data payload
	Data map[string]string
}

ConfigMapUpdate describes a ConfigMap update

type Label

type Label struct {
	Key   string
	Value string
}

Label represents a Kubernetes label which is used as a search target for ConfigMaps

type ResourceUpdate

type ResourceUpdate struct {
	// EventType specifies the type of event
	watch.EventType
	// TypeMeta references the resource type metadata
	metav1.TypeMeta
	// ObjectMeta references the resource metadata
	metav1.ObjectMeta
}

ResourceUpdate describes an update for a resource

func (ResourceUpdate) Meta

func (r ResourceUpdate) Meta() string

Meta formats the metadata for readability

func (ResourceUpdate) String

func (r ResourceUpdate) String() string

String formats this update for readability

type Secret

type Secret struct {
	// Selector specifies the selector for this Secret
	Selector labels.Selector
	// RecvCh specifies the channel that receives updates on the matched resource
	RecvCh chan SecretUpdate
}

Secret describes matching and sending updates for Secrets. If Match matches a resource, RecvCh channel receives the data from the matched resource

type SecretUpdate

type SecretUpdate struct {
	// ResourceUpdate describes the common resource update metadata
	ResourceUpdate
	// Data descrines the update data payload
	Data map[string][]byte
}

SecretUpdate describes a Secret update

Jump to

Keyboard shortcuts

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