Cassandra and Kubernetes with K8ssandra
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.
#!/bin/bash
#
# Minukube setup
#
minikube start --memory=8192 --cpus=8 -p k8ssandra
#
# k8ssandra
#
helm repo add k8ssandra https://helm.k8ssandra.io/
helm repo add traefik https://helm.traefik.io/traefik
helm repo update
helm install k8ssandra-tools k8ssandra/k8ssandra
helm install k8ssandra-cluster-a k8ssandra/k8ssandra-cluster
#
# Traefik
#
helm repo add traefik https://helm.traefik.io/traefik
helm repo update
helm install traefik traefik/traefik -n traefik --create-namespace -f traefik.values.yaml
minikube service traefik -n traefik --url -p k8ssandra
xdg-open "http://192.168.99.121:32090/dashboard/#/"
#
# Grafana / Prometheus
#
helm upgrade k8ssandra-cluster-a k8ssandra/k8ssandra-cluster --set ingress.traefik.enabled=true --set ingress.traefik.monitoring.grafana.host=grafana.localhost --set ingress.traefik.monitoring.prometheus.host=prometheus.localhost
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
Traefik http://192.168.99.121:32090/dashboard/#/
Grafana http://localhost:3000/
Prometheus http://localhost:9090/
Cqlsh
All scripts and configs are available at my github here. Have Fun.
Cheers,
Diego Pacheco