SlideShare a Scribd company logo
CSI - Intro
Idan Atias
Agenda
● Motivation
● High level overview of spec and architecture
Motivation
Short recap - stateless & stateful apps
Stateless apps
● No need to persist state in order to operate properly
● For example, a web server hosting static content
input
output
Stateful apps
● Require to persist state for operating consistently
● For example, a Database
input
output
Containers and stateful apps?
● Containers are ephemeral
○ Data is lost when container is restarted
● Containers are isolated
○ Data cannot be shared with other containers
● Therefore, containers alone are not a good fit for
stateful applications
Kubernetes storage solution
Volume plugin
● Kubernetes way for exposing a block device or a mounted
file system to all containers in a pod
● It determines:
○ The backing store of the volume (host / remote storage)
○ The lifecycle of the volume (same as pod’s LC / beyond pod’s LC)
Ephemeral storage in k8s
● EmptyDir volume plugin
● Volume allocated on a
host machine
● Data exists as long as
the pod exists
● Containers in the same
pod can share data
Ephemeral storage in k8s
● ConfigMap and Secret are volumes built on top of the
EmptyDir volume plugin
● Kubernetes expose these API objects as files in an
EmptyDir volume
Deploying Redis
● Redis is an in-memory key-
value store that can
persist data on disk
● We deploy a cluster of 3
redis nodes - 1 master and
2 replicas
● At first, we use an
EmptyDir volume for
storage
apiVersion: apps/v1
kind: StatefulSet
metadata:
name: redis
…
containers:
- command: [sh, -c, source /redis-
config/init.sh ]
image: redis:4.0.11-alpine
name: redis
ports:
- containerPort: 6379
name: redis
volumeMounts:
- mountPath: /redis-config
name: config
- mountPath: /redis-data
name: data
…..
volumes:
- configMap:
name: redis-config
name: config
- emptyDir: {}
name: data
Deploying Redis
Deploying Redis - adding data persistency
Persisting Redis data with ebs
● EBS - Amazon Elastic Block store
● First we’ll define a StorageClass object
● This object allows K8S to dynamically provision volumes
(PersistentVolume or PV) for our application
● It contains the information on which volume plugin to use
as well as the set of parameters for provisioning the
volume
● So essentially, this is a template for creating a new
volume
Persisting Redis data with ebs
kind: StorageClass
apiVersion: storage.k8s.io/v1
metadata:
name: redis-storage-standard
annotations:
storageclass.kubernetes.io/is-default-class: "true"
provisioner: kubernetes.io/aws-ebs
parameters:
type: gp2
fsType: ext4
Persisting Redis data with ebs
● Next we’ll need to add a volumeClaimTemplates section in
the stateful set definition
● This allows creating a PersistentVolumeClame (PVC) for
each pod in the stateful set
○ A PVC is a request for storage
○ It lets Kubernetes know:
■ How much storage the pod needs
■ What is the access mode to the volume (e.g., ReadWriteOnce)
■ What type of storage to use (i.e., StorageClass)
Persisting Redis data with ebs
apiVersion: apps/v1
kind: StatefulSet
metadata:
name: redis
...
volumeMounts:
- mountPath: /redis-data
name: data
...
volumeClaimTemplates:
- metadata:
name: data
spec:
accessModes: [ "ReadWriteOnce" ]
storageClassName: "redis-storage-standard"
resources:
requests:
storage: 1Gi
Persisting Redis data with ebs
Persisting Redis data with ebs
PVCs & PVs
remain
although sts
is deleted
Our data is
back after
redeploying
the sts
In-tree volume plugins
● EmptyDir and EBS are in-tree volume plugins
● In-tree volume plugins are part of the core Kubernetes
and are shipped with its binaries
● Example in-tree volume plugins:
○ EmptyDir
○ AWS EBS
○ Azure Disks
○ GCE pd
○ ScaleIO
○ Vsphere Volume
○ ...
In-tree volume plugins challenges
● Development is tightly coupled with Kubernetes releases.
● Kubernetes community is responsible for testing and
maintaining all volume plugins.
● Bugs in volume plugins can crash critical Kubernetes
components. (E.g., kubelet)
● Volume plugins are granted the same privileges as the
kubernetes component they are part of (E.g., kubelet)
● Forces volume plugin developers to make plugin source
code public.
Out-of-tree volume plugins
● Out-of-tree volume plugins are developed independently of
the Kubernetes code base, and are deployed on Kubernetes
clusters as extensions.
● Kubernetes supports 2 types of out-of-tree volume
plugins:
○ FlexVolume Driver (deprecated)
○ CSI Driver (GAed in Kubernetes 1.13)
CSI Overview
Brief history
● Over time, different COs (Container Orchestrators; e.g.,
Kubernetes, Mesos) developed their own storage interfaces
● It became a nightmare for SPs (storage providers), having
to support all of the different specs out there
● Besides that, there were issues with the interfaces
themselves
○ 1 of them is their “in-tree” structure
● Somewhere in 2017, some folks from different COs and SPs
decided to tackle these issues and formed the Container
Storage Interface - CSI
out-of-tree plugin
● Out-of-tree was chosen as
per the reasons we mentioned
before
Volume Operations
● 2 types of volume operations
● Must be executed on the node (volume’s host)
○ E.g., mount/unmount
● Can be executed on any node
○ E.g., create volume
● This led to the definition of 3 services
○ Identity Service - must run on each node (used for registering the driver
with CO node agent)
○ Node Service - must run on each node (used for “on-the-node” operations)
○ Controller Service - single instance the can run on any node (interacts
with the API Server and the Storage Provider)
○ CSI Driver needs to implement these services
● Next, we describe these services deeper (focusing on
Kubernetes)
Service APIs
● APIs should be:
○ Implemented as gRPC endpoints (over unix domain sockets)
○ Sync
○ Idempotent
■ For failure recovery
Identity Service
● GetPluginInfo
○ Driver metadata
■ Name, Vendor
● GetPluginCapabilities
○ For advertising what “features” the driver supports
○ E.g. CreateVolume
● Probe
○ Driver health check EP
Controller Service
● CreateVolume
● DeleteVolume
● ControllerPublishVolume
○ Attaching volume to node
● ControllerUnpublishVolume
○ Detach
● ValidateVolumeCapabilities
○ Validate requested vol caps match the supported caps
○ Stage/unstage
● ListVolumes
● GetCapacity
● ControllerGetCapabilities
Node Service
● NodeStageVolume
○ Mount volume to a staging path on the node
● NodeUnstageVolume
○ Unmounts from staging path
● NodePublishVolume
○ Mount the volume to the target path on the node (bind-mount)
● NodeUnpublishVolume
○ Unmount from target path
● NodeGetId
○ Node identifier - for iSCSI - IQN
● NodeGetCapabilities
Services diagram
Plugin Deployment
● As long as meets the CSI spec - no restrictions
● However, Kubernetes team has a recommended way
● It involves using a some helper side cars developed by
the Kubernetes community
● It also facilitates special CSI objects- CSIDriver,
CSINode
Sidecars / Helper containers
● Watch the Kubernetes API server
● Trigger appropriate operations
against the CSI Driver container
● Update the Kubernetes API server
with returned data from CSI
driver
● Available sidecars (partial):
○ Node-driver-registrar: fetch driver
info and register with kubelet
○ External-provisioner: more to follow
○ External-attacher: more to follow
external-provisioner
external-attacher
CSI - Intro: The End
Idan Atias

