1

Using Kubernetes on bare metal and trying to figure out how to mount a external bloc storage volume from an OpenStack cloud provider.

I understand I need to use the Cinder plugin. https://github.com/kubernetes/kubernetes/tree/master/pkg/volume/cinder

I modified an example I found to build a test pod, the volume is simply defined as the following, in the pod definition:

apiVersion: v1
kind: Pod
metadata:
  name: test
  labels:
    name: test
spec:
  containers:
    - image: busybox
      name: busybox
      command:
      - "sleep"
      - "3600"
      volumeMounts:
        - name: persistent-storage
          mountPath: /var/lib/storage
  volumes:
    - name: persistent-storage
      cinder:
        volumeID: bd82f7e2-wece-4c01-a505-4acf60b07f4a
        fsType: ext4

I have a volumeID I got from the OpenStack volume API.

I put it there, but I am not sure the volume is actually being mounted:

I am not sure how to check actually, but I would guess that df -h would show a remote volume being mounted on the host and in the container, but I don't see any.

I would think Kubernetes would send me an error if the volume was not mounted, the pod would fail or something... but it runs.

So, the question is: how do I verify the volume is mounted? and as I believe it is not mounted, what should I do to make this cinder plugin work?

4

1 回答 1

0

我对此的搜索的结论是使用块存储的节点也需要在同一个 OpenStack 集群上。

也就是说,不可能(容易/标准)将 Cinder 块存储挂载到不在 Open Stack 集群上的节点集群中。

请参阅: Kubernetes:使用来自一个云提供商的 OpenStack Cinder,而在另一个云提供商上使用节点

于 2017-09-26T16:39:36.587 回答