volcano: Deleting a queue with `kubectl` fails with "only queue with state `Closed` can be deleted"

What happened:

An attempt to delete a queue with kubectl delete ends with the following error:

Error from server: error when deleting "ex2-volcano.yaml": admission webhook "validatequeue.volcano.sh" denied the request: only queue with state `Closed` can be deleted, queue `one-q` state is `Open`
Error from server (NotFound): error when deleting "ex2-volcano.yaml": jobs.batch.volcano.sh "j1-vj" not found

What you expected to happen:

I expect queue be deleted.

How to reproduce it (as minimally and precisely as possible):

Just create a new queue and try to delete it with kubectl delete.

Anything else we need to know?:

I realize I can close the queue first with vcctl, but I need a pure Kubernetes solution without extra CLI tools. I am going to eventually create/delete queues through Kubernetes API so I cannot rely on some external CLI utilities. I tried to edit a queue with kubectl edit but unfortunately could not close it this way.

Environment:

  • Volcano Version: 1.3.0
  • Kubernetes version (use kubectl version):
    Client Version: version.Info{Major:"1", Minor:"22", GitVersion:"v1.22.0", GitCommit:"c2b5237ccd9c0f1d600d3072634ca66cefdf272f", GitTreeState:"clean", BuildDate:"2021-08-04T17:56:19Z", GoVersion:"go1.16.6", Compiler:"gc", Platform:"darwin/amd64"}
    Server Version: version.Info{Major:"1", Minor:"21", GitVersion:"v1.21.2", GitCommit:"092fbfbf53427de67cac1e9fa54aaa09a28371d7", GitTreeState:"clean", BuildDate:"2021-06-16T12:53:14Z", GoVersion:"go1.16.5", Compiler:"gc", Platform:"linux/amd64"}
    

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Comments: 33 (16 by maintainers)

Most upvoted comments

@prokher I see. You are more expecting to manage the queue only through kubectl. We’ll discuss this at our community meeting.

What if we rename vcctl to kubectl-volcano and use it as a plugin for kubectl

we can close queue by

kubectl volcano queue operate -a close -n test  

then, delete the queue

kubectl volcano queue delete -n test 

If this is cumbersome, we can optimize the command

kubectl volcano close queue --name test 
kubectl volcano delete queue --name test

Perhaps we can take different designs to the weekly meeting this week. It is an interesting issue. Let’s get more voice from the community.

@Thor-wl, honestly, I am not getting why you are speaking about pushing ideas to the Kubernetes community. Although it could be true, I was talking about a completely different thing.

I had in mind the possibility to edit a queue instance with kubectl edit and modify its YAML so that it becomes closed eventually. In such case, I could delete it with kubectl delete then. For example, there could be a property enabled switching which to false causes a queue to close.

@shinytang6, applying a Command CRD with kubectl may work as a workaround. Would you mind sharing a place I can find an example?

@prokher There are no relevant examples in the community right now, l can help add some later. You can try with something like that:

apiVersion: bus.volcano.sh/v1alpha1
kind: Command
metadata:
  name: close-queue
action: CloseQueue
target:
  apiVersion: scheduling.volcano.sh/v1beta1
  kind: Queue
  name: xxx
  uid: xxx