Pod 不存在時,暫時性儲存空間類型不會保留。使用暫時性儲存空間儲存設定資訊,並將儲存空間快取至應用程式。
臨時儲存空間類型會共用及耗用節點開機磁碟的資源。
您可以管理本機暫時儲存空間資源,方式與管理 CPU 和記憶體資源相同。
使用 PersistentVolume 資源的永久儲存空間
Kubernetes PersistentVolume 是 Pod 可用於持久儲存的資源。永久磁碟區的生命週期與 Pod 的生命週期無關。因此,當叢集有所變更,以及 Pod 重新建立與遭到刪除時,永久磁碟區中的磁碟和資料仍會繼續保留。您可以透過 PersistentVolumeClaims API 動態佈建 PersistentVolume 資源,或由叢集管理員明確建立。
Google Distributed Cloud 可使用各種儲存系統 (包括容器儲存空間介面 (CSI) 驅動程式和本機磁碟區) 備份永久儲存空間。
[[["容易理解","easyToUnderstand","thumb-up"],["確實解決了我的問題","solvedMyProblem","thumb-up"],["其他","otherUp","thumb-up"]],[["難以理解","hardToUnderstand","thumb-down"],["資訊或程式碼範例有誤","incorrectInformationOrSampleCode","thumb-down"],["缺少我需要的資訊/範例","missingTheInformationSamplesINeed","thumb-down"],["翻譯問題","translationIssue","thumb-down"],["其他","otherDown","thumb-down"]],["上次更新時間:2025-09-01 (世界標準時間)。"],[],[],null,["Google Distributed Cloud can use several storage configurations, and provides interfaces\nfor block and file storage management through the following Kubernetes objects:\n\n- [Volumes](https://kubernetes.io/docs/concepts/storage/volumes/)\n- [Persistent volumes](https://kubernetes.io/docs/concepts/storage/persistent-volumes/)\n- [Storage classes](https://kubernetes.io/docs/concepts/storage/storage-classes/)\n- [Volume snapshots](https://kubernetes.io/docs/concepts/storage/volume-snapshots/)\n\n| **Warning:** Google Distributed Cloud doesn't include a persistent storage provider. You must provide and configure a persistent storage system for your stateful workloads.\n\nEphemeral Storage through Kubernetes volumes\n\nKubernetes `Volume` resources are storage units accessible to containers in a\n`Pod`. Ephemeral storage backs the following volume types:\n\n- [`emptyDir`](https://kubernetes.io/docs/concepts/storage/volumes/#emptydir)\n\n- [`ConfigMap`](https://kubernetes.io/docs/concepts/configuration/configmap/)\n\n- [`Secrets`](https://kubernetes.io/docs/concepts/configuration/secret/)\n\nEphemeral storage types don't persist after a pod ceases to exist. Use\nephemeral storage for configuration information and to cache storage for\napplications.\n\nEphemeral storage types share and consume resources from the node's boot disk.\nYou can [manage your local ephemeral storage resources](/kubernetes-engine/docs/concepts/cluster-architecture#local_ephemeral_storage)\nin the same way that you manage CPU and memory resources.\n\nPersistent Storage using `PersistentVolume` resources\n\nA Kubernetes `PersistentVolume` is a resource that a `Pod` can use for durable\nstorage. The lifetime of persistent volumes is independent from the lifetime of\na pod. Thus, the disk and data in a persistent volume continue to exist as the\ncluster changes and as pods are deleted and recreated. You can provision\n`PersistentVolume` resources dynamically through the `PersistentVolumeClaims`\nAPI, or a cluster administrator can create them explicitly.\n\nGoogle Distributed Cloud can back persistent storage by using a variety of storage\nsystems, including [Container Storage Interface (CSI)](https://kubernetes.io/docs/reference/glossary/?all=true#term-csi)\ndrivers and local volumes.\n\nContainer Storage Interface (CSI) drivers\n\nGoogle Distributed Cloud is compatible with [CSI v1.0 drivers](https://github.com/container-storage-interface/spec).\nCSI is an open standard interface that many major storage vendors\nsupport. For production storage, [install a CSI driver](/kubernetes-engine/distributed-cloud/bare-metal/docs/installing/install-csi-driver)\nfrom a GDC Ready storage partner.\nFor the full list of GDC Ready storage partners, see\n[GDC Ready Storage Partners](/kubernetes-engine/enterprise/docs/resources/partner-storage).\n\nTo use CSI in your cluster, deploy the CSI driver that your storage vendor\nprovided to your clusters. Then, configure workloads to\n[use the CSI driver with the `StorageClass` API](/kubernetes-engine/distributed-cloud/bare-metal/docs/installing/install-csi-driver#using_csi_driver),\nor set `StorageClass` as the [default API](/kubernetes-engine/distributed-cloud/bare-metal/docs/installing/default-storage-class).\n\nLocal volumes\n\nFor proof of concept and advanced use cases, you can use\n[local PersistentVolume resources](https://kubernetes.io/docs/concepts/storage/volumes/#local).\nGoogle Distributed Cloud bundles the\n[sig-storage-local-static-provisioner](https://github.com/kubernetes-sigs/sig-storage-local-static-provisioner),\nwhich discovers mount points on each node and creates a local persistent volume\nfor each mount point.\n| **Caution:** Using a local persistent volume binds the pods to a specific disk and node. If that disk or node becomes unavailable, then the pods also become unavailable. Workloads using local PersistentVolume resources need to be resilient to this kind of failure, and may require additional orchestration to release the persistent volume claims of the pods and find a new and empty disk on another node.\n\nGoogle Distributed Cloud clusters use the local volume provisioner (LVP) to manage local\npersistent volumes. There are three types of storage classes for local\npersistent volumes in a Google Distributed Cloud cluster:\n\n- LVP share\n- LVP node mounts\n- Anthos system\n\nLVP share\n\nThis option creates a local persistent volume that subdirectories in a local and\nshared file system are backing. Cluster creation automatically generates these\nsubdirectories. Workloads using this storage class share capacity and\ninput/output operations per second (IOPS) because the same shared file system\nbacks the persistent volumes. To have better isolation, configure disks through\nLVP node mounts.\n\nFor more information, see\n[Configuring an LVP Share](/kubernetes-engine/distributed-cloud/bare-metal/docs/installing/configure-local-storage#configuring_an_lvp_share).\n\nLVP node mounts\n\nThis option creates a local persistent volume for each mounted disk in the configured\ndirectory. You must format and mount each disk before or after cluster creation.\n\nFor more information, see\n[Configuring LVP node mounts](/kubernetes-engine/distributed-cloud/bare-metal/docs/installing/configure-local-storage#configuring_lvp_node_mounts).\n\nAnthos system\n\nThis storage class creates preconfigured local persistent volumes during cluster\ncreation that the Anthos system pods use. The storage class name is\n`anthos-system`. Don't change or delete this storage class and don't use this\nstorage class for stateful workloads.\n\nWhat's next\n\n- Learn more about [volumes](/kubernetes-engine/docs/concepts/volumes).\n- Learn more about [Container Storage Interface](https://kubernetes.io/blog/2019/01/15/container-storage-interface-ga/) in Kubernetes.\n- Learn how to [take volume snapshots](/kubernetes-engine/docs/how-to/persistent-volumes/volume-snapshots).\n- Learn how to [increase the capacity of persistent volumes](/kubernetes-engine/docs/how-to/persistent-volumes/volume-expansion)."]]