The Cassandra database uses dynamically created persistent volumes to store data. For proper database functioning, Apigee requires you to configure a StorageClass definition that is backed by a solid-state drive (SSD).
If you do not currently have SSD configured for Cassandra, this topic explains how to create a new StorageClass that uses SSD and make it the default class. When Cassandra starts, it will use this default StorageClass.
Change the default StorageClass
The following steps explain how to create a StorageClass and make it the default class. For more information, see Change the default storage class in the Kubernetes documentation.
- Get the name of the current default StorageClass:
kubectl get sc
For example:
kubectl get sc
NAME PROVISIONER RECLAIMPOLICY VOLUMEBINDINGMODE ALLOWVOLUMEEXPANSION AGE premium-rwo pd.csi.storage.gke.io Delete WaitForFirstConsumer true 15h standard kubernetes.io/gce-pd Delete Immediate true 15h standard-rwo (default) pd.csi.storage.gke.io Delete WaitForFirstConsumer true 15h - Describe the StorageClass named
standard-rwo
. Note that its type ispd-balanced
:kubectl describe sc standard-rwo
For example:
kubectl describe sc standard-rwo
Name: standard-rwo IsDefaultClass: Yes Annotations: components.gke.io/layer=addon,storageclass.kubernetes.io/is-default-class=false Provisioner: pd.csi.storage.gke.io Parameters: type=pd-balanced AllowVolumeExpansion: True MountOptions: <none> ReclaimPolicy: Delete VolumeBindingMode: WaitForFirstConsumer Events: <none>
- Create a new file called
storageclass.yaml
. - Add this code to the file. Note that the name of the new class
is
apigee-sc
. You can use any name you like. Also, note that the storage type ispd-ssd
:--- kind: StorageClass apiVersion: storage.k8s.io/v1 metadata: name: "apigee-sc" provisioner: pd.csi.storage.gke.io parameters: type: pd-ssd replication-type: none volumeBindingMode: WaitForFirstConsumer allowVolumeExpansion: true
- Apply the new StorageClass to your Kubernetes cluster:
kubectl apply -f storageclass.yaml
- Execute the following two commands to change the default StorageClass:
kubectl patch storageclass standard-rwo \ -p '{"metadata": {"annotations":{"storageclass.kubernetes.io/is-default-class":"false"}}}'
kubectl patch storageclass apigee-sc \ -p '{"metadata": {"annotations":{"storageclass.kubernetes.io/is-default-class":"true"}}}'
- Execute this command to verify that the new default StorageClass is called
apigee-sc
:kubectl get sc
For example:
kubectl get sc
NAME PROVISIONER RECLAIMPOLICY VOLUMEBINDINGMODE ALLOWVOLUMEEXPANSION AGE apigee-sc (default) kubernetes.io/gce-pd Delete WaitForFirstConsumer true 14h premium-rwo pd.csi.storage.gke.io Delete WaitForFirstConsumer true 15h standard kubernetes.io/gce-pd Delete Immediate true 15h standard-rwo pd.csi.storage.gke.io Delete WaitForFirstConsumer true 15h