A Helmsman meets a Daughter of Troy - The introduction of Kubernetes and Cassandra

28
A Helmsman meets a Daughter of Troy The introduction of Kubernetes and Cassandra Chris Love @chrislovecnm

Transcript of A Helmsman meets a Daughter of Troy - The introduction of Kubernetes and Cassandra

Page 1: A Helmsman meets a Daughter of Troy - The introduction of Kubernetes and Cassandra

A Helmsman meets a

Daughter of TroyThe introduction of Kubernetes and

Cassandra

Chris Love

@chrislovecnm

Page 2: A Helmsman meets a Daughter of Troy - The introduction of Kubernetes and Cassandra

The Helmsman

• κυβερνήτης

• kubernetes

• pronounced koo-ber-nay'-

tace

• helmsman, pilot, steersman,

helmsman, ship master

Page 3: A Helmsman meets a Daughter of Troy - The introduction of Kubernetes and Cassandra

The Daughter of Troy

• Κασσάνδρα

• Cassandra

• pronounced kassándraa

• The daughter of King of Priam

and Queen Hecuba of Troy

• Trying to seduce her, Apollo

gave Cassandra the power of

prophecy, but she refused him.

Apollo then cursed her so that

nobody would believe her

prophecies

Page 4: A Helmsman meets a Daughter of Troy - The introduction of Kubernetes and Cassandra

Kubernetes ~ K8s

• Automates deployment, scaling,

and operation of containers

• Utilizes a clusters of hosts,

providing container-centric

infrastructure

• Provides High Availability,

Scalability, and Self Healings

• 76% reduction in virtualization

costs for some use cases have

been proven

• Backed by Google

Page 5: A Helmsman meets a Daughter of Troy - The introduction of Kubernetes and Cassandra

Sea of Containers

Page 6: A Helmsman meets a Daughter of Troy - The introduction of Kubernetes and Cassandra
Page 7: A Helmsman meets a Daughter of Troy - The introduction of Kubernetes and Cassandra
Page 8: A Helmsman meets a Daughter of Troy - The introduction of Kubernetes and Cassandra

Apache Cassandra - C*

• Big Data Database

• Fault tolerant,

decentralized, and durable

• Supports multiple

datacenter replication

• Easily scale horizontally

and vertically

• Backed by Datastax

Page 9: A Helmsman meets a Daughter of Troy - The introduction of Kubernetes and Cassandra
Page 10: A Helmsman meets a Daughter of Troy - The introduction of Kubernetes and Cassandra

Cassandra Overview

Developer Friendly

• CQL - SQL like query

language

• Drivers in multiple languages

• Native Paging

DevOps Friendly

• No single point of failure

• Simple design

• Incremental Scaling

Page 11: A Helmsman meets a Daughter of Troy - The introduction of Kubernetes and Cassandra

Cassandra Use Cases

• Time Series Data - IoT, User Actions

• High Velocity Data - Log Files

• Availability and Partitioning focus from Brewer’s Theorem - CAP

• Transactional web and mobile applications

• Financial Applications

• MDM: Customer 360, Product Catalog

• Personalization and Recommendation

• Fraud Detection

• Inventory Management

Page 12: A Helmsman meets a Daughter of Troy - The introduction of Kubernetes and Cassandra

Prod RecommendationsCPU

• 4 to 8 CPU’s in virtualized environment - Insert heavy workloads

will cause C* to quickly become CPU bound

RAM

• 16 to 64 GB for system and 8 to 30 GB allocated to JVM Heap

• Shut off swap

JVM

• Use Java 8 Oracle or OpenJVM

• Don’t allocate too much ram to the HEAP - often 8-16 GB is

enough

Page 13: A Helmsman meets a Daughter of Troy - The introduction of Kubernetes and Cassandra

–Patrick McFadin Chief Evangelist for Apache Cassandra at

DataStax

@PatrickMcFadin

“A simple storage test: run a simultaneous read

and write load. All sequential. If the disk can

handle it, you are good to go.”

“The single biggest predictor of success or failure

