kubernetes

package
v0.0.0-...-c817a75 Latest Latest
Warning

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

Go to latest
Published: Mar 31, 2020 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client interface {
	// GetEndpoints fetches the endpoints for a given namespace and name
	GetEndpoints(namespace, name string) (*v1.Endpoints, error)
	// WatchEndpoints returns a watcher of Endpoints watch API
	WatchEndpoints(namespace, name string) (watch.Interface, error)
	// GetPodsWithLabels fetches pod list for given namespace and label selectors
	// Label selectors need to sent in the format of key=value,key2=value2
	GetPodsWithLabels(namespace, labelSelectors string) (*v1.PodList, error)
	// WatchPodsWithLabels watches pods for given namespace and label selectors
	// Label selectors need to sent in the format of key=value,key2=value2
	WatchPodsWithLabels(namespace, labelSelectors string) (watch.Interface, error)
}

Client represents a Kubernetes client. It abstracts and proxies call to kubernetes API. Make sure to return Kubernetes objects always so that it remains as a proxy with few abstractions

func NewClient

func NewClient(kubeconfig string) (Client, error)

NewClient creates a clientset for given kubeconfig file. If kubeconfig is empty, it creates a InClusterClient. Errors out if client cannot be created.

Jump to

Keyboard shortcuts

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