Slide 1

Slide 1 text

mini summit COPENHAGEN What is the Container Storage Interface (CSI)? May 1, 2018 Saad Ali

Slide 2

Slide 2 text

COPENHAGEN mini summit • Background • Introduction to CSI • CSI with Kubernetes • Current Status • Q/A Agenda 2

Slide 3

Slide 3 text

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?

Slide 4

Slide 4 text

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?

Slide 5

Slide 5 text

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.

Slide 6

Slide 6 text

COPENHAGEN mini summit 6 CSI makes Kubernetes volume layer truly extensible. Solution: CSI!

Slide 7

Slide 7 text

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”

Slide 8

Slide 8 text

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

Slide 9

Slide 9 text

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

Slide 10

Slide 10 text

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

Slide 11

Slide 11 text

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

Slide 12

Slide 12 text

COPENHAGEN mini summit CSI with Kubernetes

Slide 13

Slide 13 text

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

Slide 14

Slide 14 text

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?

Slide 15

Slide 15 text

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

Slide 16

Slide 16 text

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?

Slide 17

Slide 17 text

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.

Slide 18

Slide 18 text

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?

Slide 19

Slide 19 text

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

Slide 20

Slide 20 text

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

Slide 21

Slide 21 text

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

Slide 22

Slide 22 text

Node Master

Slide 23

Slide 23 text

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

Slide 24

Slide 24 text

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)