persistent storage options with kubernetes & flocker

26
Persistent Storage with Kubernetes & Flocker

Upload: clusterhq

Post on 16-Apr-2017

3.539 views

Category:

Technology


4 download

TRANSCRIPT

Page 1: Persistent Storage Options with Kubernetes & Flocker

Persistent Storage with Kubernetes & Flocker

Page 2: Persistent Storage Options with Kubernetes & Flocker

Stephen Nguyen

Evangelist@Stephenitis

-kubernetes experience few months

+ =

Page 3: Persistent Storage Options with Kubernetes & Flocker

goals: • What is a Volume? • What kind of Volumes can I use? and maybe why • Demo

Page 4: Persistent Storage Options with Kubernetes & Flocker
Page 5: Persistent Storage Options with Kubernetes & Flocker

Pods In Kubernetes, rather than individual application containers, pods are the smallest deployable units that can be created,

scheduled, and managed.

Page 6: Persistent Storage Options with Kubernetes & Flocker

Pods • you can’t migrate a running pod • You can set different restart policies with

different controllers • replication controllers help set a minimum and

maximum number of running replicas

Page 7: Persistent Storage Options with Kubernetes & Flocker

Volumes

Page 8: Persistent Storage Options with Kubernetes & Flocker

Kubernetes Volumes Support

• emptyDir

• hostPath • gcePersistentDisk • awsElasticBlockStore • nfs

• iscsi

• flocker • glusterfs • rbd

• gitRepo • secret • persistentVolumeClaim

Page 9: Persistent Storage Options with Kubernetes & Flocker

Kubernetes Volumes Support

• emptyDir• hostPath • gcePersistentDisk • awsElasticBlockStore• nfs

• iscsi

• flocker• glusterfs• rbd

• gitRepo• secret • persistentVolumeClaim

Page 10: Persistent Storage Options with Kubernetes & Flocker
Page 11: Persistent Storage Options with Kubernetes & Flocker

Volume type: emptyDir

• By default, emptyDir volumes are stored on whatever medium is backing the machine - that might be disk or SSD or network storage, depending on your environment.

• can use tmpfs (RAM-backed filesystem)

Page 12: Persistent Storage Options with Kubernetes & Flocker

Volume type: GCE PersistentDisk

• can be mounted as read-only by multiple consumers simultaneously.

• kubectl scale --replicas=100 replicationcontrollers read-app

• Cost is competitive at the moment

• up to 10TB

Page 13: Persistent Storage Options with Kubernetes & Flocker

Volume type: AWS Elastic Block Store

• the nodes on which pods are running must be AWS EC2 instances

• those instances need to be in the same region and availability-zone as the EBS volume

• EBS only supports a single EC2 instance mounting a volume at time

• You can mount multiple volumes to a EC2 instance

• EBS Snapshots are Global

Page 14: Persistent Storage Options with Kubernetes & Flocker

Volume type: AWS Elastic Block Store

Page 15: Persistent Storage Options with Kubernetes & Flocker

• You must have your own FS server running with the share exported (in NFS’s case) before you can use it

• great for sync and share use cases

• rich media streaming / archives

• beware of the network/cpu load

NFS / GlusterFS

Page 16: Persistent Storage Options with Kubernetes & Flocker

• Interesting

Volume type: gitRepo

Page 17: Persistent Storage Options with Kubernetes & Flocker

• Flocker is an open-source clustered container data volume manager. It provides management and orchestration of data volumes backed by a variety of storage backends.

Flocker

Page 18: Persistent Storage Options with Kubernetes & Flocker

Flocker supports even more backends

• ClusterHQ supported drivers:

• Amazon AWS / EBS Block Device

• OpenStack Block Device Backend

• GCE Persistent Disk (coming soon)

• Community supported drivers:

• ConvergeIO Block Device

• Dell SC Series Block Device

• EMC Block Device

• Hedvig Block Device

• Huawei Block Device

• NetApp Block Device

• NexentaEdge Block Device

• Saratoga Speed Block Device

• VMware Block Device

Page 19: Persistent Storage Options with Kubernetes & Flocker

Demo1. Create a Flocker Volume via flockercli2. Deploy pod and replication controller on a

minion using the flocker volume we created 3. Kill the Minion (terminate the host instance) 4. Watch Kubernetes reschedule restart the pod 5. Watch Flocker automatically remount our

Volume 6. Check and confirm the pod has our data

Page 20: Persistent Storage Options with Kubernetes & Flocker
Page 21: Persistent Storage Options with Kubernetes & Flocker

• 4 nodes running on CoreOS on Amazon EC2.

• 1 Node is running the Kube Pod Master, Kube API Service, Kube Proxy, Kube Scheduler, Kube Controller Manager and Flocker Control Service.

• The other 3 run Flocker agents, a Kubelet and Kube Proxy.

DEMO: Breakdown of services

Page 22: Persistent Storage Options with Kubernetes & Flocker

Flocker also works with• Kubernetes

• Apache Mesos / Marathon

• Docker Swarm

• Docker Daemon

• Amazon Elastic Container Service (soon)

Page 23: Persistent Storage Options with Kubernetes & Flocker
Page 24: Persistent Storage Options with Kubernetes & Flocker

Take-aways• Kubernetes supports many type of volumes, and

a Pod can use any number of them simultaneously.

• Flocker opens up options allowing you to use many more different storage providers

• Experiment!

Page 25: Persistent Storage Options with Kubernetes & Flocker

Links• docs on docs on docs

• Docker Docs https://docs.docker.com/engine/userguide/dockervolumes/

• Kubernetes Docs http://kubernetes.io/v1.1/docs/user-guide/volumes.html

• Flocker Docs https://docs.clusterhq.com/

• The Kubernetes Flocker demo you just saw

• https://clusterhq.com/2015/12/22/ha-demo-kubernetes-flocker/

Page 26: Persistent Storage Options with Kubernetes & Flocker

@stephenitis @clusterhq

hiring in San Francisco | Bay Area

Bristol UK remote

Q