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?

MrE
  • 19,584
  • 12
  • 87
  • 105
  • Could you paste the output of `kubectl describe pods $POD_NAME`? That should have events showing if the volume is mounted correctly. – caesarxuchao Mar 13 '16 at 23:46
  • Hi. Sorry for the delay. The describe command doesn't give useful info. I figured that I had to setup the credentials in the kubectl config, but now I am having another problem: openstack errors saying it can't find an ID for my node, which makes sense since my node is not hosted on the openstack provider, only the block storage. My other question is here: http://stackoverflow.com/questions/36322006/kubernetes-using-openstack-cinder-from-one-cloud-provider-while-nodes-on-anothe Do you know if this is possible? thanks – MrE Apr 01 '16 at 02:48

1 Answers1

0

The conclusion of my search on this was that the nodes using the block storage also need to be on the same OpenStack cluster.

That is, it is not (easily/standard) possible to mount Cinder block storage into a cluster of nodes that is not on the Open Stack cluster.

See: Kubernetes: using OpenStack Cinder from one cloud provider while nodes on another

MrE
  • 19,584
  • 12
  • 87
  • 105