[[["易于理解","easyToUnderstand","thumb-up"],["解决了我的问题","solvedMyProblem","thumb-up"],["其他","otherUp","thumb-up"]],[["很难理解","hardToUnderstand","thumb-down"],["信息或示例代码不正确","incorrectInformationOrSampleCode","thumb-down"],["没有我需要的信息/示例","missingTheInformationSamplesINeed","thumb-down"],["翻译问题","translationIssue","thumb-down"],["其他","otherDown","thumb-down"]],["最后更新时间 (UTC):2025-09-03。"],[],[],null,["# Storage\n\nYou create persistent storage for workloads running on\nGKE on AWS with Kubernetes objects.\n\nUsing persistent storage in your GKE on AWS workloads\n-----------------------------------------------------\n\nIn GKE on AWS, you use the Kubernetes\n[PersistentVolume](https://kubernetes.io/docs/concepts/storage/persistent-volumes/)\n(PV),\n[PersistentVolumeClaim](https://kubernetes.io/docs/concepts/storage/persistent-volumes/#lifecycle-of-a-volume-and-claim)\n(PVC), and\n[StorageClass](https://kubernetes.io/docs/concepts/storage/storage-classes/)\nresources to provide persistent file and block storage to workloads. For user clusters version 1.17 and higher, you can create snapshots of persistent storage with the\n[VolumeSnapshot](https://kubernetes.io/docs/concepts/storage/volume-snapshots/)\nand [VolumeSnapshotClass](https://kubernetes.io/docs/concepts/storage/volume-snapshot-classes/) resources.\nSnapshots are stored in your AWS account.\n\n### StorageClass\n\nUser clusters have a\n[default](https://kubernetes.io/docs/concepts/storage/persistent-volumes/#class-1)\nKubernetes StorageClass that\n[dynamically provisions](/kubernetes-engine/docs/concepts/persistent-volumes#dynamic_provisioning)\nstateful storage for workloads on AWS Elastic Block Storage (EBS) volumes. You\ncan also use a\n[different StorageClass](/kubernetes-engine/multi-cloud/docs/aws/previous-generation/how-to/storage-class#custom) to\nprovision other types of volumes. These options are described in the following\nsection.\n\n### VolumeSnapshotClass\n\nUsers clusters have a\n[default](https://kubernetes.io/docs/concepts/storage/volume-snapshot-classes/#the-volumesnapshotclass-resource)\nKubernetes VolumeSnapshotClass that creates snapshots of stateful storage on AWS\nElastic Block Storage (EBS) volumes.\n\nConfiguring cluster storage\n---------------------------\n\nIf you want to provision storage volumes with a non-default StorageClass,\nyou can create a new\n[StorageClass](/kubernetes-engine/multi-cloud/docs/aws/previous-generation/how-to/storage-class#custom) in a cluster that uses\ndifferent parameters or a different storage driver. Then, you can\n[set the StorageClass as the cluster's default](/kubernetes-engine/multi-cloud/docs/aws/previous-generation/how-to/storage-class#set_default),\nor configure your workloads to use the StorageClass. For example, you can use a\n[StatefulSet](/kubernetes-engine/multi-cloud/docs/aws/previous-generation/how-to/storage-class#statefulset) to set a specific\nStorageClass name.\n\nUsing volume snapshots\n----------------------\n\nIn Kubernetes versions 1.17+, you can use the\n[VolumeSnapshot](https://kubernetes.io/docs/concepts/storage/volume-snapshots/)\nresource to create snapshots of storage volumes. Then, you can\n[provision](https://kubernetes.io/docs/concepts/storage/persistent-volumes/#volume-snapshot-and-restore-volume-from-snapshot-support)\nnew persistent volumes from these snapshots.\n\nElastic Block Storage (EBS)\n---------------------------\n\nGKE on AWS manages [AWS EBS](https://aws.amazon.com/ebs/)\nvolumes with the\n[aws-ebs-csi-driver](https://github.com/kubernetes-sigs/aws-ebs-csi-driver).\n\nThe EBS CSI Driver version is tied to a GKE on AWS Kubernetes\nversion. When you upgrade your user cluster version, the new driver\nversion applies automatically. This version is typically the latest driver\navailable at the time that the GKE on AWS version is released.\n\nThe driver pre-installed with GKE on AWS provides the following\nStorageClasses by default:\n\n- `standard-rwo` (default): Used for provisioning EBS `gp2` volumes.\n- `premium-rwo`: Used for provisioning EBS `io1` volumes.\n\nEBS volumes support the Kubernetes ReadWriteOnce access mode.\n| **Note:** The legacy Kubernetes `kubernetes.io/aws-ebs` volume type is not supported.\n\n### Preexisting EBS volumes\n\nYou can provision existing EBS volumes in your GKE on AWS\nworkloads. See\n[Importing a preexisting EBS volume](/kubernetes-engine/multi-cloud/docs/aws/previous-generation/how-to/preexisting-volume) for\nexamples on how to use EBS volumes in GKE on AWS.\n\nElastic File System (EFS)\n-------------------------\n\nGKE on AWS 1.6 and higher supports mounting preexisting\n[AWS EFS](https://aws.amazon.com/efs/) file systems\nand access points. For more information, see\n[Using EFS](/kubernetes-engine/multi-cloud/docs/aws/previous-generation/how-to/using-efs).\n\nAdditional storage options\n--------------------------\n\nOther third-party storage systems can be used with GKE on AWS\nthrough third-party Container Storage Interface (CSI) drivers (recommended) or\nin-tree Kubernetes volume plugins.\n| **Note:** Google does not provide support for third-party drivers. Contact your storage vendor for support.\n\n### CSI drivers\n\nThe\n[Container Storage Interface (CSI)](https://github.com/container-storage-interface/spec/blob/master/spec.md)\nis an open standard API that enables Kubernetes to attach arbitrary storage\nsystems to containerized workloads. A non-comprehensive list of CSI drivers can\nbe found in the\n[Kubernetes CSI Developer Documentation](https://kubernetes-csi.github.io/docs/drivers.html).\nGKE on AWS supports CSI v1.x.\n\nTo use a CSI driver in your cluster, you need to\n[install the CSI driver](/kubernetes-engine/multi-cloud/docs/aws/previous-generation/how-to/storage-drivers)\nprovided by your storage vendor. You can then configure workloads to use the\ndriver's StorageClass or set it as the\n[default StorageClass](/kubernetes-engine/multi-cloud/docs/aws/previous-generation/how-to/storage-class#set_default).\n\n### AWS-specific storage drivers\n\nThe following volume drivers can be used with GKE on AWS.\n\n#### FSx for Lustre (FSX)\n\nGKE on AWS doesn't manage\n[FSx](https://aws.amazon.com/fsx/lustre) volumes directly.\nYou can manually install the\n[aws-fsx-csi-driver](https://github.com/kubernetes-sigs/aws-fsx-csi-driver),\nbut support is not available from Google.\n\n### Kubernetes in-tree volume plugins\n\nKubernetes ships with\n[in-tree (built-in) volume plugins](https://kubernetes.io/docs/concepts/storage/volumes/#volume-types).\nSupported in-tree drivers include the following:\n\n- configMap\n- emptyDir\n- hostPath\n- nfs\n- projected\n- secrets\n\n| **Note:** Using a vendor-supported in-tree volume plugin is not recommended. New Kubernetes storage features, such as volume snapshots, are supported only with CSI drivers. Also, many of the in-tree plugins do not support [dynamic provisioning](/kubernetes-engine/docs/concepts/persistent-volumes). When using a driver that does not support dynamic provisioning, you must manually create PersistentVolumes for your workloads.\n\nWhat's next?\n------------\n\n- Learn about [Using StorageClasses with your workloads](/kubernetes-engine/multi-cloud/docs/aws/previous-generation/how-to/storage-class).\n- [Import a preexisting EBS volume into GKE on AWS](/kubernetes-engine/multi-cloud/docs/aws/previous-generation/how-to/preexisting-volume).\n- Learn about [Persistent volumes in GKE](/kubernetes-engine/docs/concepts/persistent-volumes).\n- Learn about [Volume snapshots in GKE](/kubernetes-engine/docs/how-to/persistent-volumes/volume-snapshots).\n- Read the Kubernetes [Storage Classes](https://kubernetes.io/docs/concepts/storage/storage-classes/) documentation.\n- Read the [Container Storage Interface](https://kubernetes.io/blog/2019/01/15/container-storage-interface-ga/) release announcement."]]