Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Document manual procedure of storage resizing (2nd take) #2243

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions docs/source/resources/scyllaclusters/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,5 @@ clients/index
nodeoperations/index
multidc/index
exposing
storage-resizing
:::
99 changes: 99 additions & 0 deletions docs/source/resources/scyllaclusters/storage-resizing.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,99 @@
# Resizing storage in ScyllaCluster

Due to limitations of the underlying StatefulSet, ScyllaClusters don't allow storage changes. The following procedure describes how to adjust the storage manually.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One of the requirements is that StorageClass used supports resising. It should be mentioned here and explained how to verify that.


Let's use the following pods and StatefulSet in the resize examples below.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It should be generic enough to explain it needs to be done for every rack (StatefulSet) that requires changes.

```
kubectl get pods

NAME READY STATUS RESTARTS AGE
simple-cluster-us-east-1-us-east-1a-0 2/2 Running 0 12m
simple-cluster-us-east-1-us-east-1a-1 2/2 Running 0 11m
simple-cluster-us-east-1-us-east-1a-2 2/2 Running 0 9m27s

kubectl get statefulset

NAME READY AGE
simple-cluster-us-east-1-us-east-1a 3/3 12m
```


## Increasing the storage size

1. Orphan delete ScyllaCluster
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it's important to mention that existing scyllacluster spec needs to be saved somewhere and aligned to new storage requirements. Otherwise someone executing very first step of a procedure may loose the spec and find out later it's no longer available.

```
kubectl delete scyllacluster/simple-cluster --cascade='orphan'

scyllacluster.scylla.scylladb.com "simple-cluster" deleted
```
2. Orphan delete StatefulSet
```
kubectl delete statefulset --selector scylla/cluster=simple-cluster --cascade='orphan'

statefulset.apps "simple-cluster-us-east-1-us-east-1a" deleted
```
3. Change storage request in PVCs.
```
kubectl patch pvc/data-simple-cluster-us-east-1-us-east-1a-0 -p '{"spec":{"resources":{"requests":{"storage":"3Gi"}}}}'

persistentvolumeclaim/data-simple-cluster-us-east-1-us-east-1a-0 patched
```
```
kubectl patch pvc/data-simple-cluster-us-east-1-us-east-1a-1 -p '{"spec":{"resources":{"requests":{"storage":"3Gi"}}}}'

persistentvolumeclaim/data-simple-cluster-us-east-1-us-east-1a-1 patched
```
```
kubectl patch pvc/data-simple-cluster-us-east-1-us-east-1a-2 -p '{"spec":{"resources":{"requests":{"storage":"3Gi"}}}}'

persistentvolumeclaim/data-simple-cluster-us-east-1-us-east-1a-2 patched
```

If the PVC change is denied because the PVC doesn't support volume expansion
```
kubectl patch pvc/data-simple-cluster-us-east-1-us-east-1a-0 -p '{"spec":{"resources":{"requests":{"storage":"3Gi"}}}}'

Error from server (Forbidden): persistentvolumeclaims "data-simple-cluster-us-east-1-us-east-1a-0" is forbidden: only dynamically provisioned pvc can be resized and the storageclass that provisions the pvc must support resize
```
then continue to step 4.

4. Apply updated ScyllaCluster definition with the new storage size in the `spec.datacenter.racks[0].storage.capacity` field:
```
kubectl apply -f clusterDefinition.yaml --server-side=true
```
or, you use Helm to manage your ScyllaCluster, edit your values YAML with the cluster definition and its `racks[0].storage.capacity` field and apply the change with:
```
helm upgrade simple-cluster scylla/scylla --values values.cluster.yaml
```
The StatefulSet will be recreated by the Scylla Operator with the new storage size.

5. (Only if PVC does not support volume expansion) You need to replace every Scylla node, one by one, following the procedure described in [replacing nodes](/resources/scyllaclusters/nodeoperations/replace-node). Start with the last node in the StatefulSet and move towards the first node. This will recreate each node and their PVCs with the new size.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There should be separate procedure for those StorageClasses, not embedded in this one.



## Decreasing the storage size

1. Orphan delete ScyllaCluster
```
kubectl delete scyllacluster/simple-cluster --cascade='orphan'

scyllacluster.scylla.scylladb.com "simple-cluster" deleted
```

2. Orphan delete Statefulset
```
kubectl delete statefulset --selector scylla/cluster=simple-cluster --cascade='orphan'

statefulset.apps "simple-cluster-us-east-1-us-east-1a" deleted
```

3. Apply updated ScyllaCluster definition with the new storage size in the `spec.datacenter.racks[0].storage.capacity` field.
```
kubectl apply -f clusterDefinition.yaml --server-side=true
```
or, if you use Helm to manage your ScyllaCluster, edit your values YAML with the cluster definition and its `racks[0].storage.capacity` field and apply the change with:
```
helm upgrade simple-cluster scylla/scylla --values values.cluster.yaml
```
The StatefulSet will be recreated by the Scylla Operator with the new storage size, but the actual change will NOT be automatically applied.

4. You need to replace every Scylla node, one by one, following the procedure described in [replacing nodes](/resources/scyllaclusters/nodeoperations/replace-node). Start with the last node in the StatefulSet and move towards the first node. This will recreate each node and their PVCs with the new size.