Documentation ¶
Index ¶
- Variables
- func ClientSet(masterURL, kubeConfigPath string) (kubernetes.Interface, error)
- func NewDefaultLogger(infoLogger *log.Logger, debugLogger *log.Logger, errorLogger *log.Logger) *defaultLogger
- func SortNodesByPods(nodes []*Node)
- func SortNodesByPodsDesc(nodes []*Node)
- type Config
- type K8S
- func (k *K8S) NewPodWatcher(ctx context.Context, namespace, labelSelector string) (*PodWatcher, error)
- func (k *K8S) NodePods(ctx context.Context, nodeName string) (*v1.PodList, error)
- func (k *K8S) Nodes(ctx context.Context, selector string) (*NodeList, error)
- func (k *K8S) UpdateNode(ctx context.Context, node *Node) error
- type Kubernetes
- type Logger
- type Node
- func (n *Node) AvailableResource(resource v1.ResourceName) int64
- func (n *Node) IsReady() bool
- func (n *Node) IsSchedulable() bool
- func (n *Node) MarkAsSchedulable() error
- func (n *Node) MarkAsUnschedulable() error
- func (n *Node) ResourceCapacity(resource v1.ResourceName) int64
- func (n *Node) SchedulingMarkTimestamp() (time.Time, error)
- func (n *Node) UsingResources(resource v1.ResourceName) int64
- type NodeList
- type PodWatcher
- type Resource
- type Scaler
Constants ¶
This section is empty.
Variables ¶
View Source
var (
ErrNotEnoughResources = errors.New("not enough resources")
)
Functions ¶
func NewDefaultLogger ¶
func SortNodesByPods ¶
func SortNodesByPods(nodes []*Node)
func SortNodesByPodsDesc ¶
func SortNodesByPodsDesc(nodes []*Node)
Types ¶
type K8S ¶
type K8S struct {
// contains filtered or unexported fields
}
func NewK8S ¶
func NewK8S(i kubernetes.Interface) *K8S
func NewK8SFromKubeConfig ¶
func (*K8S) NewPodWatcher ¶
type Kubernetes ¶
type Node ¶
func (*Node) AvailableResource ¶
func (n *Node) AvailableResource(resource v1.ResourceName) int64
func (*Node) IsSchedulable ¶
func (*Node) MarkAsSchedulable ¶
func (*Node) MarkAsUnschedulable ¶
func (*Node) ResourceCapacity ¶
func (n *Node) ResourceCapacity(resource v1.ResourceName) int64
func (*Node) UsingResources ¶
func (n *Node) UsingResources(resource v1.ResourceName) int64
type NodeList ¶
type NodeList struct {
Nodes []*Node
}
func (*NodeList) AvailableNodes ¶
func (*NodeList) AvailableResource ¶
func (n *NodeList) AvailableResource(resource v1.ResourceName) int64
func (*NodeList) AvailableSlot ¶
func (*NodeList) SchedulableNodes ¶
func (*NodeList) UnschedulableNodes ¶
type PodWatcher ¶
func (*PodWatcher) Stop ¶
func (pw *PodWatcher) Stop()
func (*PodWatcher) Watch ¶
func (pw *PodWatcher) Watch()
type Resource ¶
type Resource struct { Name v1.ResourceName Value int64 }
Directories ¶
Path | Synopsis |
---|---|
cmd
|
|
Package mocks is a generated GoMock package.
|
Package mocks is a generated GoMock package. |
Click to show internal directories.
Click to hide internal directories.