Storage Configuration
This guide explains how to configure persistent storage in Krutrim Kubernetes Service (KKS) using Kubernetes-native storage resources and the KKS-managed Container Storage Interface (CSI) integration.
The underlying storage implementation is managed by KKS. Applications interact with standard Kubernetes objects and do not need infrastructure credentials, backend resource identifiers, or implementation-specific configuration.
Kubernetes storage concepts
Resource
Purpose
Volume
Makes storage available to containers in a Pod. The lifetime and behavior depend on the volume type.
PersistentVolume (PV)
A cluster-scoped storage resource with capacity, access modes, and a reclaim policy.
PersistentVolumeClaim (PVC)
A namespaced request for persistent storage made by an application.
StorageClass
Defines how Kubernetes dynamically provisions storage and manages properties such as reclaim policy, binding mode, and expansion.
VolumeSnapshot
Represents a point-in-time snapshot of a PVC when snapshot support is enabled.
For most applications, you create a PVC and reference it from a Pod, Deployment, or StatefulSet. KKS and Kubernetes manage the corresponding PV and storage lifecycle.
flowchart LR
A[Workload] --> B[PersistentVolumeClaim]
B --> C[StorageClass]
C --> D[Managed persistent volume]Managed CSI storage add-on
The KKS-managed CSI storage add-on enables dynamic volume provisioning. When the add-on is active, KKS provides one or more supported StorageClasses and can designate a default StorageClass.
Without a dynamic provisioner, Kubernetes can still use administrator-created PVs, but PVCs are not automatically backed by new managed storage. This guide focuses on dynamic provisioning through the KKS-managed add-on.
Before you begin
Confirm that:
Your KKS cluster is running.
kubectlis configured for the cluster.The managed CSI storage add-on is active.
Your account has sufficient storage quota.
Your workload requirements match a supported access mode and volume size.
Verify storage availability
List the available StorageClasses:
The default class is marked with (default). Inspect its behavior:
Check these fields before creating production claims:
Field
Meaning
ReclaimPolicy
Determines whether dynamically provisioned storage is deleted or retained after its claim is released.
VolumeBindingMode
Determines whether provisioning occurs immediately or waits for a consuming Pod.
AllowVolumeExpansion
Indicates whether PVCs using the class can request a larger capacity.
You can also verify that CSI drivers are registered:
KKS manages the provisioner and its parameters. Do not create a custom StorageClass or copy provisioner-specific parameters unless they are explicitly documented and supported by KKS.
Create a PersistentVolumeClaim
Create a file named pvc.yaml:
Because storageClassName is omitted, Kubernetes uses the default StorageClass. To select another KKS-supported class, set spec.storageClassName to its exact name from kubectl get storageclass.
Apply the claim:
Watch its status:
The PVC is ready when its status becomes Bound.
If the selected StorageClass uses WaitForFirstConsumer, the PVC can remain Pending until a Pod references it. This is expected because Kubernetes waits for scheduling information before provisioning the volume.
Inspect details and events:
Access modes
The selected storage system determines which access modes are available.
Mode
Abbreviation
Behavior
ReadWriteOnce
RWO
The volume can be mounted read-write by one node. Multiple Pods on that same node may still access it.
ReadOnlyMany
ROX
The volume can be mounted read-only by multiple nodes.
ReadWriteMany
RWX
The volume can be mounted read-write by multiple nodes.
ReadWriteOncePod
RWOP
The volume can be mounted read-write by one Pod across the cluster when supported.
Do not assume that every StorageClass supports every mode. If an application needs shared writable storage across nodes, confirm RWX support before deploying it.
For strict single-Pod attachment, use ReadWriteOncePod when it is supported. ReadWriteOnce alone does not guarantee that only one Pod can access the volume.
Mount a PVC in a Pod
Apply the manifest and verify the mount:
The Pod and PVC must be in the same namespace.
Use persistent storage with StatefulSets
Use a StatefulSet with volumeClaimTemplates when each replica needs its own persistent volume.
This creates one PVC per replica, such as data-database-0, data-database-1, and data-database-2. Scaling down or deleting a StatefulSet does not automatically delete its PVCs. Review and delete unused claims deliberately.
Choose the appropriate storage resource
Requirement
Recommended resource
Persistent application or database data
PVC
Temporary Pod-local scratch data
emptyDir
Non-sensitive configuration
ConfigMap
Credentials or sensitive configuration
Secret or an approved secrets-management integration
One persistent volume per stateful replica
StatefulSet volumeClaimTemplates
Shared writable data across multiple nodes
A KKS-supported StorageClass that provides RWX
Do not use a PVC for immutable application configuration when a ConfigMap or Secret is more appropriate. Avoid writing plaintext credentials into application data volumes.
Expand a volume
You can request a larger volume when the StorageClass has allowVolumeExpansion: true.
Confirm the setting:
Increase the PVC request:
Watch the resize:
Verify the filesystem size from the workload:
Important considerations:
A PVC can be expanded but not reduced.
The requested size must be supported by the StorageClass and available quota.
Supported in-use filesystems can expand without recreating the Pod.
Restart a workload only if PVC events or application behavior show that it is necessary, and follow the application's safe-restart procedure.
Do not edit PV capacity directly; request expansion through the PVC.
Snapshots and backups
Snapshot support is optional and depends on the features enabled for the cluster and StorageClass.
Check whether snapshot resources and classes are available:
If a default VolumeSnapshotClass is configured, you can request a snapshot without naming an implementation-specific class:
Check snapshot readiness:
Restore a new PVC from a ready snapshot:
The restored PVC size must meet the requirements of the source snapshot and selected StorageClass.
Snapshots are not a complete backup strategy. They can share failure domains and lifecycle dependencies with the source storage. For critical workloads:
Use application-consistent backup procedures.
Store backup copies in a separate failure domain when possible.
Define retention and access-control policies.
Test restores regularly.
Understand deletion and reclaim policy
Before deleting a PVC, find its PV and reclaim policy:
With a Delete reclaim policy, deleting the PVC normally causes the dynamically provisioned PV and its underlying storage to be deleted. This operation can permanently remove data.
With a Retain policy, the PV and underlying storage remain after the claim is deleted, but an administrator must recover, reuse, or delete them manually.
For important data:
Stop or quiesce writes as required by the application.
Create and verify a backup.
Confirm the PV name and reclaim policy.
Delete the PVC only after the recovery plan has been validated.
Cluster administrators can change the reclaim policy of a bound PV before deleting its claim:
Changing the reclaim policy is not a backup. It prevents automatic storage deletion but leaves manual lifecycle work for the administrator.
View storage resources
Troubleshooting
PVC remains Pending
Check the claim, StorageClass, and events:
Common causes include:
No default StorageClass exists and the claim does not name one.
The named StorageClass does not exist.
The managed storage add-on is not active or ready.
Storage quota or capacity is exhausted.
The requested size or access mode is unsupported.
The StorageClass waits for a consuming Pod before provisioning.
The consuming Pod cannot be scheduled in a compatible topology.
Pod remains in ContainerCreating
Inspect the Pod and claim:
Check for:
An unbound PVC.
A claim in a different namespace.
An incorrect claim name.
A volume already attached to an incompatible node.
Access-mode conflicts.
Node or storage add-on health problems.
Filesystem or mount errors in Pod events.
To review managed CSI components without relying on implementation-specific labels:
If the problem persists, collect the Pod description, PVC description, PV description, and recent events before contacting Krutrim support.
Volume is full
Check filesystem usage:
Then either:
Expand the PVC if the StorageClass supports expansion.
Apply the application's documented retention or cleanup procedure.
Move archival data to an appropriate storage service.
Do not run broad deletion commands against a mounted production volume without verifying the target path, retention requirements, and recovery plan.
Expansion does not complete
Check the requested and current capacities, PVC conditions, and events:
Confirm that:
allowVolumeExpansionis enabled.The new request is larger than the current request.
The requested capacity is within quota and supported limits.
The workload and filesystem support online expansion.
Do not repeatedly increase the request while an earlier resize is failing. Record the events and contact Krutrim support if the controller continues retrying.
Snapshot cannot be created
Verify that the snapshot APIs and a compatible class are installed:
Snapshot support may not be enabled for every cluster version or StorageClass. Use the backup method supported for your workload if snapshots are unavailable.
Best practices
Use PVCs for data that must survive Pod replacement or rescheduling.
Use StatefulSet claim templates when each replica needs independent storage.
Confirm access-mode support before selecting an application architecture.
Treat
ReadWriteOnceas a single-node mode, not a strict single-Pod lock.Set capacity from measured demand, growth rate, retention, and recovery requirements rather than generic size estimates.
Monitor filesystem utilization, PVC capacity, provisioning failures, and expansion events.
Alert before a filesystem is full and leave room for growth and maintenance operations.
Verify the reclaim policy before deleting any claim.
Back up critical data and test restores on a schedule.
Use application-consistent backup procedures for databases and queues.
Avoid mutable image tags for production workloads.
Keep credentials in Secrets or an approved secrets manager, not in persistent application data.
Review unused StatefulSet PVCs after scale-down or workload deletion.
Use only StorageClasses and options explicitly supported by KKS.
Last updated
Was this helpful?

