Cloud Malaya Lab
  • Home Cloud Lab
    • Architecture
    • DNS Server
  • DevOps & DevSecOps
    • Kubernetes
      • Fundamental
        • Taints in Kubernetes
        • Kubernetes Observability (Monitoring) Guide
        • DNS in Kubernetes (CoreDNS)
        • Storage in Kubernetes
          • Container Storage Interface - CSI
          • Ephemeral Storage Explain
        • Cluster CPU & Memory Inspections
        • Open Source and Free Storage Solution Kubernetes
      • PoC Lab
        • Configure Access to Multiple Cluster using KUBE_CONFIG
        • High Availability Portable Mini Kubernetes Data Center with K3s
          • Lab 1: Build the K3s Infrastructure
          • Lab 2: Automate the K3s clusters deployment with Ansible
          • Lab 3: Multi Master K3s kubeconfig files for smooth accessibility
          • Lab 4: Network Configurations & Tools
        • AWX/Ansible Tower Deployment on Kubernetes
          • Lab 1 - Understanding Requirements
          • Lab 2 - AWX,AWX Operator Configurations & Deployments
          • Lab 3 - Ingress Networking & Connectivity via Nginx
          • Lab 4: AWX Web Console & accessibility on LAN
        • Troubleshooting: Ansible Tower - Reset admin password
    • Monitoring & Observability
      • Splunk
        • Splunk Deployment for SME (Malay Version)
    • System Administration - Linux
      • RedHat Derivatives
        • Add User to Sudoers
        • Yum Update vs Yum Upgrade
        • DNF update vs upgrade
        • SMP PREEMPT_DYNAMIC Definitions
      • Virtualization
        • KVM
      • Storage
  • Digital Infrastructure & Cloud Solutions
    • Solution & System Design
      • Public Cloud
        • Fundamental
          • AWS
          • Azure
          • GCP
        • Lab
          • Simple CD menggunakan Github Action
      • Private Cloud & On-Premise
      • On-Premise to Cloud Design
        • AWS Direct Connect
      • High Availability & Fault Tolerance Design
      • Disaster Recovery
Powered by GitBook
On this page
  1. DevOps & DevSecOps
  2. Kubernetes
  3. Fundamental
  4. Storage in Kubernetes

Container Storage Interface - CSI

The Container Storage Interface (CSI) is a standard that defines a set of specifications for container orchestrators like Kubernetes to interact with various storage systems in a pluggable and extensible manner. CSI enables Kubernetes to work with a wide range of storage solutions, including cloud-based storage, network-attached storage (NAS), and storage area networks (SANs), without needing to modify the core Kubernetes codebase for each storage system. Here's an explanation of CSI and its usage in Kubernetes:

1. CSI Components:

  • CSI Driver: A CSI driver is a plugin that implements the CSI specification for a specific storage system. Each storage provider (e.g., AWS EBS, NFS, Ceph) can develop its own CSI driver.

  • CSI Controller: The CSI controller is responsible for creating, deleting, and managing storage volumes based on the driver's specifications.

  • CSI Node Plugin: The CSI node plugin runs on each Kubernetes node and is responsible for attaching, detaching, and mounting volumes to pods.

2. CSI and Kubernetes Integration:

  • Kubernetes uses CSI drivers to extend its storage capabilities without modifying the Kubernetes core code. This separation allows for easier maintenance and the ability to add new storage providers without changing Kubernetes itself.

  • CSI drivers are installed and managed separately from the Kubernetes cluster. When a cluster administrator deploys a CSI driver, it becomes available for use by the cluster's users and applications.

3. Usage of CSI in Kubernetes:

  • 1. Deploying CSI Drivers: Cluster administrators typically deploy CSI drivers in the cluster as DaemonSets or StatefulSets, ensuring that the CSI node plugin is available on every node where pods may run.

  • 2. Creating a Persistent Volume (PV): The first step in using CSI is to create a Persistent Volume (PV) that represents the storage resource provided by the CSI driver. This is done by creating a YAML definition for the PV with the appropriate CSI driver and parameters.

  • 3. Creating a Persistent Volume Claim (PVC): Users or applications create a Persistent Volume Claim (PVC) to request storage resources. The PVC specifies the access mode and size requirements. Kubernetes then matches the PVC to an available PV, based on the storage class and other criteria.

  • 4. Using the PVC in Pods: In a Pod's YAML definition, you can specify the PVC as a volume source. When the Pod is scheduled and started, the CSI node plugin on the node attaches the appropriate PV to the pod as a volume, making the storage available to the container.

  • 5. Data Management: Kubernetes users can manage data by creating snapshots of PVCs and cloning volumes. This is particularly useful for creating backups and managing application state.

  • 6. Scaling and Upgrading: As your application scales and evolves, you can continue to use the same CSI driver while making necessary updates to the driver or CSI version. This decoupling of storage and Kubernetes allows for flexibility and seamless upgrades.

4. Benefits of CSI:

  • Pluggability: CSI allows for easy integration of various storage solutions, making it possible to choose the best storage system for your specific use case.

  • Flexibility: Users can change storage providers or drivers without modifying application code or Kubernetes configurations.

  • Community Support: The CSI specification is well-supported and has a growing ecosystem of drivers maintained by both storage vendors and the Kubernetes community.

PreviousStorage in KubernetesNextEphemeral Storage Explain

Last updated 1 year ago