
Description
Guidance on managing storage in Google Kubernetes Engine (GKE) clusters.
SKILL.md
GKE Storage Best Practices
This skill provides guidance on managing storage in Google Kubernetes Engine (GKE) clusters.
Overview
GKE supports various storage options, from Persistent Disks to Cloud Storage. Choosing the right storage type and configuring it correctly is essential for performance and reliability.
Workflows
1. Configure Storage Classes
StorageClasses allow you to describe the "classes" of storage you offer. Different classes might map to quality-of-service levels, or to backup policies.
Example StorageClass Manifest:
apiVersion: storage.k8s.io/v1
kind: StorageClass
metadata:
name: premium-rwo
provisioner: pd.csi.storage.gke.io
parameters:
type: pd-ssd
replication-type: regional-pd
volumeBindingMode: WaitForFirstConsumer
allowVolumeExpansion: true
Setting allowVolumeExpansion: true is highly recommended for production.
2. Use CSI Drivers
GKE includes container storage interface (CSI) drivers for dynamic provisioning of storage.
- Compute Engine Persistent Disk CSI Driver: Default for block storage.
- Google Cloud Filestore CSI Driver: For managed NFS (ReadWriteMany).
- Cloud Storage FUSE CSI Driver: For mounting GCS buckets as volumes.
Example using Filestore CSI Driver:
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: filestore-pvc
spec:
accessModes:
- ReadWriteMany
storageClassName: standard-rwm # Pre-defined for Filestore
resources:
requests:
storage: 1Ti
3. Implement Volume Expansion
If allowVolumeExpansion is true in the StorageClass, you can resize a volume by updating the PVC manifest.
Steps:
- Edit the PVC manifest and increase the storage request.
- Apply the changes.
Kubernetes will automatically resize the file system on the volume.
Best Practices
- Use CSI Drivers: Always use the official Google Cloud CSI drivers for best integration and performance.
- Enable Volume Expansion: Always set
allowVolumeExpansion: truein your StorageClasses to allow for growth. - Choose the Right Disk Type: Use
pd-ssdorpd-extremefor I/O intensive workloads, andpd-standardorpd-balancedfor others. - Use ReadWriteMany Carefully: Filestore (NFS) is great for sharing data among multiple Pods, but be aware of file locking and consistency semantics.
More skills from the gke-mcp repository
View all 25 skillscustom-golden-image-discovery
discover golden base images for GKE nodes
Jul 12DeploymentGoogle CloudKubernetesgke-ai-troubleshooting-handle-disruption-gpu-tpu
diagnose GPU and TPU workload disruptions
Jul 28DebuggingGoogle CloudKubernetesPerformancegke-ai-troubleshooting-jobset-interruption
diagnose GKE JobSet interruptions
Jul 12DebuggingGoogle CloudKubernetesObservabilitygke-ai-troubleshooting-skill-creation-guide
create GKE troubleshooting skill bundles
Jul 12DocumentationEngineeringGoogle CloudTechnical Writinggke-ai-troubleshooting-tpu-connection-failure-vbar-oom
diagnose GKE TPU connection failures
Jul 12DebuggingGoogle CloudKubernetesPerformancegke-app-onboarding
containerize and deploy apps to GKE
Jul 12ContainersDeploymentGoogle CloudKubernetes +1
More from Google Cloud
View publisherkb-search
search and extract local knowledge base documents
knowledge-catalog
Jul 12DocumentationKnowledge BaseSearchknowledge_catalog_discovery_agent
search and rank Knowledge Catalog data entries
knowledge-catalog
Jul 12Data AnalysisGoogle CloudKnowledge ManagementSearchcontributing
contribute to Cloud Foundation Fabric
cloud-foundation-fabric
Jul 31AutomationEngineeringGitHubGoogle Cloud +1fabric-builder
generate Terraform code for Google Cloud
cloud-foundation-fabric
Jul 12Google CloudInfrastructure as CodeTerraformfast-0-org-setup-prereqs
prepare prerequisites for FAST 0-org-setup
cloud-foundation-fabric
Jul 12Google CloudOperationsagent-aware-cli
design agent-aware command-line interfaces
vertex-ai-creative-studio
Jul 12CLIEngineeringGoogle Cloud