Yandex Cloud
Search
Discuss with expertTry it for free
  • Customer Stories
  • Documentation
  • Blog
  • All Services
  • System Status
  • Marketplace
    • Featured
    • Infrastructure & Network
    • Data Platform
    • AI for business
    • Security
    • DevOps tools
    • Serverless
    • Monitoring & Resources
  • All Solutions
    • By industry
    • By use case
    • Economics and Pricing
    • Security
    • Technical Support
    • Start testing with double trial credits
    • Cloud credits to scale your IT product
    • Gateway to Russia
    • Cloud for Startups
    • Center for Technologies and Society
    • Yandex Cloud Partner program
    • Price calculator
    • Pricing plans
  • Customer Stories
  • Documentation
  • Blog
© 2026 Direct Cursus Technology L.L.C.
Yandex Cloud Stackland
  • What's new
  • Installation
    • All tutorials
    • Installing Stackland on Yandex BareMetal
    • Installing Stackland on Yandex Cloud VMs
    • Setting up external access to a pod in a cluster
    • All guides
      • Troubleshooting a disk subsystem
      • Switching storage class of a component
    • Projects
    • Resource model
  • Access management
  • Pricing policy
  • Diagnostics and troubleshooting

In this article:

  • Getting started
  • Changing the default storage class
  • Changing the storage class for all components
  • Changing the storage class for an individual component
  • Changing the storage class for custom DB clusters
  • PostgreSQL
  • ClickHouse®
  • Apache Kafka®
  • Switching the storage class for system components
  • Logging (Loki)
  • Secrets Store (OpenBao)
  • DataLens
  • Changing the storage class for an existing data component
  1. Step-by-step guides
  2. Disk subsystem
  3. Switching storage class of a component

Switching a component to a different storage class

Written by
Yandex Cloud
Updated at June 24, 2026
View in Markdown
  • Getting started
  • Changing the default storage class
    • Changing the storage class for all components
    • Changing the storage class for an individual component
  • Changing the storage class for custom DB clusters
    • PostgreSQL
    • ClickHouse®
    • Apache Kafka®
  • Switching the storage class for system components
    • Logging (Loki)
    • Secrets Store (OpenBao)
    • DataLens
  • Changing the storage class for an existing data component

When deployed, Stackland assigns a default storage class, the one specified in StacklandClusterConfig.spec.storage.defaultStorageClass. This class is annotated with storageclass.kubernetes.io/is-default-class: "true" and used for all PVCs where the storage class is not explicitly specified.

For databases, the preferred choice is usually SSD or NVMe, and for object storage, HDD. If a component requires a storage class different from the one specified during installation, specify it explicitly in the component configuration.

Warning

Data is not transferred automatically when changing the storage class.

Changing the storage class results in PVC re-creation and data loss. Perform the operation before writing user data, ideally during initial deployment.

Getting startedGetting started

  1. Make sure the required storage class exists in the cluster:

    kubectl get storageclasses
    
  2. Make sure the nodes have disks of the appropriate type:

    kubectl get volumegroups -A -o wide
    

For more information about the available storage classes, see the Disk subsystem section.

Changing the default storage classChanging the default storage class

You can specify a default storage class for all or individual components.

Changing the storage class for all componentsChanging the storage class for all components

The default storage class is defined by the storageclass.kubernetes.io/is-default-class: "true" annotation of the StorageClass resource. You can move this annotation to another storage class. After this, all new PVCs that do not explicitly specify a storage class will use the new default class.

To change the default storage class:

  1. Remove the annotation from the current default class:

    kubectl annotate storageclass <current_class> storageclass.kubernetes.io/is-default-class-
    
  2. Set an annotation on the new class:

    kubectl annotate storageclass <new_class> storageclass.kubernetes.io/is-default-class=true
    

Warning

Changing the default class only affects new PVCs. Existing PVCs retain their previous storage class.

Changing the storage class for an individual componentChanging the storage class for an individual component

To change the storage class for a specific platform component, specify the appropriate field in the component configuration.

Managed databasesManaged databases

PostgreSQL, ClickHouse®, and Apache Kafka® do not require configuring the storage class at the component level. Clusters use the default storage class. To specify a storage class other than the default, specify it in the manifest when creating the cluster.

Object StorageObject Storage

apiVersion: stackland.yandex.cloud/v1alpha1
kind: StorageConfig
metadata:
  name: main
spec:
  enabled: false
  settings:
    storage:
      diskType: HDD
      servers: 3
      size: 154Gi
      storageClass: "stackland-hdd"

Changing the storage class for custom DB clustersChanging the storage class for custom DB clusters

