Cassandra and Kubernetes with K8ssandra

Image for post
Image for post

Cassandra is a kick-ass database. It’s reliable and works pretty well for insert heavy workloads. Cassandra does well with reads as well as long as you design your tables with your access patterns in mind. In order to work well with Cassandra, you need to avoid Tombstones either by avoiding deletes and updates or by avoiding collections. Cassandra cluster configuration and distribution can be tricky and also repairs can be a challenge at scale. K8ssandra is a complete Cassandra distribution with observability( Grafana and Prometheus) and a simple solution for repairs called Reaper. You also need to keep in mind that by using Cassandra in containers you will lose throughput. Let’s say you want to explore Cassandra and you are already using kubernetes or you have a tier 2 or 3 need or even want to save some cost in your development environment that could be an interesting solution. Today I will show how to install K8ssandra in Minikube.

Installing K8ssandra

You will need to have Minikube and helm installed on your machine. Helm is a package manager for kubernetes and works based on a template(similar to Terraform) makes it super easy to install the software in kubernetes.

Using The Services

So before we use the services we need to perform some port forward. For each command open a new terminal window or tab:

kubectl port-forward service/grafana-service 3000:3000

kubectl port-forward service/prometheus-operated 9090:9090

kubectl port-forward service/k8ssandra-dc1-all-pods-service 9049:9042

kubectl port-forward service/k8ssandra-dc1-all-pods-service 9049:9042

Traefik http://192.168.99.121:32090/dashboard/#/

Image for post
Image for post

Grafana http://localhost:3000/

Image for post
Image for post
Image for post
Image for post
Image for post
Image for post

Prometheus http://localhost:9090/

Image for post
Image for post
Image for post
Image for post

All scripts and configs are available at my github here. Have Fun.

Cheers,

Diego Pacheco

Originally published at http://diego-pacheco.blogspot.com on November 20, 2020.

Written by

Brazilian, Software Architect, SWE(Java, Scala, Rust, Go) SOA & DevOps expert, Author. Working with EKS/K8S. diegopacheco.github.io (Opinions on my own)

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store