k8sclient

package
v0.0.0-...-82731a3 Latest Latest
Warning

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

Go to latest
Published: May 23, 2017 License: Apache-2.0 Imports: 24 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var NodesCond *sync.Cond

Used to guard access to the node and resource related maps.

View Source
var PodsCond *sync.Cond

Used to guard access to the pod, task and job related maps.

View Source
var ResIDToNode map[string]string
View Source
var TaskIDToPod map[uint64]PodIdentifier

Functions

func BindPodToNode

func BindPodToNode(podName string, namespace string, nodeName string)

func DeletePod

func DeletePod(podName string, namespace string)

func GenerateUUID

func GenerateUUID(seed string) string

func GetClientConfig

func GetClientConfig(kubeconfig string) (*rest.Config, error)

func HashCombine

func HashCombine(valueOne, valueTwo interface{}) uint64

func New

func New(schedulerName string, kubeConfig string, kubeVersionMajor, kubeVersionMinor int, firmamentAddress string)

Types

type Node

type Node struct {
	Hostname         string
	Phase            NodePhase
	IsReady          bool
	IsOutOfDisk      bool
	CpuCapacity      int64
	CpuAllocatable   int64
	MemCapacityKb    int64
	MemAllocatableKb int64
	Labels           map[string]string
	Annotations      map[string]string
}

type NodePhase

type NodePhase string
const (
	NodeAdded   NodePhase = "Added"
	NodeDeleted NodePhase = "Deleted"
	NodeFailed  NodePhase = "Failed"
	NodeUpdated NodePhase = "Updated"
)

type NodeWatcher

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

func (*NodeWatcher) Run

func (this *NodeWatcher) Run(stopCh <-chan struct{}, nWorkers int)

type Pod

type Pod struct {
	Identifier   PodIdentifier
	State        PodPhase
	CpuRequest   int64
	MemRequestKb int64
	Labels       map[string]string
	Annotations  map[string]string
	NodeSelector map[string]string
}

type PodIdentifier

type PodIdentifier struct {
	Name      string
	Namespace string
}

func (*PodIdentifier) UniqueName

func (this *PodIdentifier) UniqueName() string

type PodPhase

type PodPhase string
const (
	PodPending   PodPhase = "Pending"
	PodRunning   PodPhase = "Running"
	PodSucceeded PodPhase = "Succeeded"
	PodFailed    PodPhase = "Failed"
	PodUnknown   PodPhase = "Unknown"
	// Internal phase used for removed pods.
	PodDeleted PodPhase = "Deleted"
	// Internal phase for pods that are externally updated.
	PodUpdated PodPhase = "Updated"
)

type PodWatcher

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

func NewPodWatcher

func NewPodWatcher(kubeVerMajor, kubeVerMinor int, schedulerName string, client kubernetes.Interface, fc firmament.FirmamentSchedulerClient) *PodWatcher

func (*PodWatcher) Run

func (this *PodWatcher) Run(stopCh <-chan struct{}, nWorkers int)

type Queue

type Queue interface {
	Add(key interface{}, item interface{})
	Get() (key interface{}, items []interface{}, shutdown bool)
	Done(key interface{})
	ShutDown()
	ShuttingDown() bool
}

type Type

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

func NewKeyedQueue

func NewKeyedQueue() *Type

func (*Type) Add

func (q *Type) Add(key interface{}, item interface{})

func (*Type) Done

func (q *Type) Done(key interface{})

func (*Type) Get

func (q *Type) Get() (key interface{}, items []interface{}, shutdown bool)

func (*Type) ShutDown

func (q *Type) ShutDown()

After ShutDown is called new items will not be appended to the queue. Only already appended items will be drained.

func (*Type) ShuttingDown

func (q *Type) ShuttingDown() bool

Jump to

Keyboard shortcuts

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