Upgrade to Pro — share decks privately, control downloads, hide ads and more …

How to manage stateful applications in Kubernetes

How to manage stateful applications in Kubernetes

Managing stateless applications with Kubernetes is easy, but it becomes complex when information needs to persist in time, like for example for databases.
During this talk, I will go through the state of the Kubernetes storage ecosystem and make a demo to demonstrate how to manage persistent volume in Kubernetes.

Florian Woerner

April 20, 2018
Tweet

More Decks by Florian Woerner

Other Decks in Technology

Transcript

  1. Types of Volumes - Kubernetes Internals • configMap • downwardAPI

    • emptyDir • gitRepo • hostPath • local • persistentVolumeClaim • projected • Secret • csi 9 @woernfl
  2. Types of Volumes - Public Cloud 10 @woernfl • awsElasticBlockStore

    • azureDisk • azureFile • gcePersistentDisk
  3. Types of Volumes - Non Cloud Dependant • cephfs •

    fc (fibre channel) • flocker • glusterfs • nfs • iscsi • portworxVolume • quobyte • rbd (Rados Block Device) • scaleIO • storageos • vsphereVolume 11 @woernfl
  4. What is CSI? • Container Storage Interface • Adopted by

    Kubernetes, Mesos and Cloud Foundry (for the moment) • Supported as beta in Kubernetes 1.10 (planed to fall in stable for 1.12) • Is a standardized way of exposing storage to a container 14 @woernfl
  5. Why is it so important? • Common interface to multiple

    platforms (standardisation) • Allow storage provider to release out of tree 15 @woernfl
  6. Scenario: Persistent Volumes and Claims 20 @woernfl Kubernetes Node Storage

    (NFS, EBS, ...) Persistent Volume Persistent Volume Claim
  7. Scenario: Persistent Volumes and Claims 21 @woernfl Kubernetes Node Storage

    (NFS, EBS, ...) Persistent Volume Persistent Volume Claim Pod
  8. Scenario: Persistent Volumes and Claims 22 @woernfl Kubernetes Node Storage

    (NFS, EBS, ...) Persistent Volume Persistent Volume Claim Pod
  9. Scenario: Dynamic Provisioning 26 @woernfl Kubernetes Node Storage (NFS, EBS,

    ...) Persistent Volume Claim Storage Class - SDD Storage Class - HDD
  10. Scenario: Dynamic Provisioning 27 @woernfl Kubernetes Node Storage (NFS, EBS,

    ...) Persistent Volume Persistent Volume Claim Storage Class - SDD Storage Class - HDD
  11. Scenario: Dynamic Provisioning 28 @woernfl Kubernetes Node Storage (NFS, EBS,

    ...) Persistent Volume Persistent Volume Claim Pod Storage Class - SDD Storage Class - HDD
  12. Scenario: Dynamic Provisioning 29 @woernfl Kubernetes Node Storage (NFS, EBS,

    ...) Persistent Volume Persistent Volume Claim Pod Storage Class - SDD Storage Class - HDD
  13. References 32 • Volumes Kubernetes Doc: https://kubernetes.io/docs/concepts/storage/volumes/ • Kubernetes Tasks:

    https://kubernetes.io/docs/tasks/ • Configure a Pod to Use a PersistentVolume for Storage: https://kubernetes.io/docs/tasks/configure-pod-container/configure-persistent-volume-storage/ • Run a Single-Instance Stateful Application: https://kubernetes.io/docs/tasks/run-application/run-single-instance-stateful-application/ • Run a Replicated Stateful Application: https://kubernetes.io/docs/tasks/run-application/run-replicated-stateful-application/ • StatefulSets Kubernetes Doc: https://kubernetes.io/docs/concepts/workloads/controllers/statefulset/ @woernfl