k8scache

package
v0.0.0-...-aa771b6 Latest Latest
Warning

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

Go to latest
Published: Jan 12, 2020 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateHandler

func CreateHandler(h CacheHandler) cache.ResourceEventHandler

CreateHandler creates a cache.ResourceEventHandler from CacheHandler

Types

type CacheHandler

type CacheHandler interface {
	Add(obj interface{})
	Update(old, new interface{})
	Delete(obj interface{})
}

CacheHandler is the interface for cache updates from external source.

type NodeLister

type NodeLister interface {
	// ListNode list all nodes in Kubernetes cluster
	ListNode() ([]*v1.Node, error)
}

NodeLister list nodes

type SchedCache

type SchedCache struct {
	// contains filtered or unexported fields
}

SchedCache is the cache for scheduler

func New

func New(client kubernetes.Interface) *SchedCache

New creates a SchedCache instance

func (SchedCache) GetHost

func (c SchedCache) GetHost(node string) string

GetHost returns the hostname of a given node

func (SchedCache) GetNodes

func (c SchedCache) GetNodes(host string) []string

GetNodes returns all the nodes running on a given host

func (SchedCache) GetPodsOnNode

func (c SchedCache) GetPodsOnNode(nodename string) []string

func (*SchedCache) ListNode

func (c *SchedCache) ListNode() ([]*v1.Node, error)

ListNode lists all nodes cached in SchedCached

func (*SchedCache) ListPod

func (c *SchedCache) ListPod(selector selector.Selector) ([]*v1.Pod, error)

ListPod list pods that matched the selector cached in SchedCache

func (*SchedCache) NodeInformer

func (c *SchedCache) NodeInformer() cache.SharedIndexInformer

NodeInformer returns the SharedIndexInformer for nodes

func (*SchedCache) PodInformer

func (c *SchedCache) PodInformer() cache.SharedIndexInformer

PodInformer returns the SharedIndexInformer for pods

func (*SchedCache) Run

func (c *SchedCache) Run(stopCh <-chan struct{})

Run starts the shared informer in cache, which will be stopped when stopCh is closed.

Jump to

Keyboard shortcuts

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