scaler

package
v2.1.0-beta.6 Latest Latest
Warning

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

Go to latest
Published: Oct 3, 2022 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const Delimiter = "_"

Delimiter is used to split name into kind,namespace,name,replicacount

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Kind      string // deployment or statefulset
	Namespace string
	Name      string
	Replicas  int
}

type DockerClassicScaler

type DockerClassicScaler struct {
	Client client.ContainerAPIClient
}

func NewDockerClassicScaler

func NewDockerClassicScaler(client client.ContainerAPIClient) *DockerClassicScaler

func (*DockerClassicScaler) GetContainerByName

func (scaler *DockerClassicScaler) GetContainerByName(name string, ctx context.Context) (*types.Container, error)

func (*DockerClassicScaler) IsUp

func (scaler *DockerClassicScaler) IsUp(name string) bool

func (*DockerClassicScaler) ScaleDown

func (scaler *DockerClassicScaler) ScaleDown(name string) error

func (*DockerClassicScaler) ScaleUp

func (scaler *DockerClassicScaler) ScaleUp(name string) error

type DockerSwarmScaler

type DockerSwarmScaler struct {
	Client client.ServiceAPIClient
}

func NewDockerSwarmScaler

func NewDockerSwarmScaler() *DockerSwarmScaler

func (*DockerSwarmScaler) GetServiceByName

func (scaler *DockerSwarmScaler) GetServiceByName(name string, ctx context.Context) (*swarm.Service, error)

func (*DockerSwarmScaler) IsUp

func (scaler *DockerSwarmScaler) IsUp(name string) bool

func (*DockerSwarmScaler) ScaleDown

func (scaler *DockerSwarmScaler) ScaleDown(name string) error

func (*DockerSwarmScaler) ScaleUp

func (scaler *DockerSwarmScaler) ScaleUp(name string) error

type KubernetesScaler

type KubernetesScaler struct {
	Client *kubernetes.Clientset
}

func NewKubernetesScaler

func NewKubernetesScaler(client *kubernetes.Clientset) *KubernetesScaler

func (*KubernetesScaler) IsUp

func (scaler *KubernetesScaler) IsUp(name string) bool

func (*KubernetesScaler) ScaleDown

func (scaler *KubernetesScaler) ScaleDown(name string) error

func (*KubernetesScaler) ScaleUp

func (scaler *KubernetesScaler) ScaleUp(name string) error

type Scaler

type Scaler interface {
	ScaleUp(name string) error
	ScaleDown(name string) error
	IsUp(name string) bool
}

type Workload

type Workload interface {
	GetScale(ctx context.Context, workloadName string, options metav1.GetOptions) (*autoscalingv1.Scale, error)
	UpdateScale(ctx context.Context, workloadName string, scale *autoscalingv1.Scale, opts metav1.UpdateOptions) (*autoscalingv1.Scale, error)
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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