Documentation ¶
Index ¶
- Constants
- func BuildConfigFromFlags(apiserver, kubecfg string) (*rest.Config, error)
- func LocalStoragePodFilter(p core.Pod) (bool, error)
- func MirrorPodFilter(p core.Pod) (bool, error)
- func NewEventRecorder(c kubernetes.Interface) record.EventRecorder
- func UnreplicatedPodFilter(p core.Pod) (bool, error)
- type NodeStore
- type NodeWatch
- type PodFilterFunc
Constants ¶
const Component = "nuwa"
Component is the name of this application.
Variables ¶
This section is empty.
Functions ¶
func BuildConfigFromFlags ¶
BuildConfigFromFlags is clientcmd.BuildConfigFromFlags with no annoying dependencies on glog. https://godoc.org/k8s.io/client-go/tools/clientcmd#BuildConfigFromFlags
func LocalStoragePodFilter ¶
LocalStoragePodFilter returns true if the supplied pod does not have local storage, i.e. does not use any 'empty dir' volumes.
func MirrorPodFilter ¶
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.
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 {
}An NodeWatch is a cache of node resources that notifies registered handlers when its contents change.
func NewNodeWatch ¶
func NewNodeWatch(c kubernetes.Interface, rs ...cache.ResourceEventHandler) *NodeWatch
NewNodeWatch creates a watch on node resources. Nodes are cached and the provided ResourceEventHandlers are called when the cache changes.
type PodFilterFunc ¶
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