Cinder storage Class doesn't seem to be setting up volumes correctly
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Canonical Juju |
Triaged
|
High
|
Unassigned |
Bug Description
I deployed a CDK on top of OpenStack with the following commands:
juju deploy kuberentes-core --overlay k8s-openstack-
with the following k8s-openstack-
applications:
openstack-
charm: cs:~containers/
options:
subnet-id: "45fb4f09-
num_units: 1
relations:
- ['openstack-
- ['openstack-
When I execute the following commands:
kubectl create -f - <<EOY
kind: PersistentVolum
apiVersion: v1
metadata:
name: testclaim2
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 100Mi
storageClassName: cinder
EOY
kubectl create -f - <<EOY
apiVersion: v1
kind: Pod
metadata:
name: busybox
namespace: default
spec:
containers:
- image: busybox
command:
- sleep
- "3600"
imagePull
name: busybox
volumeMounts:
- mountPath: "/pv"
name: testvolume
restartPolicy: Always
volumes:
- name: testvolume
persisten
claimName: testclaim2
EOY
The busybox never gets to a ready state due to: 'pod has unbound immediate PersistentVolum
This is using the cinder storage class that is created automatically when using the openstack-
If I create my own storage class like this
kubectl create -f - <<EOY
apiVersion: storage.k8s.io/v1
kind: StorageClass
metadata:
name: openstack-standard
provisioner: kubernetes.
EOY
And I create the busybox with this storage class it works.
These are the descriptions of the 2 storage classes:
ubuntu@jujucli:~$ kubectl describe storageclass cinder
Name: cinder
IsDefaultClass: No
Annotations: <none>
Provisioner: csi-cinderplugin
Parameters: <none>
AllowVolumeExpa
MountOptions: <none>
ReclaimPolicy: Delete
VolumeBindingMode: Immediate
Events: <none>
ubuntu@jujucli:~$ kubectl describe storageclass openstack-standard
Name: openstack-standard
IsDefaultClass: No
Annotations: <none>
Provisioner: kubernetes.
Parameters: <none>
AllowVolumeExpa
MountOptions: <none>
ReclaimPolicy: Delete
VolumeBindingMode: Immediate
Events: <none>
no longer affects: | charm-aws-integrator |
tags: | added: osm |
Changed in juju: | |
importance: | Undecided → High |
assignee: | nobody → Harry Pidcock (hpidcock) |
status: | New → Triaged |
Changed in juju: | |
status: | Triaged → In Progress |
Changed in juju: | |
assignee: | Harry Pidcock (hpidcock) → nobody |
status: | In Progress → Triaged |
The changes to CDK to use the external cloud provider for openstack, the cinder CSI plugin, and to automatically create the storage classes got missed for the latest release, so "kubernetes. io/cinder" is still the proper value for the SC provider for now.
The SC that was automatically created came from Juju. It seems that Juju will need to detect whether the CSI plugin is available. Additionally, there was a recent upstream change[1] to the CSI plugin which affects the provider value. So Juju will also need to check the version of the plugin to determine which provider value to use for the SC:
* no CSI plugin: kubernetes. io/cinder csi.openstack. org
* CSI plugin less than v1.2.0: csi-cinderplugin
* CSI plugin v1.2.0 or greater: cinder.
[1]: https:/ /github. com/kubernetes/ cloud-provider- openstack/ pull/624