Updating volumes in YTsaurus services

This guide describes how to update volume settings for YTsaurus services running in Kubernetes.

Important considerations

When updating volumes, keep in mind the following:

  1. The operator does not automatically apply updates. It does not monitor changes in the configuration of volumes, so modifying the resource specification will not automatically initiate an update.

  2. Persistent Volume Claims (PVCs) are attached to pods. Even if you delete the pods or the StatefulSet, the PVCs will remain attached and prevent the new volume settings from being applied.

Warning

The procedure described below will result in data loss for updated volumes, because they will be recreated. Proceed with caution.

Update procedure

To update volume settings, follow the steps:

Step 1. Disable the operator

Set the isManaged field to false in your YTsaurus resource specification. This disables the operator and prevents it from interfering with manual changes.

spec:
  isManaged: false

Apply this change in your cluster.

Step 2. Delete the StatefulSet

Delete the StatefulSet for the service whose volumes you want to update:

kubectl delete statefulset <statefulset-name> -n <namespace>

Step 3. Delete the Persistent Volume Claims

Delete the PVCs associated with the pods:

kubectl delete pvc <pvc-name> -n <namespace>

If your StatefulSet has multiple replicas, delete PVCs for each of them. To find the PVCs, run the following command:

kubectl get pvc -n <namespace>

Step 4. Re-enable the operator

Set the isManaged field back to true in your YTsaurus resource specification:

spec:
  isManaged: true

Apply this change. The operator will now recreate the StatefulSet and PVCs with the new volume settings.

Example: increasing disk space for scheduler logs

A common use case for updating volumes is to increase disk space for logs. For example, you need to increase disk space for scheduler logs from 10 GiB to 50 GiB.

  1. Specify the new volume size in your YTsaurus resource specification:
spec:
  schedulers:
    volumeClaimTemplates:
      - spec:
          resources:
            requests:
              storage: 50Gi  # increased from 10Gi
  1. Follow the update procedure described above: set isManaged: false, delete the StatefulSet and PVCs, and then set isManaged: true.

Warning

As a result, current logs are lost, because the old PVCs are deleted and new ones are created. If you need to preserve logs, make sure to back them up before initiating an update.