kube

package
v0.3.11 Latest Latest
Warning

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

Go to latest
Published: Aug 20, 2018 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Interface

type Interface interface {
	SetAnnotationOnPod(pod *kapi.Pod, key, value string) error
	SetAnnotationOnNode(node *kapi.Node, key, value string) error
	SetAnnotationOnNamespace(ns *kapi.Namespace, key, value string) error
	GetAnnotationsOnPod(namespace, name string) (map[string]string, error)
	GetPod(namespace, name string) (*kapi.Pod, error)
	GetPods(namespace string) (*kapi.PodList, error)
	GetPodsByLabels(namespace string, selector labels.Selector) (*kapi.PodList, error)
	GetNodes() (*kapi.NodeList, error)
	GetNode(name string) (*kapi.Node, error)
	GetService(namespace, name string) (*kapi.Service, error)
	GetEndpoints(namespace string) (*kapi.EndpointsList, error)
	GetNamespace(name string) (*kapi.Namespace, error)
	GetNamespaces() (*kapi.NamespaceList, error)
	GetNetworkPolicies(namespace string) (*kapisnetworking.NetworkPolicyList, error)
}

Interface represents the exported methods for dealing with getting/setting kubernetes resources

type Kube

type Kube struct {
	KClient kubernetes.Interface
}

Kube is the structure object upon which the Interface is implemented

func (*Kube) GetAnnotationsOnPod

func (k *Kube) GetAnnotationsOnPod(namespace, name string) (map[string]string, error)

GetAnnotationsOnPod obtains the pod annotations from kubernetes apiserver, given the name and namespace

func (*Kube) GetEndpoints added in v0.3.0

func (k *Kube) GetEndpoints(namespace string) (*kapi.EndpointsList, error)

GetEndpoints returns all the Endpoint resources from kubernetes apiserver, given namespace

func (*Kube) GetNamespace added in v0.3.0

func (k *Kube) GetNamespace(name string) (*kapi.Namespace, error)

GetNamespace returns the Namespace resource from kubernetes apiserver, given its name

func (*Kube) GetNamespaces added in v0.3.0

func (k *Kube) GetNamespaces() (*kapi.NamespaceList, error)

GetNamespaces returns all Namespace resource from kubernetes apiserver

func (*Kube) GetNetworkPolicies added in v0.3.0

func (k *Kube) GetNetworkPolicies(namespace string) (*kapisnetworking.NetworkPolicyList, error)

GetNetworkPolicies returns all network policy objects from kubernetes

func (*Kube) GetNode

func (k *Kube) GetNode(name string) (*kapi.Node, error)

GetNode returns the Node resource from kubernetes apiserver, given its name

func (*Kube) GetNodes

func (k *Kube) GetNodes() (*kapi.NodeList, error)

GetNodes returns the list of all Node objects from kubernetes

func (*Kube) GetPod

func (k *Kube) GetPod(namespace, name string) (*kapi.Pod, error)

GetPod obtains the Pod resource from kubernetes apiserver, given the name and namespace

func (*Kube) GetPods

func (k *Kube) GetPods(namespace string) (*kapi.PodList, error)

GetPods obtains the Pod resource from kubernetes apiserver, given the name and namespace

func (*Kube) GetPodsByLabels

func (k *Kube) GetPodsByLabels(namespace string, selector labels.Selector) (*kapi.PodList, error)

GetPodsByLabels obtains the Pod resources from kubernetes apiserver, given the namespace and label

func (*Kube) GetService

func (k *Kube) GetService(namespace, name string) (*kapi.Service, error)

GetService returns the Service resource from kubernetes apiserver, given its name and namespace

func (*Kube) SetAnnotationOnNamespace added in v0.3.0

func (k *Kube) SetAnnotationOnNamespace(ns *kapi.Namespace, key,
	value string) error

SetAnnotationOnNamespace takes the Namespace object and key/value pair to set it as an annotation

func (*Kube) SetAnnotationOnNode

func (k *Kube) SetAnnotationOnNode(node *kapi.Node, key, value string) error

SetAnnotationOnNode takes the node object and key/value string pair to set it as an annotation

func (*Kube) SetAnnotationOnPod

func (k *Kube) SetAnnotationOnPod(pod *kapi.Pod, key, value string) error

SetAnnotationOnPod takes the pod object and key/value string pair to set it as an annotation

Jump to

Keyboard shortcuts

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