kube

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jan 24, 2018 License: Apache-2.0 Imports: 7 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
	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)
}

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) 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) 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