Updating volumes in YTsaurus services

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

Important considerations

When working with volume updates in YTsaurus services, keep in mind the following:

  1. Updating volume settings does not trigger any updates by the operator. The operator does not automatically detect or apply changes to volume configurations.

  2. Persistent Volume Claims (PVCs) remain 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

This procedure will result in data loss for recreted volumes, use it with caution.

Update procedure

To successfully update volume settings, follow these 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 to 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>

You may need to delete multiple PVCs if your StatefulSet has multiple replicas. List all PVCs to identify which ones need to be deleted:

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, if you want to increase the log volume size from 10Gi to 50Gi for schedulers.

  1. Update your YTsaurus resource specification to increase the log volume size:
spec:
  schedulers:
    volumeClaimTemplates:
      - spec:
          resources:
            requests:
              storage: 50Gi  # increased from 10Gi
  1. Follow the update procedure described above (set isManaged: false, delete StatefulSet, delete PVCs, set isManaged: true).

Warning

After this procedure, current logs will be 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 proceeding with the update.