I have tried to install Cassandra on my Kubernetes cluster. After executing the commands
kubectl apply -f Cassandra-service.yaml
and
kubectl apply -f cassandra-statefulset.yaml
I have no errors, but the three Cassandras pods are not setting up.
When I execute
kubectl get pods -o wide
the result is that a pod called Cassandra-0
is not ready. I expected that the Cassandra pods would be already set up.
This is my cassandra-statefulset.yaml
file: https://raw.githubusercontent.com/kubernetes/website/master/content/en/examples/application/cassandra/cassandra-statefulset.yaml
I expect there to be three Cassandra pods but there is only one in the pending state:
Here is the result of the previous command:
Maybe there are insufficient resources on minikube config so try to delete, reconfigure and start minikube, then deploy cassandra again.
Note: minikube delete will delete all the k8s cluster configured, be caferul.
minikube delete
minikube config set cpus 4
minikube config set memory 5120
minikube start
kubectl apply -f https://k8s.io/examples/application/cassandra/cassandra-service.yaml
kubectl apply -f https://k8s.io/examples/application/cassandra/cassandra-statefulset.yaml
Ref: https://kubernetes.io/docs/tutorials/stateful-application/cassandra/
What Kubernetes environment do you use? Do you use Minikube?
It seems that cluster cannot create PersistentVolumeClaim. Maybe StorageClass
configuration doesn't suit your cluster.
Also example Cassandra deployment contains:
resources:
limits:
cpu: "500m"
memory: 1Gi
requests:
cpu: "500m"
memory: 1Gi
So, your cluster should has free 1.5cpu and ~3Gb.
On my opinion, it's better and easier to configure Helm charts for infrastructure deployments, for example - https://github.com/bitnami/charts/tree/master/bitnami/cassandra