kubescaler

package
v2.2.0-beta.2+incompat... Latest Latest
Warning

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

Go to latest
Published: Jul 26, 2019 License: Apache-2.0 Imports: 25 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultConfigFilepath = "/etc/kubescaler.conf"
)
View Source
const (
	EnvPrefix = "CAPACITY"
)

Variables

View Source
var (
	ErrNoAllowedMachines = errors.New("no allowed machines were provided")
	ErrNotConfigured     = errors.New("worker manager is not configured properly")

	DefaultScanInterval            = time.Second * 20
	DefaultMaxMachineProvisionTime = time.Minute * 10
)
View Source
var ErrNoResourcesRequested = errors.New("empty cpu and RAM value")

Functions

func BoolPtr

func BoolPtr(in bool) *bool

func Merge

func Merge(c, patch api.Config) api.Config

Types

type ConfigManager

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

func NewConfigManager

func NewConfigManager(file persistentfile.Interface) (*ConfigManager, error)

func (*ConfigManager) GetConfig

func (m *ConfigManager) GetConfig() api.Config

func (*ConfigManager) PatchConfig

func (m *ConfigManager) PatchConfig(in api.Config) error

func (*ConfigManager) SetConfig

func (m *ConfigManager) SetConfig(conf api.Config) error

methods for manipulating config

type Kubescaler

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

func New

func New(opts Options) (*Kubescaler, error)

func (*Kubescaler) CreateWorker

func (s *Kubescaler) CreateWorker(ctx context.Context, mtype string) (*api.Worker, error)

func (*Kubescaler) DeleteWorker

func (s *Kubescaler) DeleteWorker(ctx context.Context, nodeName, id string) (*api.Worker, error)

func (*Kubescaler) GetConfig

func (s *Kubescaler) GetConfig() api.Config

func (*Kubescaler) GetWorker

func (s *Kubescaler) GetWorker(ctx context.Context, id string) (*api.Worker, error)

func (*Kubescaler) IsReady

func (s *Kubescaler) IsReady() bool

func (*Kubescaler) ListWorkers

func (s *Kubescaler) ListWorkers(ctx context.Context) (*api.WorkerList, error)

func (*Kubescaler) MachineTypes

func (s *Kubescaler) MachineTypes() []*provider.MachineType

func (*Kubescaler) PatchConfig

func (s *Kubescaler) PatchConfig(conf api.Config) error

func (*Kubescaler) ReserveWorker

func (s *Kubescaler) ReserveWorker(ctx context.Context, worker *api.Worker) (*api.Worker, error)

func (*Kubescaler) Run

func (s *Kubescaler) Run() error

func (*Kubescaler) RunOnce

func (s *Kubescaler) RunOnce(currentTime time.Time) error

func (*Kubescaler) SetConfig

func (s *Kubescaler) SetConfig(conf api.Config) error

func (*Kubescaler) Stop

func (s *Kubescaler) Stop(ctx context.Context) error

type ListerRegistry

type ListerRegistry interface {
	ReadyNodeLister() listers.NodeLister
	ScheduledPodLister() listers.PodLister
	UnschedulablePodLister() listers.PodLister
}

type Options

type Options struct {
	ConfigFile         string
	ConfigMapName      string
	ConfigMapNamespace string
	Kubeconfig         string
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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