doc.go 1.2 KB

1234567891011121314151617181920212223242526272829
  1. package csi
  2. // The `csi` package contains code for managing Swarmkit Cluster Volumes,
  3. // which are powered by CSI drivers.
  4. //
  5. // This package stands separately from other manager components because of the
  6. // unique nature of volumes. Volumes need to be allocated before they can be
  7. // used, but the availability of a volume also imposes a scheduling constraint
  8. // on the node. Further, the CSI lifecycle requires many different RPC calls at
  9. // many points in the volume's life, which brings it out of the purview of any
  10. // one component.
  11. //
  12. // In an ideal world, this package would live wholely within the allocator
  13. // package, but the allocator is very fragile, and modifying it is more trouble
  14. // than it's worth.
  15. // Volume Lifecycle in Swarm
  16. //
  17. // Creation
  18. //
  19. // When a volume is created, the first thing the allocator does is contact the
  20. // relevant CSI plugin in order to ensure that the volume is created, and to
  21. // retrieve the associated volume ID. Volumes are always created when the
  22. // swarmkit object is created, as opposed to being created when demanded by a
  23. // Service.
  24. //
  25. // Assignment
  26. //
  27. // After a volume has been created, it may be used by one or more Tasks.