More Related Content

What's hot (20)

PPTX
Docker and kubernetes_introduction
Jason Hu
 
PPTX
K8s in 3h - Kubernetes Fundamentals Training
Piotr Perzyna
 
PDF
Introduction to kubernetes
Raffaele Di Fazio
 
PDF
The Power of GitOps with Flux & GitOps Toolkit
Weaveworks
 
PPTX
Docker, LinuX Container
Araf Karsh Hamid
 
PDF
An Introduction to Kubernetes
Imesh Gunaratne
 
PDF
Optimizing Kubernetes Resource Requests/Limits for Cost-Efficiency and Latenc...
Henning Jacobs
 
PDF
Kubernetes training
Des Drury
 
PDF
Présentation docker et kubernetes
Kiwi Backup
 
PDF
Helm - Application deployment management for Kubernetes
Alexei Ledenev
 
PDF
The Container Storage Interface (CSI)
Masiar Ighani
 
PDF
Kubernetes - introduction
Sparkbit
 
PPTX
Kubernetes Introduction
Martin Danielsson
 
PDF
Kubernetes Architecture | Understanding Kubernetes Components | Kubernetes Tu...
Edureka!
 
PPTX
Kubernetes Workshop
loodse
 
PDF
Introduction to Kubernetes Workshop
Bob Killen
 
