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 PvcStorageLimit(pvc *corev1.PersistentVolumeClaim) (resource.Quantity, error)
- func SetupIndexer(mgr ctrl.Manager, skipAnnotationCheck bool) error
- type MetricsClient
- type VolumeStats
Constants ¶
const AutoResizeEnabledKey = "resize.topolvm.io/enabled"
AutoResizeEnabledKey is the key of flag that enables pvc-autoresizer.
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 InitialResizeGroupByAnnotation = "resize.topolvm.io/initial-resize-group-by"
InitialResizeGroupByAnnotation is the key of the initial-resize group by.
const PreviousCapacityBytesAnnotation = "resize.topolvm.io/pre_capacity_bytes"
PreviousCapacityBytesAnnotation is the key of previous volume capacity.
const ResizeIncreaseAnnotation = "resize.topolvm.io/increase"
ResizeIncreaseAnnotation is the key of amount increased.
const ResizeInodesThresholdAnnotation = "resize.topolvm.io/inodes-threshold"
ResizeInodesThresholdAnnotation is the key of resize threshold for inodes.
const ResizeThresholdAnnotation = "resize.topolvm.io/threshold"
ResizeThresholdAnnotation is the key of resize threshold.
const StorageLimitAnnotation = "resize.topolvm.io/storage_limit"
StorageLimitAnnotation is the key of storage limit value
Variables ¶
This section is empty.
Functions ¶
func NewFakeClientWrapper ¶ added in v0.1.6
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 PvcStorageLimit ¶ added in v0.7.0
func PvcStorageLimit(pvc *corev1.PersistentVolumeClaim) (resource.Quantity, error)
func SetupIndexer ¶ added in v0.1.2
func SetupIndexer(mgr ctrl.Manager, skipAnnotationCheck bool) error
SetupIndexer setup indices for PVC auto resizer
Types ¶
type MetricsClient ¶
type MetricsClient interface {
// GetMetrics returns volume stats metrics of PVCs
//
// The volume stats consist of available bytes, capacity bytes, available inodes and capacity
// inodes. This method returns volume stats for a PVC only if all four metrics of the PVC was
// retrieved from the metrics source.
GetMetrics(ctx context.Context) (map[types.NamespacedName]*VolumeStats, error)
}
MetricsClient is an interface for getting metrics
func NewPrometheusClient ¶
func NewPrometheusClient(url string) (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