-
Notifications
You must be signed in to change notification settings - Fork 1k
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
add admitPod and PGController #165
Conversation
Have not yet look at the pr, serveral question:
Is this for other users instead of volcano job controller? If the user do not use volcano job, how should he disable the job controller in volcano?
Missing the background, just remember the |
|
/cc @lminzhw |
In order not to refactor this again, I think we need some clarifications/discussions on why we need do in this way. pasted as below, hope someone can explain this.
|
xref #135
|
This can be addressed by removing |
Same as what I said, if this is for users who are only using kube-batch, this should be a separate component. I donot see it is necessary in volcano. BTW, I guess the first question is also for |
hm... 'kube-batch' is part of volcano. Volcano should be open for others who only use scheduler part, e.g. kubeflow.
not sure how that works :(, we should not bind controller & scheduler. |
hmm with a quick thought, the pseudo code would be:
|
I know, i mean, if others not use Volcano Job, why do we enforce them to deploy all the volcano controllers? We should allow to specify which controller to start. |
I'd like to control the number of binaries; that should be ok if they do not create volcano Job by yaml file :) |
PodGroupController does not create pods. |
I was mean in the job controller, but I think I get the point now, the new added logic in admission service is used to block ANY pods that are created with non-default scheduler? This sounds like a pure kube-batch logic but we address this in volcano? |
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks
please resolve the conflict. |
Hey @wangyuqing4, TravisCI finished with status TravisBuddy Request Identifier: 8ac87940-a6bb-11e9-a3be-7d74802580dc |
lgtm, but we need other reviews since it's a huge change. /assign @hzxuzhonghu |
@@ -44,6 +44,7 @@ type Config struct { | |||
PrintVersion bool | |||
AdmissionServiceName string | |||
AdmissionServiceNamespace string | |||
SchedulerName string |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it's better to be an label selector; schedulerName
is not enough.
@@ -177,6 +183,42 @@ func RegisterWebhooks(c *Config, clienset *kubernetes.Clientset, cabundle []byte | |||
return err | |||
} | |||
|
|||
// Prepare validate pods | |||
path = "/pods" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
suggest /validating-pods
, should consider if we need mutating in the future
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
legacy
return true | ||
} | ||
return false | ||
default: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is another case, when delete event miss, please refer to DeletedFinalStateUnknown
nvm, it only handles pod add
ObjectMeta: metav1.ObjectMeta{ | ||
Namespace: pod.Namespace, | ||
Name: pgName, | ||
OwnerReferences: pod.OwnerReferences, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do not understand why set pg's OwnerReferences same with pod's
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
show the pg and pod belong the same thing
}, | ||
} | ||
|
||
if _, err := cc.kbClients.SchedulingV1alpha1().PodGroups(pod.Namespace).Create(pg); err != nil { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
previously PG is created by job controller, right?
Why also create it here? If a pod already created, is there a need to create a PG with MinMember equals 1? The pod maybe already running.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
in the queue, isn't vk job but use volcano scheduler, so create pg here.
overall lgtm |
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: hzxuzhonghu, wangyuqing4 The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
@k82cn any other comments |
if job.Status.State.Phase != "" { | ||
return job, nil | ||
return false, nil |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can we remove bool?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the func initJobStatus in createJob need UpdateStatus, if remove bool, will go on UpdateStatus and return err
let split this huge PR into some smaller ones:
Each PR should include UT for it. |
@wangyuqing4: PR needs rebase. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
Which issue(s) this PR fixes :
Fixes #135 #134
Special notes for your reviewer:
new func AdmitPod in admission controller
new PGcontroller in controller
delete Inqueue job phase
fix UT
Release note: