在裸机上部署 Openstack Magnum

Deploying Openstack Magnum on bare metal

谈到 Kubernetes 集群的 Openstack Magnum 部署(在裸机节点上)时,是否有可能利用这些节点上的本地磁盘作为容器的持久存储?

提前,非常感谢。

Openstack Magnum 使用 Cinder to provision storage for kubernetes cluster. As you can read here:

In some use cases, data read/written by a container needs to persist so that it can be accessed later. To persist the data, a Cinder volume with a filesystem on it can be mounted on a host and be made available to the container, then be unmounted when the container exits.

...

Kubernetes allows a previously created Cinder block to be mounted to a pod and this is done by specifying the block ID in the pod YAML file. When the pod is scheduled on a node, Kubernetes will interface with Cinder to request the volume to be mounted on this node, then Kubernetes will launch the Docker container with the proper options to make the filesystem on the Cinder volume accessible to the container in the pod. When the pod exits, Kubernetes will again send a request to Cinder to unmount the volume’s filesystem, making it available to be mounted on other nodes.

其用法在文档的 this 部分进行了描述。

如果 setting up Cinder seems like too much overhead, you can use local 允许使用本地存储设备的卷类型,例如磁盘、分区或已经安装在工作节点文件系统上的目录。