PDF
Hands-On Introduction to Kubernetes at LISA17
Ryan Jarvinen
 
PDF
Kubernetes - A Comprehensive Overview
Bob Killen
 
PDF
Gitops Hands On
Brice Fernandes
 
PPTX
Kubernetes introduction
Dongwon Kim
 
Docker and kubernetes_introduction
Jason Hu
 
K8s in 3h - Kubernetes Fundamentals Training
Piotr Perzyna
 
Introduction to kubernetes
Raffaele Di Fazio
 
The Power of GitOps with Flux & GitOps Toolkit
Weaveworks
 
Docker, LinuX Container
Araf Karsh Hamid
 
An Introduction to Kubernetes
Imesh Gunaratne
 
Optimizing Kubernetes Resource Requests/Limits for Cost-Efficiency and Latenc...
Henning Jacobs
 
Kubernetes training
Des Drury
 
Présentation docker et kubernetes
Kiwi Backup
 
Helm - Application deployment management for Kubernetes
Alexei Ledenev
 
The Container Storage Interface (CSI)
Masiar Ighani
 
Kubernetes - introduction
Sparkbit
 
Kubernetes Introduction
Martin Danielsson
 
Kubernetes Architecture | Understanding Kubernetes Components | Kubernetes Tu...
Edureka!
 
Kubernetes Workshop
loodse
 
Introduction to Kubernetes Workshop
Bob Killen
 
Hands-On Introduction to Kubernetes at LISA17
Ryan Jarvinen
 
Kubernetes - A Comprehensive Overview
Bob Killen
 
Gitops Hands On
Brice Fernandes
 
Kubernetes introduction
Dongwon Kim
 

Similar to Introduction to Container Storage Interface (CSI) (20)

PDF
Persistent Storage in Docker Platform
Anusha Ragunathan
 
PPTX
Docker Online Training | Kubernetes Certification Training
navyatejavisualpath
 
PDF
DCEU 18: Provisioning and Managing Storage for Docker Containers
Docker, Inc.
 
PDF
Storage for Windows workloads in Kubernetes
Anusha Ragunathan
 
PDF
DCSF 19 Kubernetes and Container Storage Interface Update
Docker, Inc.
 
PDF
Discoblocks.pptx.pdf
Richárd Kovács
 
PDF
Kubernetes Meetup - Seattle 2017-06-01
Bassam Tabbara
 
PPTX
Challenges of Kubernetes On-premise Deployment
Vietnam Open Infrastructure User Group
 
PDF
KubeCon Europe 2019 - VMware SIG - Intro to the CSI driver
David vonThenen
 
PDF
What's New in Kubernetes Storage
DoKC
 
PPTX
DTW18 - code08 - Everything You Need To Know About Storage with Kubernetes
Kendrick Coleman
 
PDF
How to manage stateful applications in Kubernetes
Florian Woerner
 
PDF
Using CVMFS on a distributed Kubernetes cluster - The PRP Experience
Igor Sfiligoi
 
PDF
Solving k8s persistent workloads using k8s DevOps style
MayaData
 
PDF
Storage 101: Rook and Ceph - Open Infrastructure Denver 2019
Sean Cohen
 
PPTX
Protecting data with CSI Volume Snapshots on Kubernetes
DoKC
 
PDF
Open ebs 101
LibbySchulze
 
PPTX
Hack Shack workshop: Persist, optimize and accelerate using persistent storag...
Michael Mattsson
 
PDF
Container Attached Storage with OpenEBS - CNCF Paris Meetup
MayaData Inc
 
PDF
OpenEBS; asymmetrical block layer in user-space breaking the million IOPS bar...
MayaData
 
Persistent Storage in Docker Platform
Anusha Ragunathan
 
Docker Online Training | Kubernetes Certification Training
navyatejavisualpath
 
DCEU 18: Provisioning and Managing Storage for Docker Containers
Docker, Inc.
 
