Volume Type | Description |
Use temporary path | / |
Use host path | Mount the file directory of the host where the container resides to the path specified by the container (corresponding to HostPath in Kubernetes). You can also choose not to set the source path (corresponding to EmptyDir in Kubernetes). If the source path is not specified, the system mounts the temporary directory of the assigned host to the mount target of the container.Local disk volumes that have specified source paths are suitable for persisting data to the host where the container resides, whereas EmptyDir is suitable for temporary storage for containers. |
Use NFS disk | Simply enter the NFS path. You can use Tencent Cloud's Cloud File Storage (CFS) or user-built NFS file storage. An NFS volume is suitable for persistent storage with frequent reads and writes in scenarios such as big data analysis, media processing, and content management. |
Use existing PersistentVolumeClaim | Use the storage of the existing PersistentVolumeClaim to declare the storage for workloads, and automatically assign or create a PersistentVolume and mount it to the corresponding pod. This is suitable for stateful applications created by StatefulSet. |
Use ConfigMap | A ConfigMap is mounted to a pod as a file system. You can mount the custom ConfigMap entries to a specific path. For more information, see ConfigMap Management. |
Use Secret | A Secret is mounted to a pod as a file system. You can mount custom Secret entries to a specific path. For more information, see Secret Management. |
/var/lib/kubelet/pods/pod_name/volumes/kubernetes.io~empty-dir
, and the lifecycle of the volume using the temporary directory is the same as the lifecycle of the Pod. Volume | Mount Target | ||||
Type | Name | Others | Destination Path | Sub-path | Read and Write Permissions |
Temporary path | Custom | / | Specify this path as needed, for example, /cache. | Mount only the sub-path or a single file in the selected volume, for example, /data or /test.txt. | Select as needed. Read-only: the container path volume can only be read and data modifications must be performed on the host. Read and write: data can be read from and modifications can be saved to the container path volume. |
| | | | Node path | Set the node path. Node Path: the node path cannot be empty. For example, if the container needs to access Docker, the node path can be set to /var/lib/docker. Check Type: TKE provides many check types such as NoChecks and DirectoryOrCreate. Read the description of each type in the console and select a check type as needed. |
| | | | NFS disk | NFS Path: enter the CFS address or user-built NFS address. To create a file system, see Creating File Systems and Mount Targets. 10.0.0.161:/ is an example NFS path. To obtain the NFS path, please log in to the CFS console, click the ID of the target file system and find it in **Mount under Linux** on the **Mount Target Info** tab. |
| | | | Existing PVC | Choose a PVC as needed. |
| | | | Tencent Cloud CBS | Select a cloud disk as needed. |
| | | | ConfigMap | Select a ConfigMap: select a ConfigMap as needed. Options: **All** and **Specific keys**. Items: if you select **Specific keys**, you can mount it to a specific path by adding items. For example, if the mount point is /data/config and the sub-path is dev, the data will be stored under /data/config/dev. |
| | | | | SECRET |
| | | |
apiVersion: v1kind: Podmetadata:name: test-pdspec:containers:- image: k8s.gcr.io/test-webservername: test-containervolumeMounts:- mountPath: /cachename: cache-volumevolumes:- name: cache-volumeemptyDir: {}
Apakah halaman ini membantu?