How libopenstorage/stork works
Stork is a Kubernetes storage-aware scheduler extender and operator. The primary workflow is a scheduler sending pod filter/prioritize requests to Stork, which consults a storage driver and returns placement guidance. The operator also manages snapshots and application-consistent rules, backups/restores, health-driven relocation, disaster-recovery actions, and admission-time scheduler assignment. The graph includes these documented product branches; several controller-to-driver relationships are inferred from subsystem roles and are marked unverified because the relevant implementations were not excerpted.
Main entry points: volume.go Volume Driver · stork.go Stork Runtime · extender.go Scheduler Extender · webhook.go Admission Initializer
Components 20
Scheduling Runtime
- Scheduler Extender
pkg/extender/extender.go - Volume Driver
drivers/volume/volume.go - Portworx Driver
drivers/volume/portworx/portworx.go - CSI Driver
drivers/volume/csi/csi.go - Admission Initializer
pkg/webhookadmission/webhook.go - Stork Runtime
cmd/stork/stork.go
Kubernetes Controllers
- Application Manager
pkg/applicationmanager/applicationmanager.go
Data Protection
- Backup Controller
pkg/applicationmanager/controllers/applicationbackup.go - Snapshot Scheduling
pkg/snapshot/controllers/snapshotschedule.go - CSI Snapshotter
pkg/snapshotter/snapshotter_csi.go - Group Snapshots
pkg/groupsnapshot/controllers/groupsnapshot.go - Application Rules
pkg/rule/rule.go - Backup Object Store
pkg/objectstore/objectstore.go
Recovery and Health
- Driver Health Monitor
pkg/monitor/monitor.go - Replica Scaling
pkg/resourceutils/updatereplicas.go - DR Action Controller
pkg/action/actioncontroller.go
API and Operations
- Stork API Resources
pkg/apis/stork/v1alpha1 - Stork CLI
pkg/storkctl/clusterpair.go
Other components
- Kubernetes Scheduler
- Kubernetes API
Connections 24
- Kubernetes Scheduler → Scheduler Extender: requests placement
- Scheduler Extender → Volume Driver: checks placement
- Scheduler Extender → Kubernetes Scheduler: returns priorities
- Stork Runtime → Scheduler Extender: starts extender
cmd/stork/stork.go - Stork Runtime → Admission Initializer: starts webhook
cmd/stork/stork.go - Admission Initializer → Kubernetes API: patches pod admission
pkg/webhookadmission/webhook.go - Admission Initializer → Volume Driver: checks driver volumes
- Stork Runtime → Application Manager: initializes controllers
cmd/stork/stork.go - Application Manager → Backup Controller: initializes backup
pkg/applicationmanager/applicationmanager.go - Backup Controller → Backup Object Store: stores backup data
- Backup Controller → Application Rules: runs consistency rules
- Snapshot Scheduling → Application Rules: runs snapshot rules
- Snapshot Scheduling → CSI Snapshotter: requests snapshots
- Group Snapshots → Application Rules: runs snapshot rules
- CSI Snapshotter → CSI Driver: uses CSI operations
- Portworx Driver → Volume Driver: implements driver
- CSI Driver → Volume Driver: implements driver
- Stork Runtime → Driver Health Monitor: starts monitoring
- Driver Health Monitor → Volume Driver: checks driver health
- Driver Health Monitor → Replica Scaling: relocates workloads
- DR Action Controller → Volume Driver: performs DR actions
- DR Action Controller → Stork API Resources: reconciles actions
pkg/action/actioncontroller.go - Stork CLI → Stork API Resources: manages cluster pairs
pkg/storkctl/clusterpair.go - Kubernetes API → Stork API Resources: stores custom resources