Database clusters use the default storage class if the storageClass attribute is not specified in the cluster specification. To set a storage class for a specific cluster, specify it in the manifest when creating it.

You cannot change the storage class for already created PostgreSQL, ClickHouse®, and Apache Kafka® clusters.

PostgreSQLPostgreSQL

Specify the spec.storage.storageClass field in the PostgresqlCluster resource:

apiVersion: postgresql.stackland.yandex.cloud/v1alpha1
kind: PostgresqlCluster
metadata:
  name: <cluster_name>
spec:
  storage:
    size: 10Gi
    storageClass: "stackland-ssd"
  # ...

To learn more, see Creating a PostgreSQL cluster.

ClickHouse®ClickHouse®

Specify the spec.clickhouse.storage.storageClass and spec.keeper.storage.storageClass fields in the ClickhouseCluster resource:

apiVersion: clickhouse.stackland.yandex.cloud/v1alpha1
kind: ClickhouseCluster
metadata:
  name: <cluster_name>
spec:
  clickhouse:
    storage:
      size: 10Gi
      storageClass: "stackland-ssd"
    # ...
  keeper:
    storage:
      size: 5Gi
      storageClass: "stackland-ssd"

To learn more, see Creating a Managed Service for ClickHouse® cluster.

Apache Kafka®Apache Kafka®

Specify the spec.controller.storage.storageClass and spec.broker.storage.storageClass fields in the KafkaCluster resource:

apiVersion: kafka.stackland.yandex.cloud/v1alpha1
kind: KafkaCluster
metadata:
  name: <cluster_name>
spec:
  controller:
    storage:
      size: 5Gi
      storageClass: "stackland-ssd"
  broker:
    storage:
      size: 20Gi
      storageClass: "stackland-ssd"
  # ...

For more information on creating a cluster, see this section.

Switching the storage class for system componentsSwitching the storage class for system components

For system components, specify the storage class in the component's configuration file. If the component is already running, follow the procedure in the Changing the storage class for an existing data component section.

Logging (Loki)Logging (Loki)

Specify the spec.settings.logStorage.storage.storageClass field in the LoggingConfig resource:

apiVersion: stackland.yandex.cloud/v1alpha1
kind: LoggingConfig
metadata:
  name: main
spec:
  enabled: true
  settings:
    logStorage:
      storage:
        enabled: true
        storageClass: "stackland-hdd"
        size: 50Gi

Secrets Store (OpenBao)Secrets Store (OpenBao)

Specify the spec.settings.server.dataStorage.storageClass field in the SecretsStoreConfig resource:

apiVersion: stackland.yandex.cloud/v1alpha1
kind: SecretsStoreConfig
metadata:
  name: main
spec:
  enabled: true
  settings:
    server:
      dataStorage:
        size: 2Gi
        storageClass: "stackland-ssd"

DataLensDataLens

Specify the spec.settings.database.storageClass field in the DataLensConfig resource:

apiVersion: stackland.yandex.cloud/v1alpha1
kind: DataLensConfig
metadata:
  name: main
spec:
  enabled: true
  settings:
    database:
      storageSize: "2Gi"
      storageClass: "stackland-ssd"

Object StorageObject Storage

Specify the spec.settings.storage.storageClass field in the StorageConfig resource:

apiVersion: stackland.yandex.cloud/v1alpha1
kind: StorageConfig
metadata:
  name: main
spec:
  enabled: false
  settings:
    storage:
      diskType: HDD
      servers: 3
      size: 154Gi
      storageClass: "stackland-hdd"

Changing the storage class for an existing data componentChanging the storage class for an existing data component

Changing the storage class requires disabling and re-enabling the component.

Alert

This operation results in complete loss of data on the affected PVCs. Make sure you have a backup you can restore your data from.

To change the storage class for an already running component:

  1. Create a backup of your data.

  2. Disable the component. For system components, install spec.enabled: false and apply the manifest:

    kubectl apply -f <configuration_file>.yaml
    

    For custom DB clusters, delete the cluster resource:

    kubectl delete <resource_type> <cluster_name> -n <project_name>
    
  3. Delete the component PVCs:

    kubectl delete pvc <pvc_name> -n <namespace>
    

    To get a list of component PVCs:

    kubectl get pvc -n <namespace>
    
  4. In the manifest, specify the new storage class and re-enable the component (spec.enabled: true).

  5. Apply the manifest:

    kubectl apply -f <configuration_file>.yaml
    
  6. Restore data from the backup.

Was the article helpful?

Previous
Troubleshooting a disk subsystem
Next
Upgrading a cluster
© 2026 Direct Cursus Technology L.L.C.