How gardener/pvc-autoscaler works
Main Components
a. Core Components:
• Kubernetes API Server (external component)
• PVC Autoscaler Controller Manager
• Prometheus Metrics Source
• Webhook Server
• Certificate Manager (cert-manager)
b. Custom Resources:
• PersistentVolumeClaimAutoscaler CRD
• PersistentVolumeClaim (managed resource)
• PersistentVolume (managed resource)
Component Relationships
• Controller Manager watching PVCAutoscaler resources (reconciliation loop)
• Controller querying Prometheus for metrics
• Webhook validation flow for PVCAutoscaler resources
• Volume resize operations flow
Implementation Details to Highlight
• Metrics collection system (internal/metrics)
• Periodic checking mechanism (internal/periodic)
• Controller reconciliation loop (internal/controller)
• Webhook validation (api/autoscaling/v1alpha1)
Resource watching flow
API Server -> Controller Manager -> PVCAutoscaler -> PVC
Metrics collection flow
PV -> Prometheus -> Controller Manager
Scaling decision flow
Controller Manager -> PVC resize operation
Additional Elements
Include:
• Version information
• Key configuration parameters (threshold, increaseBy, maxCapacity)
• RBAC connections
Remember to include:
• Clear component boundaries
• Kubernetes cluster boundary
• Namespace separations
• Configuration flows
This design should reflect the controller's primary purpose of automating PVC scaling while showing its integration with Kubernetes native resources and external monitoring systems.