In Apache Cassandra Lunch #41: Apache Cassandra Lunch #41: Cassandra on Kubernetes - Docker/Kubernetes/Helm Part 1, we discuss Cassandra on Kubernetes and give an introduction to Docker, Kubernetes, and Helm.
Accompanying Blog: https://blog.anant.us/apache-cassandra-lunch-41-cassandra-on-kubernetes-docker-kubernetes-helm-part-1/
Accompanying YouTube: https://youtu.be/-I8cKQO_Qr0
Sign Up For Our Newsletter: http://eepurl.com/grdMkn
Join Cassandra Lunch Weekly at 12 PM EST Every Wednesday: https://www.meetup.com/Cassandra-DataStax-DC/events/
Cassandra.Link:
https://cassandra.link/
Follow Us and Reach Us At:
Anant:
https://www.anant.us/
Awesome Cassandra:
https://github.com/Anant/awesome-cassandra
Cassandra.Lunch:
https://github.com/Anant/Cassandra.Lunch
Email:
solutions@anant.us
LinkedIn:
https://www.linkedin.com/company/anant/
Twitter:
https://twitter.com/anantcorp
Eventbrite:
https://www.eventbrite.com/o/anant-1072927283
Facebook:
https://www.facebook.com/AnantCorp/
2. Containers : “Get with the program”
● Docker - One “Dockerfile” becomes an Image which runs as one container on a node / host.
● Docker-Compose - Can run multiple containers on a node / host in as a composition. (Kompose)
● Docker Swarm - Can run docker-compose at scale on many node / hosts.
● Mesosphere/DCOS - Mesos, grand daddy of containerization adopted Docker, and Kubernetes
● Kubernetes - Basically everyone who does anything uses Kubernetes to deploy big applications.
7. Kubernetes General Architecture
Nodes (minimum of 3 physical nodes)
■ Master Nodes / Control Plane (at least 1)
● A master node is a node which controls and
manages a set of worker nodes (workloads
runtime) and resembles a cluster in Kubernetes. ...
All external communication to the cluster is via the
API-Server. Kube-Controller-Manager, which runs a
set of controllers for the running cluster.
● Whenever master node under kubernetes fails, the
cluster still remains in an operational mode. It
doesn't affect pod creation or service member
changes. If worker node fails, master stops
receiving updates from worker node
● High availability / multi-master nodes use a load
balancer to manage the API server which serves
both the clients and the worker nodes
8. Kubernetes General Architecture
Worker Nodes (at least 2)
● The worker nodes run the workloads. The worker node
contains kubelet and kube-proxy that both connects to the
pods within the docker. ... A kubelet takes information
from the master node and ensures that any pods assigned
to it are running and configured in the desired state. All
Kubernetes nodes must have a kubelet.
10. Kubernetes General Architecture
Pods
■ Pods are the smallest, most basic deployable objects in
Kubernetes. A Pod represents a single instance of a
running process in your cluster. Pods contain one or more
containers, such as Docker containers. When a Pod runs
multiple containers, the containers are managed as a
single entity and share the Pod's resources.
11. Kubernetes General Architecture
Workloads
■ Deployments / ReplicaSet (Stateless)
● Node Express
● Python Flask
● Java Springboot
■ StatefulSets (State)
● MySQL
● Cassandra
● Leverages “PersistentVolume” that is managed as a resource.
■ DaemonSet
● “Sidecar” local to that node
● Monitoring / Management
■ Job / CronJob
● Tasks that run and stop.
● Job - one-off tasks
● CronJob - recurring tasks
12. Helm Charts
○ Components
■ The client (CLI), which lives on your local
workstation.
■ The server (Tiller), which lives on the Kubernetes
cluster to execute what’s needed.
○ Concepts
■ Chart: A package of pre-configured Kubernetes
resources.
■ Release: A specific instance of a chart which has
been deployed to the cluster using Helm.
■ Repository: A group of published charts which can
be made available to others.
○ Why?
■ Boosts productivity
■ Reduces duplication & complexity
■ Smoothens the learning curve
■ Simplifies deployments
14. Helm Charts
Operators
○ The Operator pattern aims to capture the key aim of a human operator who is managing a service or set of services.
Human operators who look after specific applications and services have deep knowledge of how the system ought to
behave, how to deploy it, and how to react if there are problems.
○ Tasks
■ deploying an application on demand
■ taking and restoring backups of that application's state
■ handling upgrades of the application code alongside related changes such as database schemas or extra
configuration settings
■ publishing a Service to applications that don't support Kubernetes APIs to discover them
■ simulating failure in all or part of your cluster to test its resilience
■ choosing a leader for a distributed application without an internal member election process
○ Why?
■ Robots are better at doing repetitive tasks
■ Simplifies the overall complexity of an operation into a few configurable components
■ Makes pattern reuse possible
15. Helm Charts
○ How to make Operators? (via Operator SDK)
■ Helm
■ Go
■ Java
■ Ansible