kinvolk / lokomotive

🪦 DISCONTINUED Further Lokomotive development has been discontinued. Lokomotive is a 100% open-source, easy to use and secure Kubernetes distribution from the volks at Kinvolk
https://kinvolk.io/lokomotive-kubernetes/
Apache License 2.0
321 stars 49 forks source link

`lokoctl component delete` is not idempotent #708

Open surajssd opened 4 years ago

surajssd commented 4 years ago

If you delete openebs-operator before deleting the component openebs-storage-class then it fails with error

FATA[0007] uninstallation completed with 1 error(s): admission webhook "admission-webhook.openebs.io" denied the request: failed to get spc cstor-pool-openebs-test-sc: storagepoolclaims.openebs.io "cstor-pool-openebs-test-sc" is forbidden: User "system:serviceaccount:openebs:openebs-operator" cannot get resource "storagepoolclaims" in API group "openebs.io" at the cluster scope.

OR

Deleting component 'openebs-operator'...
Successfully deleted component "openebs-operator"!
Deleting component 'openebs-storage-class'...
FATA[0007] uninstallation completed with 1 error(s): admission webhook "admission-webhook.openebs.io" denied the request: failed to get spc cstor-pool-openebs-test-sc: storagepoolclaims.openebs.io "cstor-pool-openebs-test-sc" is forbidden: User "system:serviceaccount:openebs:openebs-operator" cannot get resource "storagepoolclaims" in API group "openebs.io" at the cluster scope  args="[aws-ebs-csi-driver cert-manager cluster-autoscaler contour dex flatcar-linux-update-operator gangway httpbin linkerd metallb metrics-server openebs-operator openebs-storage-class prometheus-operator rook rook-ceph velero]" command="lokoctl component delete"
surajssd commented 4 years ago

This happens mainly on HA setups.

invidian commented 4 years ago

Could it be, that we don't wait until openebs-operator is uninstalled OR that the webhook is not being unregistered properly and that's why openebs-storage-class uninstallation fails?

Also, I think uninstalling should be happening in the reverse order than installing, that might also help.

surajssd commented 4 years ago

Also, I think uninstalling should be happening in the reverse order than installing, that might also help.

Yes