nodescaler

package
v0.0.0-...-6dd300b Latest Latest
Warning

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

Go to latest
Published: May 22, 2018 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

View Source
const Version string = "nodescaler:0.2"

Version is the current api version number

Variables

This section is empty.

Functions

This section is empty.

Types

type NodePool

type NodePool interface {
	// Increase the node pool to a given size.
	// Should ignore requests to make the nodepool smaller
	IncreaseToSize(int64) error

	// Delete specific nodes in the cluster
	DeleteNodes(nodes []v1.Node) error
}

NodePool is an interface to being able to manipulate a pool for nodes for Kubernetes.

type Option

type Option func(*Server)

Option is an functional option for the server

func ServerBufferCount

func ServerBufferCount(bc int64) Option

ServerBufferCount sets the number of cpuRequest to make sure is available at all times. Defaults to 5

func ServerMaxNodeNumber

func ServerMaxNodeNumber(max int64) Option

ServerMaxNodeNumber sets the maximum node number that can be in the cluster

func ServerMinNodeNumber

func ServerMinNodeNumber(min int64) Option

ServerMinNodeNumber sets the minimum node number that can be in the cluster

func ServerShutdown

func ServerShutdown(sd time.Duration) Option

ServerShutdown is the time from when a node is cordoned to when it can be shut down (when empty). Defaults to 1min

func ServerTick

func ServerTick(td time.Duration) Option

ServerTick is the time required for each tick between checks. Defaults to 10s

type Server

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

Server is the http server instance

func NewServer

func NewServer(hostAddr, nodeSelector, cpuRequest string, opts ...Option) (*Server, error)

NewServer returns the HTTP Server instance `nodeSelector` is a k8s selector for what nodes to manage `cpuRequest` is the cpu capacity requested for each server

func (*Server) Start

func (s *Server) Start() error

Start starts the HTTP server on the given port

Directories

Path Synopsis
cmd
server
Server binary for session management
Server binary for session management

Jump to

Keyboard shortcuts

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