Documentation ¶
Index ¶
Constants ¶
View Source
const ( // ReportURLEnvName ... ReportURLEnvName = "REPORT_URL" // HeartbeatIntervalEnvName ... HeartbeatIntervalEnvName = "HEARTBEAT_INTERVAL" // NamespaceEnvName ... NamespaceEnvName = "NAMESPACE" // PVCWatcherLabelName ... PVCWatcherLabelName = "pod.cyclone.dev/name" // PVCWatcherLabelValue ... PVCWatcherLabelValue = "pvc-watcher" )
View Source
const PVCWatcherName = "pvc-watchdog"
PVCWatcherName is name of the PVC watcher deployment and pod
Variables ¶
This section is empty.
Functions ¶
func DeletePVCUsageWatcher ¶ added in v0.9.6
func DeletePVCUsageWatcher(client *kubernetes.Clientset, namespace string) error
DeletePVCUsageWatcher delete the pvc usage watcher deployment
func LaunchPVCUsageWatcher ¶
func LaunchPVCUsageWatcher(client *kubernetes.Clientset, context v1alpha1.ExecutionContext) error
LaunchPVCUsageWatcher launches a pod in a given namespace to report PVC usage regularly.
Types ¶
type PVCReporter ¶
type PVCReporter interface { OverallUsedPercentage() float64 UsedPercentage(folder string) (float64, error) }
PVCReporter reports PVC usage information.
func NewPVCReporter ¶
func NewPVCReporter(client clientset.Interface, tenant string) (PVCReporter, error)
NewPVCReporter creates a PVC usage reporter.
type PVCUsage ¶
type PVCUsage struct { // Total is total space Total string `json:"total"` // Used is space used Used string `json:"used"` // Items are space used by each folder, for example, 'caches' -> '1.2G' Items map[string]string `json:"items"` }
PVCUsage represents PVC usages in a tenant, values are in human readable format, for example, '8K', '1.2G'.
func (*PVCUsage) ToFloat64 ¶
func (u *PVCUsage) ToFloat64() (*PVCUsageFloat64, error)
ToFloat64 converts usage values from string to float64.
Click to show internal directories.
Click to hide internal directories.