Documentation ¶
Index ¶
- Constants
- func NewFakeClientWrapper(c client.Client) client.Client
- func NewPVCAutoresizer(mc MetricsClient, c client.Client, log logr.Logger, interval time.Duration, ...) manager.Runnable
- func NewRestarter(c client.Client, log logr.Logger, interval time.Duration, ...) manager.Runnable
- func SetupIndexer(mgr ctrl.Manager, skipAnnotationCheck bool) error
- type MetricsClient
- type VolumeStats
Constants ¶
const AutoResizeEnabledKey = "resize.kubesphere.io/enabled"
AutoResizeEnabledKey is the key of flag that enables pvc-autoresizer.
const AutoRestartEnabledKey = "restart.kubesphere.io/enabled"
AutoRestartEnabledKey is the key of flag that enables pods-autoRestart.
const DefaultIncrease = "10%"
DefaultIncrease is the default value of ResizeIncreaseAnnotation.
const DefaultInodesThreshold = "10%"
DefaultInodesThreshold is the default value of ResizeInodesThresholdAnnotation.
const DefaultThreshold = "10%"
DefaultThreshold is the default value of ResizeThresholdAnnotation.
const ExpectReplicaNums = "restart.kubesphere.io/replica-nums"
ExpectReplicaNums is used to record the value of replicas before restart
const PreviousCapacityBytesAnnotation = "resize.kubesphere.io/pre-capacity-bytes"
PreviousCapacityBytesAnnotation is the key of previous volume capacity.
const ResizeIncreaseAnnotation = "resize.kubesphere.io/increase"
ResizeIncreaseAnnotation is the key of amount increased.
const ResizeInodesThresholdAnnotation = "resize.kubesphere.io/inodes-threshold"
ResizeInodesThresholdAnnotation is the key of resize threshold for inodes.
const ResizeThresholdAnnotation = "resize.kubesphere.io/threshold"
ResizeThresholdAnnotation is the key of resize threshold.
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
const RestartSkip = "restart.kubesphere.io/skip"
RestartSkip is the key of flag that the workload don't need autoRestart
const RestartStage = "restart.kubesphere.io/stage"
RestartStage is used to record whether autoRestart has finished shutting down the pod
const RestartStopTime = "restart.kubesphere.io/stop-time"
RestartStopTime is used to record the time when the pod is closed
const StorageLimitAnnotation = "resize.kubesphere.io/storage-limit"
StorageLimitAnnotation is the key of storage limit value
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 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 ¶
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