404 Not Found
  • Introduction
  • Monitoring related
    • K8s cluster monitoring
    • Monitor Jenkins with G.A.P on K8s cluster
    • Monitoring tools | projects
      • Grafana
      • AlertManager
      • Prometheus
      • Wavefront
  • Logging related
    • BOSH logs
    • How to gather systemd log
    • K8s cluster logging
    • Logging tools | projects
      • vRealize Log Insight
      • Fluentd
      • syslog vs fluentd
  • Having fun with docker
    • Using docker-compose for redmine
    • Customize Fluentd docker image
  • K8S or Apache Mesos
  • K8S Related
    • Main Architecture
      • Master components
        • API Server
        • etcd
        • Controller Manager
        • Kube Scheduler
      • Worker components
        • kubelet
        • kube-proxy
    • K8S Storage
      • Volume Provisioning
      • Understand CSI
      • How to write CSI
      • VMware CNS
      • K8S storage e2e experiment under VMware vSphere
      • Experiment on Persistent Volume Access Mode
      • Design: Storage in Cluster-API architecture
    • K8S Networking
      • Ingress
      • Endpoints
    • K8S Policies
      • Resource Quotas
    • K8S Management Platform
    • K8S Tests Tool
    • K8S Extension
      • CRDs
        • Custom Resources
        • Custom Controllers
        • How to user code-generator
        • K8S Operators
        • Operators Development Tools
          • Kubebuilder
          • Metacontroller
          • Operator SDK
      • Custom API Server
    • K8S Resource CRUD Workflow
    • K8S Garbage Collection
  • K8S CONTROLLER RELATED
    • IsController: true
    • Controller clients
  • PKS RELATED
    • How to Access VMs and Databases related to PKS
    • PKS Basics
    • BOSH Director
    • Backup and Restore on Ent. PKS with Velero
  • CICD RELATED
    • Configure Jenkins to run on K8S
    • Customize Jenkins JNLP slave image
    • Jenkins global shared libs
  • Google Anthos
    • Google Anthos Day from KubeCon 2019 San Diego
    • Migrate for Anthos
    • Config Connector
  • SYSTEM DESIGN RELATED
    • Design Data Intensive Application - Notes
      • RSM
        • Reliability
        • Scalability
      • Data models and Query Languages
      • Storage and Retrieval
    • How Alibaba Ensure K8S Performance At Large Scale
  • Miscellaneous
    • Knative
    • Serverless
    • Service Mesh
    • gRPC
    • Local persistent volumes
    • ownerReferences in K8S
    • File(NAS) vs Block(SAN) vs Object storage
    • KubeVirt
    • Why K8S HA chooses 3 instead of 5..6..7 as the size of masters?
    • goroutine & go channel
    • How to make docker images smaller
Powered by GitBook
On this page
  • Introduction
  • Before CSI
  • Understanding CSI
  • Kubernetes external component
  • Storage vendor/3rd-party external component
  • Conclusion

Was this helpful?

  1. K8S Related
  2. K8S Storage

Understand CSI

PreviousVolume ProvisioningNextHow to write CSI

Last updated 5 years ago

Was this helpful?

The original page is at . I copied it here just in case the link will be invalid some day.

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 we dive in, one should know what sidecar containers are in Kubernetes. Sidecar containers extend and enhance the “main” container. They exist in the same pod as the “main” container sharing storage and network with it.

At the time of writing the following are version status of the CSI components.

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.

The volume plugins are part of the COs core as shown in the picture above. Due to this, it has the following drawbacks mentioned in the CSI design document:

  • Volume plugin development is tightly coupled and dependent on Kubernetes releases.

  • 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

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.

  • Driver registrar — is a sidecar container that registers the CSI driver with kubelet, and adds the drivers custom NodeId to a label on the Kubernetes Node API Object. It does this by communicating with the Identity service on the CSI driver and also calling the CSI GetNodeId operation.

  • 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

  • CSI Identity — is mainly for identifying the plugin service, making sure it’s healthy, and returning basic information about the plugin itself.

  • CSI Controller — is responsible of controlling and managing the volumes, such as: creating, deleting, attaching/detaching, snapshotting, etc.

  • CSI Node — is responsible for controllong volume’s action in the kubernetes node.

Conclusion

Note that, we discuss only about dynamic provisioning in this article. Pre-provisioned volumes and flex volumes are out of scope of this article. If you do know what I am talking about, read more about them . Also, this article is not going to deep-dive into the implementation details of CSI. This document gives a good high-level overview and is a good prerequisite to start implementing CSI. Also, examples and references are based on Kubernetes COs.

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 on domain sockets.

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

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: .

here
gRPC
GCE PD
Ceph
how-to implement a CSI from FatihArlsan
https://medium.com/google-cloud/understanding-the-container-storage-interface-csi-ddbeb966a3b