volume ============== 有效的: - cephfs - configMap - downwardAPI - emptyDir - hostPath - iscsi - local - nfs - persistentVolumeClaim - rbd - secret 一些废弃的已经不在这里罗列了。 hostPath ----------------------- 用于直接在Pod中声明主机路径存储。 .. code-block:: yaml apiVersion: v1 kind: Pod metadata: name: test-pd spec: containers: - image: registry.k8s.io/test-webserver name: test-container # 容器使用的卷的声明 volumeMounts: # 容器中挂载的路径 - mountPath: /test-pd # 引用的卷的名字 name: test-volume # 卷 volumes: # 卷名 - name: test-volume hostPath: # 宿主机上目录位置 path: /data # 此字段为可选 # 说明是一个目录 type: Directory