Quota Monitoring (Quota)
Monitors the real-time disk usage and quota limits for all quota-enabled directories under the NFS export path (--nfs-base-path).
- Usage Assessment (Status Badges): Classifies the current capacity usage percentage into three states:
- OK (Green): Usage is under 90% of the limit.
- Warning (Yellow): Usage is 90% or above, but under 100%.
- Exceeded (Red): Usage has exceeded the 100% quota limit.
- Metrics Monitoring: Exports Prometheus-compatible status metrics (such as
nfs_disk_used_bytes,nfs_quota_used_percent).
Orphan Directory Cleanup (Orphans)
Identifies and manages 'orphaned' directories that persist on the filesystem after their corresponding PersistentVolumes have been removed from the Kubernetes cluster. (This feature is enabled via the --enable-auto-cleanup flag).
- Grace Period: To prevent accidental data loss, detected orphans are not deleted immediately but are kept for a default grace period of 24 hours.
- Dry-Run and Live Mode: In Dry-Run mode (
--cleanup-dry-run=true), the agent merely detects orphans without deleting them. When Live mode (false) is set, actual deletion occurs. This can be executed directly from the UI or via thecleanupCLI subcommand.
Usage Trends (Trends)
Periodically takes snapshots of quota usage to record storage consumption patterns and growth trends. (Requires --enable-history)
- Tracks usage changes over recent 24-hour (24H), 7-day (7D), and 30-day (30D) periods.
- Trends are visualized with arrows (↑, →, ↓), aiding administrators in predicting when capacity will run out and effectively planning for storage expansion.
Namespace Policies (Policies)
Enforces quota limits according to prioritized rules based on cluster Namespace and PVC configurations. (Requires --enable-policy) The following flowchart illustrates the precedence order and how the final quota policy is determined.
- Resolution Priority:
LimitRange > Namespace Annotation > Global Default- The agent first scans Kubernetes
LimitRangeobjects (wheretype: PersistentVolumeClaim) to determine max, min, and default capacities. - Next, it evaluates Namespace annotations (
nfs.io/default-quota,nfs.io/max-quota). - If no specific limits are found, the global agent flag
--default-quotaserves as the fallback.
- The agent first scans Kubernetes
- If a PVC violates these rules (e.g., requests exceed the
max), it is reported as a policy violation.
Audit Logs (Audit Logs)
Preserves a complete history of all quota-modifying actions made by the system. (Requires --enable-audit)
- Operations executed by the agent, such as
CREATE,UPDATE,DELETE, andCLEANUP, are logged. - The logs capture both successful and failed transactions, providing value for post-incident troubleshooting and compliance documentation. By default, logs are written to
/var/log/nfs-quota-agent/audit.log.