Slide 1

Slide 1 text

How to manage stateful applications in Kubernetes Devoxx France - 2018 1

Slide 2

Slide 2 text

Florian Woerner DevOps Engineer / Cloud Architect Onmyown @woernfl [email protected] 2

Slide 3

Slide 3 text

Agenda ● Context ● Volume provider ● Volumes lifecycle management ● Demo ● Conclusion 3 @woernfl

Slide 4

Slide 4 text

Why should I choose Kubernetes over VMs? 4 @woernfl

Slide 5

Slide 5 text

Because Kubernetes is a distributed system management framework 5

Slide 6

Slide 6 text

Why would we need to manage data persistence? 6 @woernfl

Slide 7

Slide 7 text

Because, stateless architecture… it does not exist 7

Slide 8

Slide 8 text

Types of volumes 8

Slide 9

Slide 9 text

Types of Volumes - Kubernetes Internals ● configMap ● downwardAPI ● emptyDir ● gitRepo ● hostPath ● local ● persistentVolumeClaim ● projected ● Secret ● csi 9 @woernfl

Slide 10

Slide 10 text

Types of Volumes - Public Cloud 10 @woernfl ● awsElasticBlockStore ● azureDisk ● azureFile ● gcePersistentDisk

Slide 11

Slide 11 text

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

Slide 12

Slide 12 text

Any issues? 12 @woernfl

Slide 13

Slide 13 text

CSI to the rescue 13

Slide 14

Slide 14 text

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

Slide 15

Slide 15 text

Why is it so important? ● Common interface to multiple platforms (standardisation) ● Allow storage provider to release out of tree 15 @woernfl

Slide 16

Slide 16 text

Real world scenario with Bob the dev and John the Sysadmin 16

Slide 17

Slide 17 text

Scenario: Persistent Volumes and Claims 17

Slide 18

Slide 18 text

Scenario: Persistent Volumes and Claims 18 @woernfl Kubernetes Node Storage (NFS, EBS, ...)

Slide 19

Slide 19 text

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

Slide 20

Slide 20 text

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

Slide 21

Slide 21 text

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

Slide 22

Slide 22 text

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

Slide 23

Slide 23 text

Scenario: Dynamic Provisioning 23

Slide 24

Slide 24 text

Scenario: Dynamic Provisioning 24 @woernfl Kubernetes Node Storage (NFS, EBS, ...)

Slide 25

Slide 25 text

Scenario: Dynamic Provisioning 25 @woernfl Kubernetes Node Storage (NFS, EBS, ...) Storage Class - SDD Storage Class - HDD

Slide 26

Slide 26 text

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

Slide 27

Slide 27 text

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

Slide 28

Slide 28 text

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

Slide 29

Slide 29 text

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

Slide 30

Slide 30 text

Demo 30

Slide 31

Slide 31 text

Conclusion 31

Slide 32

Slide 32 text

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

Slide 33

Slide 33 text

Thank you! 33 Link to the repos: https://github.com/woernfl/k8s-stateful-demo