Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

allow hostpath provisioner to delete persistent volumes #567

Merged
merged 1 commit into from Jul 31, 2019
Merged

allow hostpath provisioner to delete persistent volumes #567

merged 1 commit into from Jul 31, 2019

Conversation

bkc
Copy link
Contributor

@bkc bkc commented Jul 30, 2019

When RBAC has been enabled under v1.15.1, persistent volumes can be created using persistentvolumeclaims.

However after the persistentvolumeclaim is deleted, hostpath provisioner deletes the backing directory, but fails to delete the persistent volume due to a 'forbidden' error, e.g.

I0730 03:13:43.616042       1 controller.go:869] volume "pvc-0621280e-d5dc-4640-b232-38021643fb65" deleted
I0730 03:13:43.617107       1 controller.go:876] failed to delete volume "pvc-0621280e-d5dc-4640-b232-38021643fb65" from database: persistentvolumes "pvc-0621280e-d5dc-4640-b232-38021643fb65" is forbidden: User "system:serviceaccount:kube-system:microk8s-hostpath" cannot delete resource "persistentvolumes" in API group "" at the cluster scope

I was able to work around this by adding the delete verb to the ClusterRole for persistentvolumes.

…enabled

When RBAC has been enabled under v1.15.1, persistent volumes can be created using persistentvolumeclaims.

However after the persistentvolumeclaim is deleted, hostpath provisioner deletes the backing store, but fails to delete the persistent volume due to a 'forbidden' error, e.g.

```
I0730 03:13:43.616042       1 controller.go:869] volume "pvc-0621280e-d5dc-4640-b232-38021643fb65" deleted
I0730 03:13:43.617107       1 controller.go:876] failed to delete volume "pvc-0621280e-d5dc-4640-b232-38021643fb65" from database: persistentvolumes "pvc-0621280e-d5dc-4640-b232-38021643fb65" is forbidden: User "system:serviceaccount:kube-system:microk8s-hostpath" cannot delete resource "persistentvolumes" in API group "" at the cluster scope
```
I was able to work around this by adding the `delete` verb to the ClusterRole for persistentvolumes.
@ktsakalozos
Copy link
Member

@ktsakalozos ktsakalozos commented Jul 31, 2019

Thank you for fixing this bug @bkc LGTM. Your fix will be available on the edge channel within the day and released to stable with the 1.15.2 release.

@ktsakalozos ktsakalozos merged commit a6d6564 into canonical:master Jul 31, 2019
1 check passed
ianbibby pushed a commit to ianbibby/microk8s that referenced this issue Jan 10, 2020
…enabled (canonical#567)

When RBAC has been enabled under v1.15.1, persistent volumes can be created using persistentvolumeclaims.

However after the persistentvolumeclaim is deleted, hostpath provisioner deletes the backing store, but fails to delete the persistent volume due to a 'forbidden' error, e.g.

Adding the `delete` verb to the ClusterRole for persistentvolumes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants