Deploying Scylla on a Kubernetes Cluster

This is a guide to deploy a Scylla Cluster Autoscaler in a Kubernetes environment. Please refer to the various deployment instructions to get Scylla Operator running and set up monitoring beforehand.

Prerequisites

  • A Kubernetes cluster (version >= 1.19)

  • Controller-gen (version >= 0.4.1)

Deployment

Recommender, Updater, Admission Controller

Following command deploys all 3 components of the autoscaler in the configured Kubernetes cluster in ~/.kube/config:

make deploy

Check if the components are up and running with:

kubectl -n scylla-operator-autoscaler-system get pods

The output should be something like this:

NAME                                                              READY   STATUS             RESTARTS   AGE
scylla-operator-autoscaler-admission-controller-7b4c7967ff4m9bs   1/1     Running            0          6m34s
scylla-operator-autoscaler-recommender-74bc4c995b-5q4kz           1/1     Running            0          6m34s
scylla-operator-autoscaler-updater-68898fd4c5-zpgcp               1/1     Running            0          6m34s

In case of running into problems check the logs of a particular component, for example:

kubectl -n scylla-operator-autoscaler-system logs -f scylla-operator-autoscaler-recommender-74bc4c995b-5q4kz

and look at events:

kubectl -n scylla-operator-autoscaler-system describe pod/scylla-operator-autoscaler-recommender-74bc4c995b-5q4kz

Scylla Cluster Autoscaler

Then create CRD by applying the yaml file describing SCA.

kubectl apply -f config/examples/generic/sca.yaml

Verify if it was created by:

kubectl get scyllaclusterautoscalers

The output should be something like this:

NAME         AGE
simple-sca   6m15s

You can look at the current description of the Scylla Cluster Autoscaler by entering:

kubectl describe scyllaclusterautoscalers simple-sca

or edit the spec with a following command:

kubectl edit scyllaclusterautoscalers simple-sca

Development

If you make some changes to the autoscaler and want to test it, you can do it locally by running:

make build

One caveat is that admission controller won’t be running properly this way as it is essentially a webhook.

Recommended way is to run it on a cluster with following commands:

make images
make push-images
make deploy

previously swapping the IMAGE_REPO variable in the Makefile for your own repository.

Clean Up

To clean up all resources associated with this walk-through, you can run the commands below.

kubectl delete namespace scylla-operator-autoscaler-system

Contributing

If you want to contribute to the Scylla Cluster Autoscaler make sure the code is formatted properly by running:

make verify

first and running:

make update-gofmt

if asked to. Then refer to our contributing guide for Scylla Operator.