Yandex Cloud
Search
Discuss with expertTry it for free
  • Customer Stories
  • Documentation
  • Blog
  • All Services
    • Cloud Interconnect
    • Cloud Backup
    • Cloud Registry
    • Yandex AI Studio
    • Compute Cloud
    • Object Storage
    • Managed Service for Kubernetes®
    • Yandex BareMetal
    • Smart Web Security
    • Security Deck
    • Managed Service for PostgreSQL
    • Managed Service for ClickHouse®
    • Monium
    • Cloud CDN
    • Network Load Balancer
    • Virtual Private Cloud
    • Cloud DNS
    • Application Load Balancer
    • Yandex Cloud Video
    • Stackland
    • Yandex Cloud Router
    • Yandex Managed Service for Trino
    • Managed Service for MySQL®
    • Managed Service for Valkey™
    • Managed Service for Apache Spark™
    • Yandex StoreDoc
    • Managed Service for OpenSearch
    • Managed Service for Apache Kafka®
    • Data Transfer
    • Yandex MPP Analytics Engine for PostgreSQL
    • Yandex Managed Service for Apache Airflow®
    • Data Processing
    • Yandex MetaData Hub
    • Managed Service for YDB
    • Managed Service for Sharded PostgreSQL
    • Managed Service for YTsaurus
    • Yandex WebSQL
    • DataLens
    • Yandex Search API
    • SpeechSense
    • SpeechKit
    • DataSphere
    • Vision OCR
    • Translate
    • Yandex Identity Hub
    • Key Management Service
    • Certificate Manager
    • Yandex Lockbox
    • Audit Trails
    • SmartCaptcha
    • Cloud Desktop
    • SourceCraft Code Assistant
    • Container Registry
    • Managed Service for GitLab
    • Managed Service for Prometheus®
    • Cloud Functions
    • API Gateway
    • Yandex Cloud Postbox
    • Message Queue
    • Serverless Integrations
    • IoT Core
    • Data Streams
    • Serverless Containers
    • Cloud Notification Service
    • Yandex Query
    • Identity and Access Management
    • Yandex Cloud Console
    • Resource Manager
    • Yandex Cloud Billing
    • Yandex Cloud Quota Manager
    • Cloud Apps
  • 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 Managed Service for Kubernetes
  • Comparing with other Yandex Cloud services
  • Getting started
    • All guides
    • Connecting to a node over SSH
    • Connecting to a node via OS Login
    • Updating Kubernetes
    • Configuring autoscaling
    • Activating a Kubernetes Terraform provider
    • Installing applications from Yandex Cloud Marketplace using Terraform
    • Working with private Docker image registries
      • Dynamic volume provisioning
      • Static volume provisioning
      • Managing storage classes
      • Encrypted disks for persistent volumes
      • Expanding a volume for pods
      • Mounting a volume in block mode
      • Integration with Object Storage
  • Access management
  • Pricing policy
  • Terraform reference
  • Monitoring metrics
  • Audit Trails events
  • Release notes

In this article:

  • Static volume provisioning
  • Dynamic volume provisioning
  • Useful links
  1. Step-by-step guides
  2. Working with persistent volumes
  3. Encrypted disks for persistent volumes

Using encrypted disks for persistent volumes

Written by
Yandex Cloud
Improved by
Sergei T.
Updated at July 17, 2026
View in Markdown
  • Static volume provisioning
  • Dynamic volume provisioning
    • Useful links

Managed Service for Kubernetes supports the use of Compute Cloud disks encrypted with custom Yandex Key Management Service symmetric keys for persistent volumes.

Note

To use encrypted disks, the cloud service account attached to your Managed Service for Kubernetes cluster must have the kms.keys.encrypterDecrypter role for the key or folder.

You can use encrypted disks for both static and dynamic provisioning of persistent volumes.

Static volume provisioningStatic volume provisioning

  1. Create a symmetric key in Key Management Service.

  2. Create an encrypted disk using the key you created.

    Save the disk ID for later use.

  3. Assign the kms.keys.encrypterDecrypter role for a key or folder to the cloud service account of the Managed Service for Kubernetes cluster.

  4. Provide a persistent volume. In the PersistentVolume manifest, specify the ID of the disk you created in the spec:csi:volumeHandle parameter.

Dynamic volume provisioningDynamic volume provisioning

  1. Create a symmetric key in Key Management Service.

    Save the key ID for later use.

  2. Assign the kms.keys.encrypterDecrypter role for a key or folder to the cloud service account of the Managed Service for Kubernetes cluster.

  3. Install kubectl and configure it to work with the new cluster.

  4. In the encrypted-storage-class.yaml file, create a manifest for the new storage class:

    kind: StorageClass
    apiVersion: storage.k8s.io/v1
    metadata:
      name: <storage_class_name>
    provisioner: disk-csi-driver.mks.ycloud.io
    volumeBindingMode: WaitForFirstConsumer
    parameters:
      type: <disk_type>
      csi.storage.k8s.io/fstype: ext4
      kmsKeyId: <symmetric_key_ID>
    allowVolumeExpansion: true
    reclaimPolicy: Delete
    

    Where:

    • metadata:name: Any storage class name.
    • parameters:type: Disk type in Compute Cloud. The possible values are:
      • network-ssd: Network SSD.
      • network-hdd: Network HDD.
      • network-ssd-nonreplicated: Non-replicated SSD.
      • network-ssd-io-m3: Ultra high-speed network storage with three replicas (SSD).
    • parameters:kmsKeyId: Symmetric key ID.
  5. Create a storage class:

    kubectl apply -f encrypted-storage-class.yaml
    
  6. In the encrypted-pvc.yaml file, create a manifest for the new PersistentVolumeClaim:

    apiVersion: v1
    kind: PersistentVolumeClaim
    metadata:
      name: <PVC_name>
    spec:
      accessModes:
        - ReadWriteOnce
      storageClassName: <storage_class_name>
      resources:
        requests:
          storage: 4Gi
    

    Where:

    • metadata:name: Any name for the PersistentVolumeClaim.
    • spec:storageClassName: Name of the storage class you created earlier.
  7. Create a PersistentVolumeClaim:

    kubectl apply -f encrypted-pvc.yaml
    
  8. In the pod-with-encrypted-pvc.yaml file, create a manifest for the pod with a dynamically provisioned persistent volume:

    apiVersion: v1
    kind: Pod
    metadata:
      name: <pod_name>
    spec:
      containers:
        - name: app
          image: ubuntu
          command: ["/bin/sh"]
          args: ["-c", "while true; do echo $(date -u) >> /data/out.txt; sleep 5; done"]
          volumeMounts:
            - name: persistent-storage
              mountPath: /data
      volumes:
        - name: persistent-storage
          persistentVolumeClaim:
            claimName: <PVC_name>
    

    Where:

    • metadata:name: Any name for the pod.
    • spec:volumes:persistentVolumeClaim:claimName: Name of the PersistentVolumeClaim you created earlier.
  9. Create a pod:

    kubectl apply -f pod-with-encrypted-pvc.yaml
    

    After you create the pod, a new encrypted disk with k8s-csi prefixed to its name will appear under Compute Cloud in Disks in the management console.

Useful linksUseful links

  • Volume
  • Encryption in Managed Service for Kubernetes
  • Encryption in Compute Cloud
  • Dynamic volume provisioning
  • Static volume provisioning
  • Managing storage classes

Was the article helpful?

Previous
Managing storage classes
Next
Expanding a volume for pods
© 2026 Direct Cursus Technology L.L.C.