kubernetes - deploying statefulsets

Post on 21-Feb-2017

56 Views

Category:

Technology

5 Downloads

Preview:

Click to see full reader

TRANSCRIPT

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

@janakiramm

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

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

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

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

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

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

DemoEnd-to-End Configuration of StatefulSet

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

Thank You!Send your Feedback / Questions / Comments jani@janakiram.com

top related