kubernetes

package
v0.0.0-...-dc06112 Latest Latest
Warning

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

Go to latest
Published: May 13, 2019 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const Component = "nuwa"

Component is the name of this application.

Variables

This section is empty.

Functions

func BuildConfigFromFlags

func BuildConfigFromFlags(apiserver, kubecfg string) (*rest.Config, error)

BuildConfigFromFlags is clientcmd.BuildConfigFromFlags with no annoying dependencies on glog. https://godoc.org/k8s.io/client-go/tools/clientcmd#BuildConfigFromFlags

func LocalStoragePodFilter

func LocalStoragePodFilter(p core.Pod) (bool, error)

LocalStoragePodFilter returns true if the supplied pod does not have local storage, i.e. does not use any 'empty dir' volumes.

func MirrorPodFilter

func MirrorPodFilter(p core.Pod) (bool, error)

MirrorPodFilter returns true if the supplied pod is not a mirror pod, i.e. a pod created by a manifest on the node rather than the API server.

func NewEventRecorder

func NewEventRecorder(c kubernetes.Interface) record.EventRecorder

NewEventRecorder returns a new record.EventRecorder for the given client.

func UnreplicatedPodFilter

func UnreplicatedPodFilter(p core.Pod) (bool, error)

UnreplicatedPodFilter returns true if the pod is replicated, i.e. is managed by a controller (deployment, daemonset, statefulset, etc) of some sort.

Types

type NodeStore

type NodeStore interface {
	// Get an node by name. Returns an error if the node does not exist.
	Get(name string) (*core.Node, error)
}

An NodeStore is a cache of node resources.

type NodeWatch

type NodeWatch struct {
	cache.SharedInformer
}

An NodeWatch is a cache of node resources that notifies registered handlers when its contents change.

func NewNodeWatch

NewNodeWatch creates a watch on node resources. Nodes are cached and the provided ResourceEventHandlers are called when the cache changes.

func (*NodeWatch) Get

func (w *NodeWatch) Get(name string) (*core.Node, error)

Get an node by name. Returns an error if the node does not exist.

type PodFilterFunc

type PodFilterFunc func(p core.Pod) (bool, error)

A PodFilterFunc returns true if the supplied pod passes the filter.

func NewDaemonSetPodFilter

func NewDaemonSetPodFilter(client kubernetes.Interface) PodFilterFunc

NewDaemonSetPodFilter returns a FilterFunc that returns true if the supplied pod is not managed by an extant DaemonSet.

func NewPodFilters

func NewPodFilters(filters ...PodFilterFunc) PodFilterFunc

NewPodFilters returns a FilterFunc that returns true if all of the supplied FilterFuncs return true.

func UnprotectedPodFilter

func UnprotectedPodFilter(annotations ...string) PodFilterFunc

UnprotectedPodFilter returns a FilterFunc that returns true if the supplied pod does not have any of the user-specified annotations for protection from eviction

Jump to

Keyboard shortcuts

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