Understanding the Container Storage Interface (CSI)

Image for post
Image for post
Container Storage Interface

Introduction

Container Storage Interface (CSI) is an initiative to unify the storage interface of Container Orchestrator Systems (COs) like Kubernetes, Mesos, Docker swarm, cloud foundry, etc. combined with storage vendors like Ceph, Portworx, NetApp etc. This means, implementing a single CSI for a storage vendor is guaranteed to work with all COs.

Before CSI

The first release of CSI v0.1 was in December 2017. It was ofcourse possible to provision external storage in COs before CSI existed. Volume plugins were serving the storage needs for container workloads in case of Kubernetes.

Image for post
Image for post
  • Kubernetes developers/community are responsible for testing and maintaining all volume plugins, instead of just testing and maintaining a stable plugin API.
  • Bugs in volume plugins can crash critical Kubernetes components, instead of just the plugin.
  • Volume plugins get full privileges of kubernetes components (kubelet and kube-controller-manager).
  • Plugin developers are forced to make plugin source code available, and can not choose to release just a binary.

Understanding CSI

On introduction of CSI, Kubernetes team released some external components which are not part of the core and that can interact with vendor implemented external components. They communicate to each other over gRPC on domain sockets.

Image for post
Image for post

Kubernetes external component

This is completely implemented and maintained by the Kubernetes team. These extend kubernetes actions outside of kubernetes. The vendors need not worry about the implementation details of this at all. They consists of three sub-components.

  • External provisioner — is a sidecar container that watches Kubernetes PersistentVolumeClaim objects and triggers CSI CreateVolume and DeleteVolume operations against a driver endpoint.
  • External attacher — is a sidecar container that watches Kubernetes VolumeAttachment objects and triggers CSI ControllerPublish and ControllerUnpublish operations against a driver endpoint

Storage vendor/3rd-party external component

This is a vendor specific implementation. Each vendor should implement their respective APIs into gRPC service functions. E.g. Implementation of GCE PD, Ceph, etc. They too consists of three sub-components.

Conclusion

With the introduction of CSI, there is a clear benefit for the COs and storage vendors. Due to its well-defined interfaces, it also helps developers and future COs to easily implement and test CSI. At this point, if you decide to start implementing you own CSI, this is a good place to start with: how-to implement a CSI from FatihArlsan.

References

  1. CSI spec: https://github.com/container-storage-interface/spec/blob/master/spec.md
  2. Kubernetes sidecar containers: https://kubernetes.io/blog/2015/06/the-distributed-system-toolkit-patterns/
  3. KubeCon EU: CloudNativeCon EU 2018 CSI Jie Yu
  4. CSI design document: https://github.com/kubernetes/community/blob/master/contributors/design-proposals/storage/container-storage-interface.md
  5. CSI docs: https://kubernetes-csi.github.io/docs/
  6. CSI docs (deprecated): https://github.com/kubernetes-csi/docs/wiki/Usage

Google Cloud - Community

A collection of technical articles published or curated by…

anoop vijayan maniankara

Written by

Devops, Kubernetes, GKE, On-premise

Google Cloud - Community

A collection of technical articles published or curated by Google Cloud Developer Advocates. The views expressed are those of the authors and don't necessarily reflect those of Google.

anoop vijayan maniankara

Written by

Devops, Kubernetes, GKE, On-premise

Google Cloud - Community

A collection of technical articles published or curated by Google Cloud Developer Advocates. The views expressed are those of the authors and don't necessarily reflect those of Google.

Welcome to a place where words matter. On Medium, smart voices and original ideas take center stage - with no ads in sight. Watch
Follow all the topics you care about, and we’ll deliver the best stories for you to your homepage and inbox. Explore
Get unlimited access to the best stories on Medium — and support writers while you’re at it. Just $5/month. Upgrade

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store