Storage for Windows workloads in Kubernetes
Anusha Ragunathan
 
DCSF 19 Kubernetes and Container Storage Interface Update
Docker, Inc.
 
Discoblocks.pptx.pdf
Richárd Kovács
 
Kubernetes Meetup - Seattle 2017-06-01
Bassam Tabbara
 
Challenges of Kubernetes On-premise Deployment
Vietnam Open Infrastructure User Group
 
KubeCon Europe 2019 - VMware SIG - Intro to the CSI driver
David vonThenen
 
What's New in Kubernetes Storage
DoKC
 
DTW18 - code08 - Everything You Need To Know About Storage with Kubernetes
Kendrick Coleman
 
How to manage stateful applications in Kubernetes
Florian Woerner
 
Using CVMFS on a distributed Kubernetes cluster - The PRP Experience
Igor Sfiligoi
 
Solving k8s persistent workloads using k8s DevOps style
MayaData
 
Storage 101: Rook and Ceph - Open Infrastructure Denver 2019
Sean Cohen
 
Protecting data with CSI Volume Snapshots on Kubernetes
DoKC
 
Open ebs 101
LibbySchulze
 
Hack Shack workshop: Persist, optimize and accelerate using persistent storag...
Michael Mattsson
 
Container Attached Storage with OpenEBS - CNCF Paris Meetup
MayaData Inc
 
OpenEBS; asymmetrical block layer in user-space breaking the million IOPS bar...
MayaData
 
Ad

Recently uploaded (20)

PDF
Understanding the Need for Systemic Change in Open Source Through Intersectio...
Imma Valls Bernaus
 
PPTX
Platform for Enterprise Solution - Java EE5
abhishekoza1981
 
PPTX
Fundamentals_of_Microservices_Architecture.pptx
MuhammadUzair504018
 
PDF
Unlock Efficiency with Insurance Policy Administration Systems
Insurance Tech Services
 
PDF
Build It, Buy It, or Already Got It? Make Smarter Martech Decisions
bbedford2
 
PDF
Alarm in Android-Scheduling Timed Tasks Using AlarmManager in Android.pdf
Nabin Dhakal
 
PDF
Linux Certificate of Completion - LabEx Certificate
VICTOR MAESTRE RAMIREZ
 
PPTX
Human Resources Information System (HRIS)
Amity University, Patna
 
PDF
유니티에서 Burst Compiler+ThreadedJobs+SIMD 적용사례
Seongdae Kim
 
PDF
Capcut Pro Crack For PC Latest Version {Fully Unlocked} 2025
hashhshs786
 
PPTX
MailsDaddy Outlook OST to PST converter.pptx
abhishekdutt366
 
PDF
iTop VPN With Crack Lifetime Activation Key-CODE
utfefguu
 
DOCX
Import Data Form Excel to Tally Services
Tally xperts
 
PPTX
Migrating Millions of Users with Debezium, Apache Kafka, and an Acyclic Synch...
MD Sayem Ahmed
 
PDF
Executive Business Intelligence Dashboards
vandeslie24
 
PPT
MergeSortfbsjbjsfk sdfik k
RafishaikIT02044
 
PDF
MiniTool Partition Wizard 12.8 Crack License Key LATEST
hashhshs786
 
PPTX
Why Businesses Are Switching to Open Source Alternatives to Crystal Reports.pptx
Varsha Nayak
 
PPTX
Revolutionizing Code Modernization with AI
KrzysztofKkol1
 
PPTX
Engineering the Java Web Application (MVC)
abhishekoza1981
 
Understanding the Need for Systemic Change in Open Source Through Intersectio...
Imma Valls Bernaus
 
Platform for Enterprise Solution - Java EE5
abhishekoza1981
 
Fundamentals_of_Microservices_Architecture.pptx
MuhammadUzair504018
 
Unlock Efficiency with Insurance Policy Administration Systems
Insurance Tech Services
 
Build It, Buy It, or Already Got It? Make Smarter Martech Decisions
bbedford2
 
Alarm in Android-Scheduling Timed Tasks Using AlarmManager in Android.pdf
Nabin Dhakal
 
Linux Certificate of Completion - LabEx Certificate
VICTOR MAESTRE RAMIREZ
 
Human Resources Information System (HRIS)
Amity University, Patna
 
