问题:如何将连接到 Pod 内主机的原始设备用作块设备。
我尝试使用类型为“BlockDevice”的“hostPath”
volumes:
- my-data:
hostPath:
path: /dev/nvme1n2
type: BlockDevice
Run Code Online (Sandbox Code Playgroud)
containers:
.....
volumeDevices:
- name: my-data
devicePath: /dev/sda
Run Code Online (Sandbox Code Playgroud)
此配置给了我以下错误。
Invalid value: "my-data": can only use volume source type of PersistentVolumeClaim for block mode
Run Code Online (Sandbox Code Playgroud)
我可以使用PersistentVolumeand 来实现PersistentVolumeClaim吗?有人可以帮助我提供示例配置吗?感谢帮助。
kubernetes ×1