Upgrade to Pro — share decks privately, control downloads, hide ads and more …

What Is The Container Storage Interface (CSI)

What Is The Container Storage Interface (CSI)

Container Storage Interface (CSI) is an open source project that aims to define an industry standard volume plugin interface for containerized workloads. It emerged from a cooperation between Kubernetes, Mesos, Cloud Foundry, and Docker and has the support of major storage vendors.

In this talk I answer the following question:
* What is CSI?
* Where did CSI came from?
* What is the current state of CSI?
* What are the future plans for CSI?
* How can I get involved with the development of CSI?

515740717a9ba5d00fb79158c9071097?s=128

Saad Ali

May 01, 2018
Tweet

Transcript

  1. mini summit COPENHAGEN What is the Container Storage Interface (CSI)?

    May 1, 2018 Saad Ali
  2. COPENHAGEN mini summit • Background • Introduction to CSI •

    CSI with Kubernetes • Current Status • Q/A Agenda 2
  3. COPENHAGEN mini summit 3 Kubernetes “In-tree” Volume Plugins are awesome

    =) • Powerful abstraction for file and block storage. • Automate provisioning, attaching, mounting, and more! • Storage portability via PV/PVC/StorageClass objects What’s the problem?
  4. COPENHAGEN mini summit Kubernetes “In-tree” Volume Plugins are painful =(

    • Painful for Kubernetes Developers • Testing and maintaining external code • Bugs in volume plugins affect critical Kubernetes components • Volume plugins get full privileges of kubernetes components (kubelet and kube-controller-manager) • Painful for Storage Vendors • Dependent on Kubernetes releases • Source code forced to be open source 4 What’s the problem?
  5. COPENHAGEN mini summit 5 Most Container orchestration (CO) systems want

    to be able to offer users as many storage systems as possible. We’re not alone! Most Storage providers (SP) want to be able to make their system available to as many users as possible with as little work as possible.
  6. COPENHAGEN mini summit 6 CSI makes Kubernetes volume layer truly

    extensible. Solution: CSI!
  7. COPENHAGEN mini summit 7 CSI is: • Interface that enables

    3 main use cases: • Create/delete volume • Attach/detach volume to a node • Mount/unmount volume to a node • Evolving • Example Create/delete snapshots functionality coming soon • Open Source • Contributions welcome! What is CSI? CSI is not: • Packaging, deployment, monitoring, etc. of a plugin. • Defining "grades of storage" or a “storage catalogue”
  8. COPENHAGEN mini summit 8 • Interface defined using gRPC •

    Segmented into three gRPC “services”: • Controller ▪ Maybe run anywhere in the cluster. • Node ▪ Must run only on the node where workload referencing volume is scheduled. • Identity ▪ Plugin information CSI Overview
  9. COPENHAGEN mini summit 9 Let’s talk about naming: • Create/delete

    volume • Attach/detach volume • Mount/unmount volume CSI Overview
  10. COPENHAGEN mini summit 10 Let’s talk about naming: • Create/delete

    volume • Attach/detach volume • Mount/unmount volume CSI Overview ControllerPublishVolume/ControllerUnpublishVolume NodePublishVolume/NodeUnpublishVolume
  11. COPENHAGEN mini summit 11 Controller service • ControllerGetCapabilities • CreateVolume

    • DeleteVolume • ControllerPublishVolume • ControllerUnpublishVolume • ListVolumes • GetCapacity • ValidateVolumeCapabilities CSI Overview Node service • NodeGetCapabilities • NodePublishVolume • NodeUnpublishVolume • NodeStageVolume • NodeUnstageVolume • NodeGetId Identity service • GetPluginCapabilities • GetPluginInfo • Probe
  12. COPENHAGEN mini summit CSI with Kubernetes

  13. COPENHAGEN mini summit 13 How to use a CSI Volume?

    kind: StorageClass apiVersion: storage.k8s.io/v1 metadata: name: fast-storage provisioner: com.example.csi-driver parameters: type: pd-ssd csiProvisionerSecretName: mysecret csiProvisionerSecretNamespace: mynamespace ------ kind: PersistentVolumeClaim apiVersion: v1 metadata: name: my-request-for-storage spec: accessModes: - ReadWriteOnce resources: requests: storage: 5Gi storageClassName: fast-storage kind: Pod apiVersion: v1 metadata: name: my-pod spec: containers: - name: my-frontend image: nginx volumeMounts: - mountPath: "/var/www/html" name: my-csi-volume volumes: - name: my-csi-volume persistentVolumeClaim: claimName: my-request-for-storage
  14. COPENHAGEN mini summit • Design in-progress to silently proxy to

    CSI drivers • Volumes that must move to CSI • Cloud provider dependent volumes • Remote persistent storage volumes 14 What happens to the “in-tree” volumes?
  15. COPENHAGEN mini summit 15 Up to Storage Vendor. Typically: •

    Containerized driver deployed via a StatefulSet and DaemonSet. • Easy as kubectl create -f storageprovider.yaml Deploying CSI driver on Kubernetes Cluster
  16. COPENHAGEN mini summit 16 • Suggested: • Write a containerized

    CSI driver • Write YAML to deploy driver along with sidecar containers (provided by Kubernetes dev team). What does a storage vendor have to do?
  17. COPENHAGEN mini summit 17 Node to CSI Communication Node •

    UDS at known location. Future: plugin registration. • Mount (Setup) calls from kubelet maps to NodePublishVolume • Driver handling Node calls must run on every node.
  18. COPENHAGEN mini summit 18 Master to CSI Communication Problem: •

    Master may not be able to run 3rd party code on master (e.g. GKE) • Assume CSI service can’t run locally. • CSI endpoint discovery? ▪ k8s Service? • Secure Communication between k8s and CSI endpoint • Complicated autz/n system?
  19. COPENHAGEN mini summit 19 Master to CSI Communication Solution: •

    CSI driver monitors Kubernetes API and triggers CSI operations as needed Node Master
  20. COPENHAGEN mini summit 20 Master to CSI Communication Solution: •

    CSI driver monitors Kubernetes API and triggers CSI operations as needed Node Master Shouldn’t have Kubernetes specific logic in CSI driver
  21. COPENHAGEN mini summit 21 Master to CSI Communication Solution: •

    CSI driver monitors Kubernetes API and triggers CSI operations as needed Node Master API Server Sidecar Container • Monitors API server • Triggers CSI Operations CSI gRC Endpoint: Identity + Controller
  22. Node Master

  23. COPENHAGEN mini summit • May 2017 • Spec published in

    GitHub repo • December 2017 • v0.1 release • February 2018 • v0.2 release 23 Status of CSI https://github.com/container-storage-interface • Implementations Started • Kubernetes introduced alpha support in v1.9, beta in v1.10 • Mesos 1.5 supports CSI (experimental) • Cloud Foundry has experimental support for CSI in recent versions • Docker is planning support
  24. COPENHAGEN mini summit Questions? github.com/container-storage-interface Contact me: ◦ Saad Ali,

    Google ◦ github.com/saad-ali ◦ twitter.com/the_saad_ali Get Involved! ◦ Container Storage Interface Community ◦ github.com/container-storage-interface/community ◦ Meeting every week, Wednesdays at 9 AM (PT) ◦ Mailing list: ▪ container-storage-interface-community@googlegroups.com ◦ Kubernetes Storage Special-Interest-Group (SIG) ◦ github.com/kubernetes/community/tree/master/sig-storage ◦ Meeting every 2 weeks, Thursdays at 9 AM (PST)