workload

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Apr 15, 2024 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Deployment

type Deployment struct {
	client.Client
	Namespace string
	Selector  labels.Selector
}

Deployment represents behaviors of a Kubernetes Deployment.

func (*Deployment) CanSelectPodsToScaleDown

func (*Deployment) CanSelectPodsToScaleDown(context.Context) bool

func (*Deployment) SelectPodsToScaleDown

func (*Deployment) SelectPodsToScaleDown(context.Context, []*corev1.Pod) error

func (*Deployment) Sort

func (w *Deployment) Sort(ctx context.Context, pods []*corev1.Pod) ([]*corev1.Pod, error)

type Interface

type Interface interface {
	// Interface provide the default pod scale down sort method of this workload.
	podsorter.Interface
	// CanSelectPodsToScaleDown means if this workload support scaling down specific pods.
	CanSelectPodsToScaleDown(context.Context) bool
	// SelectPodsToScaleDown select specific pods that would be scaled down when declining the replica of this workload.
	SelectPodsToScaleDown(context.Context, []*corev1.Pod) error
}

Interface represent various behaviors of a specific Kubernetes workload.

type ReplicaSet

type ReplicaSet struct {
	client.Client
	Namespace string
	Selector  labels.Selector
}

ReplicaSet represents behaviors of a Kubernetes ReplicaSet.

func (*ReplicaSet) CanSelectPodsToScaleDown

func (*ReplicaSet) CanSelectPodsToScaleDown(context.Context) bool

func (*ReplicaSet) SelectPodsToScaleDown

func (*ReplicaSet) SelectPodsToScaleDown(context.Context, []*corev1.Pod) error

func (*ReplicaSet) Sort

func (w *ReplicaSet) Sort(ctx context.Context, pods []*corev1.Pod) ([]*corev1.Pod, error)

type StatefulSet

type StatefulSet struct{}

StatefulSet represents behaviors of a Kubernetes StatefulSet.

func (*StatefulSet) CanSelectPodsToScaleDown

func (*StatefulSet) CanSelectPodsToScaleDown(context.Context) bool

func (*StatefulSet) SelectPodsToScaleDown

func (*StatefulSet) SelectPodsToScaleDown(context.Context, []*corev1.Pod) error

func (*StatefulSet) Sort

func (*StatefulSet) Sort(_ context.Context, pods []*corev1.Pod) ([]*corev1.Pod, error)

Jump to

Keyboard shortcuts

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