Skip to content

Setting Up Cassandra

Aleks Volochnev edited this page Mar 10, 2021 · 21 revisions

1. Setting Up Cassandra

First things first. Helm is kind of like a high-powered package manager for Kubernetes. In order to use the packages for today's workshop, we will need to first add the correct repositories for helm to use.

We will pull recipies from https://helm.k8ssandra.io/ where you can find all the documentation.

✅ Step 1: Add the repository to Helm

helm repo add k8ssandra https://helm.k8ssandra.io/stable
Click to show output 📃
ec2-user@ip-172-31-5-5:~/kubernetes-workshop> helm repo add k8ssandra https://helm.k8ssandra.io/stable
"k8ssandra" has been added to your repositories      

✅ Step 2: Update helm

helm repo update
Click to show output 📃
ec2-user@ip-172-31-5-5:~/kubernetes-workshop> helm repo update
Hang tight while we grab the latest from your chart repositories...                                                                                              
...Successfully got an update from the "k8ssandra" chart repository                                                                                              
Update Complete. ⎈Happy Helming!

✅ Step 3: Add the repository to Traefik(leveraging Ingress)

In Kubernetes, network ports and services are most often handled by an Ingress controller. For today's lab, the K8ssandra side of things will be using Traefik. Let's install that now.

helm repo add traefik https://helm.traefik.io/traefik
Click to show output 📃
ec2-user@ip-172-31-5-5:~/kubernetes-workshop> helm repo add traefik https://helm.traefik.io/traefik
"traefik" has been added to your repositories  

✅ Step 4: Update Helm as before

helm repo update
Click to show output 📃
ec2-user@ip-172-31-5-5:~/kubernetes-workshop> helm repo update
Hang tight while we grab the latest from your chart repositories...                                                                                              
...Successfully got an update from the "k8ssandra" chart repository                                                                                              
...Successfully got an update from the "traefik" chart repository                                                                                                
Update Complete. ⎈Happy Helming!⎈                                                                                                                                
ec2-user@ip-172-31-5-5:

✅ Step 5: Install traefik with following configuration traefik.yaml

helm install traefik traefik/traefik -f traefik.yaml
Click to show output 📃
ec2-user@ip-172-31-5-5:~/kubernetes-workshop> helm install traefik traefik/traefik -f traefik.yaml
NAME: traefik                                                                                                                                                    
LAST DEPLOYED: Tue Nov 17 15:00:53 2020                                                                                                                          
NAMESPACE: default                                                                                                                                               
STATUS: deployed                                                                                                                                                 
REVISION: 1                                                                                                                                                      
TEST SUITE: None    

Check installation with watch kubectl get pods. When the pod is ready and running, open the traefik dashboard using URL http://<YOURADDRESS>:9000/dashboard/.

image

✅ Step 6: Use Helm to Install K8ssandra

Let's install our Cassandra by running a helm install of K8ssandra. We will install k8ssandra, using the configuration file. Notice there are three places to be adjusted with your environment.

Edit the file accordingly! (Replace <YOURADDRESS> with the URL you are using). After that, install k8ssandra:

helm install -f k8ssandra.yaml k8ssandra k8ssandra/k8ssandra
Click to show output 📃
ec2-user@ip-172-31-5-5:~/kubernetes-workshop> helm install -f k8ssandra.yaml k8ssandra k8ssandra/k8ssandra
NAME: k8ssandra
LAST DEPLOYED: Tue Mar  2 20:56:12 2021
NAMESPACE: default
STATUS: deployed
REVISION: 1

Verify everything is up running. We need to wait till everything has running or completed status before moving on. It may need up to 3 minutes

watch kubectl get pods
Click to show output 📃
Every 2.0s: kubectl get pods
NAME                                                READY   STATUS     RESTARTS   AGE                                                                   
k8ssandra-cass-operator-7d5df6d49-kx7gk             1/1     Running    0          83s
k8ssandra-dc1-default-sts-0                         0/2     Pending    0          65s
k8ssandra-dc1-stargate-644f7fd75b-t6dht             0/1     Init:0/1   0          83s
k8ssandra-grafana-5c6d5b8f5f-dzfv7                  2/2     Running    0          83s
k8ssandra-kube-prometheus-operator-85695ffb-vvhmr   1/1     Running    0          83s
k8ssandra-reaper-operator-79fd5b4655-p8jc9          1/1     Running    0          83s
prometheus-k8ssandra-kube-prometheus-prometheus-0   2/2     Running    1          77s
traefik-746ff9cc4c-tpc56                            1/1     Running    0          72m   

To exit watch use Ctrl + C

From this command, we will be able to see the pods as they come online. Notice the steps as they complete.

Verifying Installation

kubectl get cassandradatacenters

kubectl describe CassandraDataCenter dc1

Next Step

Proceed to the Step II