scheduler

package
v0.0.0-...-34ff000 Latest Latest
Warning

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

Go to latest
Published: Apr 27, 2020 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// cluster scheduler labels
	ENABLED_LABEL = "cs-enabled"
	UPTIME_LABEL  = "cs-uptime"
	STATUS_LABEL  = "cs-status"
	// cluster scheduler status values
	STATUS_DOWN = "down"
	STATUS_UP   = "up"
)

Variables

This section is empty.

Functions

func GetBackupLabel

func GetBackupLabel(name string) string

Types

type Cluster

type Cluster struct {
	Name     string
	Location string //region or zone
	Project  string
	Status   string
	Uptime   UptimeRange
	Nodes    []NodeGroup
	// GKE specific
	Labels      map[string]string
	Fingerprint string
}

type NodeGroup

type NodeGroup struct {
	Name         string
	NodeCount    int32
	MinNodeCount int32
	MaxNodeCount int32
	Autoscaling  bool
}

func Restore

func Restore(name, backup string) (*NodeGroup, error)

type NodesBackup

type NodesBackup struct {
	Name  string
	Value string
}

func Backup

func Backup(ng NodeGroup) NodesBackup

type Range

type Range struct {
	From int
	To   int
}

type Runner

type Runner interface {
	List(context.Context) ([]Cluster, error)
	Stop(context.Context, Cluster) error
	Restart(context.Context, Cluster) error
	DecideOnStatus(Cluster) error
}

type UptimeRange

type UptimeRange struct {
	Hours    Range
	Days     Range
	Months   Range
	Weekdays Range
}

func ParseUptime

func ParseUptime(spec string) (*UptimeRange, error)

func (*UptimeRange) IsInRange

func (uptime *UptimeRange) IsInRange(t time.Time) bool

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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