persistent storage options with kubernetes & flocker

Post on 16-Apr-2017

3.539 Views

Category:

Technology

4 Downloads

Preview:

Click to see full reader

TRANSCRIPT

Persistent Storage with Kubernetes & Flocker

Stephen Nguyen

Evangelist@Stephenitis

-kubernetes experience few months

+ =

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

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

scheduled, and managed.

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

Volumes

Kubernetes Volumes Support

• emptyDir

• hostPath • gcePersistentDisk • awsElasticBlockStore • nfs

• iscsi

• flocker • glusterfs • rbd

• gitRepo • secret • persistentVolumeClaim

Kubernetes Volumes Support

• emptyDir• hostPath • gcePersistentDisk • awsElasticBlockStore• nfs

• iscsi

• flocker• glusterfs• rbd

• gitRepo• secret • persistentVolumeClaim

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)

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

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

Volume type: AWS Elastic Block Store

• 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

• Interesting

Volume type: gitRepo

• 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

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

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

• 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

Flocker also works with• Kubernetes

• Apache Mesos / Marathon

• Docker Swarm

• Docker Daemon

• Amazon Elastic Container Service (soon)

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!

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/

@stephenitis @clusterhq

hiring in San Francisco | Bay Area

Bristol UK remote

Q

top related