k8s

package
v18.7.3+incompatible Latest Latest
Warning

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

Go to latest
Published: Jul 31, 2018 License: Apache-2.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewClientSet

func NewClientSet(kubeConfig string) (*kubernetes.Clientset, error)

Types

type API added in v0.4.4

type API struct {
	Client kubernetes.Interface
	// contains filtered or unexported fields
}

API provides shared informers for all Kubernetes objects

func NewAPI added in v0.4.4

func NewAPI(k8sClient kubernetes.Interface, resources ...ApiResource) *API

NewAPI takes a Kubernetes client and returns an initialized API

func NewFakeAPI added in v0.4.4

func NewFakeAPI(configs ...string) (*API, error)

func (*API) CM added in v0.4.4

func (*API) Deploy added in v0.4.4

func (api *API) Deploy() appinformers.DeploymentInformer

func (*API) Endpoint added in v0.4.4

func (api *API) Endpoint() coreinformers.EndpointsInformer

func (*API) GetObjects added in v0.4.4

func (api *API) GetObjects(namespace, restype, name string) ([]runtime.Object, error)

GetObjects returns a list of Kubernetes objects, given a namespace, type, and name. If namespace is an empty string, match objects in all namespaces. If name is an empty string, match all objects of the given type.

func (*API) GetOwnerKindAndName added in v0.5.0

func (api *API) GetOwnerKindAndName(pod *apiv1.Pod) (string, string)

GetOwnerKindAndName returns the pod owner's kind and name, using owner references from the Kubernetes API. The kind is represented as the Kubernetes singular resource type (e.g. deployment, daemonset, job, etc.)

func (*API) GetPodsFor added in v0.4.4

func (api *API) GetPodsFor(obj runtime.Object, includeFailed bool) ([]*apiv1.Pod, error)

GetPodsFor returns all running and pending Pods associated with a given Kubernetes object. Use includeFailed to also get failed Pods

func (*API) NS added in v0.4.4

func (*API) Pod added in v0.4.4

func (api *API) Pod() coreinformers.PodInformer

func (*API) RC added in v0.4.4

func (*API) RS added in v0.4.4

func (*API) Svc added in v0.4.4

func (api *API) Svc() coreinformers.ServiceInformer

func (*API) Sync added in v0.4.4

func (api *API) Sync(readyCh chan<- struct{})

Sync waits for all informers to be synced. For servers, call this asynchronously. For testing, call this synchronously.

type ApiResource added in v0.4.4

type ApiResource int
const (
	CM ApiResource = iota
	Deploy
	Endpoint
	NS
	Pod
	RC
	RS
	Svc
)

Jump to

Keyboard shortcuts

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