a helmsman meets a daughter of troy - the introduction of kubernetes and cassandra
TRANSCRIPT
A Helmsman meets a
Daughter of TroyThe introduction of Kubernetes and
Cassandra
Chris Love
@chrislovecnm
The Helmsman
• κυβερνήτης
• kubernetes
• pronounced koo-ber-nay'-
tace
• helmsman, pilot, steersman,
helmsman, ship master
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
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
Sea of Containers
Apache Cassandra - C*
• Big Data Database
• Fault tolerant,
decentralized, and durable
• Supports multiple
datacenter replication
• Easily scale horizontally
and vertically
• Backed by Datastax
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
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
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
–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
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
Cassandra on
Kubernetes
• Supported example from Kubernetes team
• Custom Docker Image
• Required Cassandra Service
• Replication Controller Example
• DaemonSet Example
Let’s Look At Some Code
Cassandra Pod
YAML
(truncated)
https://raw.githubusercontent.com/ku
bernetes/kubernetes/release-
1.2/examples/cassandra/cassandra.y
aml
Cassandra Service YAMLhttps://raw.githubusercontent.com/kubernetes/kubernetes/release-
1.2/examples/cassandra/cassandra-service.yaml
Cassandra RC
YAML
(truncated)
https://raw.githubusercontent.com/k
ubernetes/kubernetes/release-
1.2/examples/cassandra/cassandra-
controller.yaml
tl;dr;
Cassandra
DaemonSet YAML
(truncated)
https://raw.githubusercontent.com/
kubernetes/kubernetes/release-
1.2/examples/cassandra/cassandr
a-daemonset.yaml
tl;dr;
Kubernetes Complexities
• Custom SeedProvider
• Virtual Nodes
• Node Recovery
• Lifestyle PreStop
Hooks
• Multiple Data Centers
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.
PetSet Features
• Scaling and
Autoscaling
• Stable Network Identity
• No duplicate Identities
• Parameterized
Variables
Example PetSet YAML
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