add controller gate flag
What type of PR is this?
/kind feature
What this PR does / why we need it:
- add controller gate flag
Which issue(s) this PR fixes:
Fix https://github.com/volcano-sh/volcano/issues/3485
Special notes for your reviewer:
Does this PR introduce a user-facing change?
None
Additional documentation e.g., KEPs (Kubernetes Enhancement Proposals), usage docs, etc.:
None
kind: Deployment
apiVersion: apps/v1
...
spec:
...
containers:
- name: {{ .Release.Name }}-controllers
...
args:
...
- --controllers=<we can use custom controller names here>
- -v=4
...
{{- end }}
There are several ways to use it:
- --controllers:
- If none of them are set, all controllers are started by default.
- "*":
- --controllers="*", represents startup of all controllers -
- --controllers="+gc-controller,+job-controller,+pg-controller,+queue-controller", represents startup only gc-controller job-controller pg-controller, queue-controller
- If none of them are set, all controllers are started by default
How about start the most necessary controllers set such as gc,job,pg,queue.
- If none of them are set, all controllers are started by default
How about start the most necessary controllers set such as gc,job,pg,queue.
Certainly, it is ok. However, it might be different from before, which could confuse users since we are uncertain about the scope of the impact. To address this, we should add a toggle setting while keeping the existing functionality unchanged, allowing users to choose whether to enable it or not. IMO, it's better to keep the status quo. However, this can be discussed further to reach a conclusive decision.
- If none of them are set, all controllers are started by default
How about start the most necessary controllers set such as gc,job,pg,queue.
Certainly, it is ok. However, it might be different from before, which could confuse users since we are uncertain about the scope of the impact. To address this, we should add a toggle setting while keeping the existing functionality unchanged, allowing users to choose whether to enable it or not. IMO, it's better to keep the status quo. However, this can be discussed further to reach a conclusive decision.
yeah I agree with you.
Is there anything that needs improvement? I think this PR is perfect.
usage describe be like:
...
--controllers strings Specify controller gates. Use '*' for all controllers, all knownController: [gc-controller job-controller jobflow-controller jobtemplate-controller pg-controller queue-controller] ,and we can use '-' to disable controllers, e.g. "-job-controller,-queue-controller" to disable job and queue controllers. (default [*])
"+gc-controller, -gc-controller, *"
Have you considered this case?
I think a function should be added to check for incorrect settings, such as a controller being set
openandcloseat the same time.
good catch! thank @hwdef i will fixed this case
[APPROVALNOTIFIER] This PR is APPROVED
This pull-request has been approved by: william-wang
The full list of commands accepted by this bot can be found here.
The pull request process is described here
- ~~OWNERS~~ [william-wang]
Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment
I want to disable job-controller. if I set --controllers=*,-job-controller, it causes Error; then I set --controllers=-job-controller, it disabled all controllers. I have to set --controllers=+queue-controller,+pg-controller,+gc-controller,+hyperNode-controller+any other controllers.
I suggest volcano supports to disable specific controllers by --controllers=*,-job-controller.
I want to disable job-controller. if I set --controllers=*,-job-controller, it causes Error; then I set --controllers=-job-controller, it disabled all controllers. I have to set --controllers=+queue-controller,+pg-controller,+gc-controller,+hyperNode-controller+any other controllers.
I suggest volcano supports to disable specific controllers by --controllers=*,-job-controller.
@googs1025 Can you take a look?
I want to disable job-controller. if I set --controllers=,-job-controller, it causes Error; then I set --controllers=-job-controller, it disabled all controllers. I have to set --controllers=+queue-controller,+pg-controller,+gc-controller,+hyperNode-controller+any other controllers. I suggest volcano supports to disable specific controllers by --controllers=,-job-controller.
@googs1025 Can you take a look?
I'll take a look the weekend and if it works I'll fix it next week.