유니티에서 Burst Compiler+ThreadedJobs+SIMD 적용사례
Seongdae Kim
 
Capcut Pro Crack For PC Latest Version {Fully Unlocked} 2025
hashhshs786
 
MailsDaddy Outlook OST to PST converter.pptx
abhishekdutt366
 
iTop VPN With Crack Lifetime Activation Key-CODE
utfefguu
 
Import Data Form Excel to Tally Services
Tally xperts
 
Migrating Millions of Users with Debezium, Apache Kafka, and an Acyclic Synch...
MD Sayem Ahmed
 
Executive Business Intelligence Dashboards
vandeslie24
 
MergeSortfbsjbjsfk sdfik k
RafishaikIT02044
 
MiniTool Partition Wizard 12.8 Crack License Key LATEST
hashhshs786
 
Why Businesses Are Switching to Open Source Alternatives to Crystal Reports.pptx
Varsha Nayak
 
Revolutionizing Code Modernization with AI
KrzysztofKkol1
 
Engineering the Java Web Application (MVC)
abhishekoza1981
 
Ad

Introduction to Container Storage Interface (CSI)

  • 2. Agenda ● Motivation ● High level overview of spec and architecture
  • 4. Short recap - stateless & stateful apps
  • 5. Stateless apps ● No need to persist state in order to operate properly ● For example, a web server hosting static content input output
  • 6. Stateful apps ● Require to persist state for operating consistently ● For example, a Database input output
  • 7. Containers and stateful apps? ● Containers are ephemeral ○ Data is lost when container is restarted ● Containers are isolated ○ Data cannot be shared with other containers ● Therefore, containers alone are not a good fit for stateful applications
  • 9. Volume plugin ● Kubernetes way for exposing a block device or a mounted file system to all containers in a pod ● It determines: ○ The backing store of the volume (host / remote storage) ○ The lifecycle of the volume (same as pod’s LC / beyond pod’s LC)
  • 10. Ephemeral storage in k8s ● EmptyDir volume plugin ● Volume allocated on a host machine ● Data exists as long as the pod exists ● Containers in the same pod can share data
  • 11. Ephemeral storage in k8s ● ConfigMap and Secret are volumes built on top of the EmptyDir volume plugin ● Kubernetes expose these API objects as files in an EmptyDir volume
  • 12. Deploying Redis ● Redis is an in-memory key- value store that can persist data on disk ● We deploy a cluster of 3 redis nodes - 1 master and 2 replicas ● At first, we use an EmptyDir volume for storage apiVersion: apps/v1 kind: StatefulSet metadata: name: redis … containers: - command: [sh, -c, source /redis- config/init.sh ] image: redis:4.0.11-alpine name: redis ports: - containerPort: 6379 name: redis volumeMounts: - mountPath: /redis-config name: config - mountPath: /redis-data name: data ….. volumes: - configMap: name: redis-config name: config - emptyDir: {} name: data
  • 14. Deploying Redis - adding data persistency
  • 15. Persisting Redis data with ebs ● EBS - Amazon Elastic Block store ● First we’ll define a StorageClass object ● This object allows K8S to dynamically provision volumes (PersistentVolume or PV) for our application ● It contains the information on which volume plugin to use as well as the set of parameters for provisioning the volume ● So essentially, this is a template for creating a new volume
  • 16. Persisting Redis data with ebs kind: StorageClass apiVersion: storage.k8s.io/v1 metadata: name: redis-storage-standard annotations: storageclass.kubernetes.io/is-default-class: "true" provisioner: kubernetes.io/aws-ebs parameters: type: gp2 fsType: ext4
  • 17. Persisting Redis data with ebs ● Next we’ll need to add a volumeClaimTemplates section in the stateful set definition ● This allows creating a PersistentVolumeClame (PVC) for each pod in the stateful set ○ A PVC is a request for storage ○ It lets Kubernetes know: ■ How much storage the pod needs ■ What is the access mode to the volume (e.g., ReadWriteOnce) ■ What type of storage to use (i.e., StorageClass)
  • 18. Persisting Redis data with ebs apiVersion: apps/v1 kind: StatefulSet metadata: name: redis ... volumeMounts: - mountPath: /redis-data name: data ... volumeClaimTemplates: - metadata: name: data spec: accessModes: [ "ReadWriteOnce" ] storageClassName: "redis-storage-standard" resources: requests: storage: 1Gi
  • 20. Persisting Redis data with ebs PVCs & PVs remain although sts is deleted Our data is back after redeploying the sts
  • 21. In-tree volume plugins ● EmptyDir and EBS are in-tree volume plugins ● In-tree volume plugins are part of the core Kubernetes and are shipped with its binaries ● Example in-tree volume plugins: ○ EmptyDir ○ AWS EBS ○ Azure Disks ○ GCE pd ○ ScaleIO ○ Vsphere Volume ○ ...
  • 22. In-tree volume plugins challenges ● Development is tightly coupled with Kubernetes releases. ● Kubernetes community is responsible for testing and maintaining all volume plugins. ● Bugs in volume plugins can crash critical Kubernetes components. (E.g., kubelet) ● Volume plugins are granted the same privileges as the kubernetes component they are part of (E.g., kubelet) ● Forces volume plugin developers to make plugin source code public.
  • 23. Out-of-tree volume plugins ● Out-of-tree volume plugins are developed independently of the Kubernetes code base, and are deployed on Kubernetes clusters as extensions. ● Kubernetes supports 2 types of out-of-tree volume plugins: ○ FlexVolume Driver (deprecated) ○ CSI Driver (GAed in Kubernetes 1.13)
  • 25. Brief history ● Over time, different COs (Container Orchestrators; e.g., Kubernetes, Mesos) developed their own storage interfaces ● It became a nightmare for SPs (storage providers), having to support all of the different specs out there ● Besides that, there were issues with the interfaces themselves ○ 1 of them is their “in-tree” structure ● Somewhere in 2017, some folks from different COs and SPs decided to tackle these issues and formed the Container Storage Interface - CSI
  • 26. out-of-tree plugin ● Out-of-tree was chosen as per the reasons we mentioned before
  • 27. Volume Operations ● 2 types of volume operations ● Must be executed on the node (volume’s host) ○ E.g., mount/unmount ● Can be executed on any node ○ E.g., create volume ● This led to the definition of 3 services ○ Identity Service - must run on each node (used for registering the driver with CO node agent) ○ Node Service - must run on each node (used for “on-the-node” operations) ○ Controller Service - single instance the can run on any node (interacts with the API Server and the Storage Provider) ○ CSI Driver needs to implement these services ● Next, we describe these services deeper (focusing on Kubernetes)
  • 28. Service APIs ● APIs should be: ○ Implemented as gRPC endpoints (over unix domain sockets) ○ Sync ○ Idempotent ■ For failure recovery
  • 29. Identity Service ● GetPluginInfo ○ Driver metadata ■ Name, Vendor ● GetPluginCapabilities ○ For advertising what “features” the driver supports ○ E.g. CreateVolume ● Probe ○ Driver health check EP
  • 30. Controller Service ● CreateVolume ● DeleteVolume ● ControllerPublishVolume ○ Attaching volume to node ● ControllerUnpublishVolume ○ Detach ● ValidateVolumeCapabilities ○ Validate requested vol caps match the supported caps ○ Stage/unstage ● ListVolumes ● GetCapacity ● ControllerGetCapabilities
  • 31. Node Service ● NodeStageVolume ○ Mount volume to a staging path on the node ● NodeUnstageVolume ○ Unmounts from staging path ● NodePublishVolume ○ Mount the volume to the target path on the node (bind-mount) ● NodeUnpublishVolume ○ Unmount from target path ● NodeGetId ○ Node identifier - for iSCSI - IQN ● NodeGetCapabilities
  • 33. Plugin Deployment ● As long as meets the CSI spec - no restrictions ● However, Kubernetes team has a recommended way ● It involves using a some helper side cars developed by the Kubernetes community ● It also facilitates special CSI objects- CSIDriver, CSINode
  • 34. Sidecars / Helper containers ● Watch the Kubernetes API server ● Trigger appropriate operations against the CSI Driver container ● Update the Kubernetes API server with returned data from CSI driver ● Available sidecars (partial): ○ Node-driver-registrar: fetch driver info and register with kubelet ○ External-provisioner: more to follow ○ External-attacher: more to follow
  • 37. CSI - Intro: The End Idan Atias