runners

package
v0.3.1 Latest Latest
Warning

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

Go to latest
Published: Feb 9, 2023 License: Apache-2.0 Imports: 22 Imported by: 2

Documentation

Index

Constants

View Source
const AutoResizeEnabledKey = "resize.kubesphere.io/enabled"

AutoResizeEnabledKey is the key of flag that enables pvc-autoresizer.

View Source
const AutoRestartEnabledKey = "restart.kubesphere.io/enabled"

AutoRestartEnabledKey is the key of flag that enables pods-autoRestart.

View Source
const DefaultIncrease = "10%"

DefaultIncrease is the default value of ResizeIncreaseAnnotation.

View Source
const DefaultInodesThreshold = "10%"

DefaultInodesThreshold is the default value of ResizeInodesThresholdAnnotation.

View Source
const DefaultThreshold = "10%"

DefaultThreshold is the default value of ResizeThresholdAnnotation.

View Source
const ExpectReplicaNums = "restart.kubesphere.io/replica-nums"

ExpectReplicaNums is used to record the value of replicas before restart

View Source
const PreviousCapacityBytesAnnotation = "resize.kubesphere.io/pre-capacity-bytes"

PreviousCapacityBytesAnnotation is the key of previous volume capacity.

View Source
const ResizeIncreaseAnnotation = "resize.kubesphere.io/increase"

ResizeIncreaseAnnotation is the key of amount increased.

View Source
const ResizeInodesThresholdAnnotation = "resize.kubesphere.io/inodes-threshold"

ResizeInodesThresholdAnnotation is the key of resize threshold for inodes.

View Source
const ResizeThresholdAnnotation = "resize.kubesphere.io/threshold"

ResizeThresholdAnnotation is the key of resize threshold.

View Source
const ResizingMaxTime = "restart.kubesphere.io/max-time"

ResizingMaxTime is the key of flag that the maximum number of seconds that autoRestart can wait for pvc resize

View Source
const RestartSkip = "restart.kubesphere.io/skip"

RestartSkip is the key of flag that the workload don't need autoRestart

View Source
const RestartStage = "restart.kubesphere.io/stage"

RestartStage is used to record whether autoRestart has finished shutting down the pod

View Source
const RestartStopTime = "restart.kubesphere.io/stop-time"

RestartStopTime is used to record the time when the pod is closed

View Source
const StorageLimitAnnotation = "resize.kubesphere.io/storage-limit"

StorageLimitAnnotation is the key of storage limit value

View Source
const SupportOnlineResize = "restart.kubesphere.io/online-expansion-support"

SupportOnlineResize is the key of flag that the storage class support online expansion

Variables

This section is empty.

Functions

func NewFakeClientWrapper

func NewFakeClientWrapper(c client.Client) client.Client

func NewPVCAutoresizer

func NewPVCAutoresizer(mc MetricsClient, c client.Client, log logr.Logger, interval time.Duration, recorder record.EventRecorder) manager.Runnable

NewPVCAutoresizer returns a new pvcAutoresizer struct

func NewRestarter

func NewRestarter(c client.Client, log logr.Logger, interval time.Duration, recorder record.EventRecorder) manager.Runnable

func SetupIndexer

func SetupIndexer(mgr ctrl.Manager, skipAnnotationCheck bool) error

SetupIndexer setup indices for PVC auto resizer

Types

type MetricsClient

type MetricsClient interface {
	GetMetrics(ctx context.Context) (map[types.NamespacedName]*VolumeStats, error)
}

MetricsClient is an interface for getting metrics

func NewPrometheusClient

func NewPrometheusClient(url string, HTTPClientConfig *config.HTTPClientConfig) (MetricsClient, error)

NewPrometheusClient returns a new prometheusClient

type VolumeStats

type VolumeStats struct {
	AvailableBytes     int64
	CapacityBytes      int64
	AvailableInodeSize int64
	CapacityInodeSize  int64
}

VolumeStats is a struct containing metrics used by pvc-autoresizer

Jump to

Keyboard shortcuts

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