k8s

package
v18.9.1+incompatible Latest Latest
Warning

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

Go to latest
Published: Sep 12, 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

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

API provides shared informers for all Kubernetes objects

func NewAPI

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

NewAPI takes a Kubernetes client and returns an initialized API

func NewFakeAPI

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

func (*API) CM

func (*API) Deploy

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

func (*API) Endpoint

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

func (*API) GetObjects

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

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

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

func (*API) Pod

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

func (*API) RC

func (*API) RS

func (*API) Svc

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

func (*API) Sync

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

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