kubernetes - deploying statefulsets

10
Deploying StatefulSets in Kubernetes Janakiram MSV Analyst | Advisor | Architect Janakiram & Associates Google Developer Expert @janakiramm

Upload: janakiram-msv

Post on 21-Feb-2017

56 views

Category:

Technology


5 download

TRANSCRIPT

Page 1: Kubernetes - Deploying StatefulSets

Deploying StatefulSets in KubernetesJanakiram MSVAnalyst | Advisor | ArchitectJanakiram & AssociatesGoogle Developer Expert

@janakiramm

Page 2: Kubernetes - Deploying StatefulSets

Announcing The Kubernetes Webinar Series

● Monthly webinar focused on helping you get started with Kubernetes● Delivered by the experts from the container ecosystem● Each webinar introduces a concept to accelerate your learning● No specific prerequisites

○ Basic understanding of Docker will help

● All attendees will get $100 Google Cloud Platform Credits● The recording of this webinar will be available at Kube.live

Page 3: Kubernetes - Deploying StatefulSets

Objectives

● Overview of StatefulSets● Setting up the storage infrastructure for StatefulSet● Configuring MySQL Cluster in HA as a StatefulSet● Scaling the StatefulSet● Deploying WordPress as a ReplicaSet● Demos

Page 4: Kubernetes - Deploying StatefulSets

Persistence and Containers

● Containers are designed to be stateless● Containers use ephemeral storage● Pods can be made stateful through volumes● Running databases could be challenging

○ Lack of stable naming convention○ Lack of stable persistent storage per Pod

Page 5: Kubernetes - Deploying StatefulSets

Introducing StatefulSets

● Bringing the concept of ReplicaSets to stateful Pods● Enables running Pods in a “clustered mode”● Ideal for deploying highly available database workloads● Valuable for applications that need

○ Stable, unique network identifiers○ Stable, persistent storage○ Ordered, graceful deployment and scaling○ Ordered, graceful deletion and termination

● Currently in beta - Not available in versions < 1.5

Page 6: Kubernetes - Deploying StatefulSets

Kubernetes StatefulSets - Key Concepts

● Depend on a Headless Service for Pod to Pod communication● Each Pod gets a DNS name accessible to other Pods in the Set● Leverages Persistent Volumes and Persistent Volume Claims● Each Pod is suffixed with a predictable, consistent ordinal index

○ mysql-01, mysql-02

● Pods are created sequentially○ Ideal for setting up master / slave configuration

● The identity is consistent regardless of the Node it is scheduled on● Pods are terminated in LiFo order

Page 7: Kubernetes - Deploying StatefulSets

Demo Setup

● NFS storage backend● Persistent Volumes and Claims● 3 instances of etcd cluster with Node Affinity● 3 instances of Percona XtraDB Cluster● 5 instances of WordPress with Horizontal Pod Autoscaling

Detailed Walkthrough and source code is available at http://tinyurl.com/kubess

Page 8: Kubernetes - Deploying StatefulSets

DemoEnd-to-End Configuration of StatefulSet

Page 9: Kubernetes - Deploying StatefulSets

Upcoming WebinarUsing ConfigMaps and Secrets9AM PST, Tuesday, March. 28th

Many applications require configuration using some combination of configuration files, command line arguments, and environment variables. ConfigMaps in Kubernetes provide mechanisms to inject containers with configuration data while keeping them portable. Secrets decouple sensitive content from the pods using a volume plug-in. This webinar will discuss the use cases and scenarios for using ConfigMaps and Secrets.

Register at kube.live for the upcoming webinars

● Creating ConfigMaps for parameterized deployments● Using Secrets for securing sensitive information● Applying the concepts for a real-world deployment

Page 10: Kubernetes - Deploying StatefulSets

Thank You!Send your Feedback / Questions / Comments [email protected]