Ask Your Question
0

Cinder Storageclass not working in Kubernetes, how to debug?

asked 2018-11-22 02:44:46 -0500

reppinjo gravatar image

updated 2018-11-22 07:42:51 -0500

I have set up a Kubernetes Cluster with RKE and cloud provider = openstack, with my OS_AUTH credentials. When I create a storageclass for Cinder creating PersistentVolumes with it doesn't work, giving me an error message of wrong parameters, although I don't even give any in the StorageClass definition file. Any help of how to find the errror would be appreciated, all the examples on the web only give code I used and it seems to work for others.

I set up the storageclass like this:

apiVersion: storage.k8s.io/v1 
kind: StorageClass 
metadata:   
  name: standard 
provisioner: kubernetes.io/cinder

and create the PersistentVolumeClaim like this:

 kind: PersistentVolumeClaim
 apiVersion: v1 
 metadata:   
   name: claim
   namespace: default
 spec:   
   accessModes:
   - ReadWriteOnce   
   resources:
     requests:
       storage: 10Gi   
   storageClassName: standard

and then I get the error message from kubectl describe pvc claim: Failed to provision volume with StorageClass "standard": failed to create a 10 GB volume: Invalid request due to incorrect syntax or missing required parameters.

edit retag flag offensive close merge delete

Comments

I know very little about K8s, but the exact error message and the parameters passed to Cinder would help troubleshooting this.

Bernd Bausch gravatar imageBernd Bausch ( 2018-11-22 06:08:43 -0500 )edit

I can't say how to set up Kubernetes, but perhaps you have error messages in the Cinder logs that you could share.

However are you sure that the storage class and persistent volume claim are syntactically correct?

Bernd Bausch gravatar imageBernd Bausch ( 2018-11-22 07:43:49 -0500 )edit

There is no entry in the cinder logs, so it must be an issue of Kubernetes not reaching the service?

reppinjo gravatar imagereppinjo ( 2018-11-26 03:27:23 -0500 )edit

2 answers

Sort by ยป oldest newest most voted
0

answered 2018-11-23 10:43:19 -0500

rduncan-t gravatar image

After creating the Cinder storage class you then need to pass in the ID of a cinder volume to create a persistient volume

cinder create --display_name pv0001 50G - take note of the ID and then ...

apiVersion: "v1"
kind: "PersistentVolume"
metadata:
  name: "pv0001"
spec:
  capacity:
    storage: "50Gi"
  accessModes:
    - "ReadWriteOnce"
  cinder:
    fsType: "ext3"
    volumeID: "<<volume id>>"

Then, you can make volume claims using the same id:

cat > nginx-cinder.yaml << END
apiVersion: v1
kind: Pod
metadata:
  name: aws-web
spec:
  containers:
    - name: web
      image: nginx
      ports:
        - name: web
          containerPort: 80
          hostPort: 8081
          protocol: TCP
      volumeMounts:
        - name: html-volume
          mountPath: "/usr/share/nginx/html"
  volumes:
    - name: html-volume
      cinder:
        # Enter the volume ID below
        volumeID: <<volume id>>
        fsType: ext4
END
edit flag offensive delete link more

Comments

I thought the idea of having a storage class was to automate this process, of course I can create everything manually but I don't want to have to go through the process whenever a new user logs on to the service (I'm setting up a Jupyterhub ). Am I wrong or what's the purpose of the storage class wh

reppinjo gravatar imagereppinjo ( 2018-11-26 03:26:42 -0500 )edit
0

answered 2019-01-22 07:19:09 -0500

Christian Zunker gravatar image

updated 2019-01-22 07:19:59 -0500

We were aible to create a PVC with the kubernetes.io/cinder provisioner. But we added parameters to it:

parameters:
  type: volumes_hdd
  availability: cinderAZ_ceph

type is the cinder volume type. availability is the cinder AZ.

You posted:

or missing required parameters

Perhaps you are missing parameters like ours.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Get to know Ask OpenStack

Resources for moderators

Question Tools

1 follower

Stats

Asked: 2018-11-22 02:44:46 -0500

Seen: 203 times

Last updated: Jan 22