Search code examples
kubernetesrabbitmqpersistent-volume-claimskubernetes-operator

RabbitMQ Operator with local path: Internal error occurred: 2 default StorageClasses were found


I was following rabbitmq kubernetes operator documentation to create rabbitmq cluster.

As instructed in documentation if pods stay long in pending state, we need to execute following 2 command to install Local Path Provisioner

kubectl apply -f https://raw.githubusercontent.com/rancher/local-path-provisioner/master/deploy/local-path-storage.yaml
kubectl annotate storageclass local-path storageclass.kubernetes.io/is-default-class=true

So now I am getting following error with local path as I have 2 storage class as default (other being "standard" provided by minikube).

Internal error occurred: 2 default StorageClasses were found

How do I fix this? Seems there is open defect for this at Kubernetes. So how do I do workaround to this issue to proceed further? I am running kubernetes in minikube.

https://github.com/kubernetes/kubernetes/issues/34549

Solution

  • I think you can just delete one of the storage class.

     kubectl get storageclass
     # then choose the one you want to delete
     kubectl delete storageclass/<classname>
    

    then restart your rabbitmq operator.