with a Cassandra deployment is in the choice of

storage.”

All about the Disk

Page 14: A Helmsman meets a Daughter of Troy - The introduction of Kubernetes and Cassandra

USE Solid

State

Don’t Use SAN

Don’t Use NAS

Don’t Use IDE

Don’t Use EBS Magnetic

OMG Don’t Use NFS

Page 15: A Helmsman meets a Daughter of Troy - The introduction of Kubernetes and Cassandra

Cassandra on

Kubernetes

• Supported example from Kubernetes team

• Custom Docker Image

• Required Cassandra Service

• Replication Controller Example

• DaemonSet Example

Page 16: A Helmsman meets a Daughter of Troy - The introduction of Kubernetes and Cassandra

Let’s Look At Some Code

Page 17: A Helmsman meets a Daughter of Troy - The introduction of Kubernetes and Cassandra

Cassandra Pod

YAML

(truncated)

https://raw.githubusercontent.com/ku

bernetes/kubernetes/release-

1.2/examples/cassandra/cassandra.y

aml

Page 18: A Helmsman meets a Daughter of Troy - The introduction of Kubernetes and Cassandra

Cassandra Service YAMLhttps://raw.githubusercontent.com/kubernetes/kubernetes/release-

1.2/examples/cassandra/cassandra-service.yaml

Page 19: A Helmsman meets a Daughter of Troy - The introduction of Kubernetes and Cassandra

Cassandra RC

YAML

(truncated)

https://raw.githubusercontent.com/k

ubernetes/kubernetes/release-

1.2/examples/cassandra/cassandra-

controller.yaml

Page 20: A Helmsman meets a Daughter of Troy - The introduction of Kubernetes and Cassandra

tl;dr;

Page 21: A Helmsman meets a Daughter of Troy - The introduction of Kubernetes and Cassandra

Cassandra

DaemonSet YAML

(truncated)

https://raw.githubusercontent.com/

kubernetes/kubernetes/release-

1.2/examples/cassandra/cassandr

a-daemonset.yaml

Page 22: A Helmsman meets a Daughter of Troy - The introduction of Kubernetes and Cassandra

tl;dr;

Page 23: A Helmsman meets a Daughter of Troy - The introduction of Kubernetes and Cassandra

Kubernetes Complexities

• Custom SeedProvider

• Virtual Nodes

• Node Recovery

• Lifestyle PreStop

Hooks

• Multiple Data Centers

Page 24: A Helmsman meets a Daughter of Troy - The introduction of Kubernetes and Cassandra

Kubernetes 1.3 ~ PetSet

A relevant analogy is that a

PetSet is composed of pets, but

the pets are like dogs. If you have

a brown, black, and white dog,

and the brown dog dies, you

replace it with another brown dog

and no one would notice. If you

suddenly have three white dogs,

someone will notice.

The PetSet is responsible for creating and maintaining a set of

identities and ensuring that there is one pod and zero or more

supporting resources for each identity.

Page 25: A Helmsman meets a Daughter of Troy - The introduction of Kubernetes and Cassandra

PetSet Features

• Scaling and

Autoscaling

• Stable Network Identity

• No duplicate Identities

• Parameterized

Variables

Page 26: A Helmsman meets a Daughter of Troy - The introduction of Kubernetes and Cassandra

Example PetSet YAML

Page 27: A Helmsman meets a Daughter of Troy - The introduction of Kubernetes and Cassandra
Page 28: A Helmsman meets a Daughter of Troy - The introduction of Kubernetes and Cassandra

Resources

• http://kubernetes.io/

• http://cassandra.apache.org/

• https://github.com/kubernetes/kubernetes/tree/release-

1.2/examples/cassandra

• http://docs.datastax.com/en/cassandra/3.0/cassandra/planning/planPlanni

ngHardware.html

• http://www.liquidweb.com/kb/recommended-production-settings-for-

cassandra-on-centos-6/

• https://github.com/smarterclayton/kubernetes/blob/petset/docs/proposals/p

etset.md