-
Notifications
You must be signed in to change notification settings - Fork 485
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
ElasticQuota of Capacity Scheduling Api define #50
ElasticQuota of Capacity Scheduling Api define #50
Conversation
7a3dfe3
to
099ba2d
Compare
df1762a
to
ed186dc
Compare
- name: CapacityScheduling | ||
postFilter: | ||
enabled: | ||
- name: CapacityScheduling |
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.
Need to disable the default preemption plugin.
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.
Done thanks ~
b9b7a32
to
cec6343
Compare
dc7d63d
to
418b521
Compare
/cc @xq2005 |
@denkensk: GitHub didn't allow me to request PR reviews from the following users: xq2005. Note that only kubernetes-sigs members and repo collaborators can review this PR, and authors cannot review their own PRs. In response to this:
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. |
@denkensk can you split this PR into two sub-PRs? One is the API and codegen, and the second one to cover core logic and tests. |
418b521
to
4a28ec8
Compare
Thanks. I update the pr. It's easy to review. |
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 @denkensk ! Comments below.
manifests/capacityscheduling/capacityscheduling_v1alpha1_elasticquota.yaml
Outdated
Show resolved
Hide resolved
hack/update-codegen.sh
Outdated
@@ -33,5 +33,5 @@ bash "${CODEGEN_PKG}"/generate-groups.sh \ | |||
all \ | |||
sigs.k8s.io/scheduler-plugins/pkg/generated \ | |||
sigs.k8s.io/scheduler-plugins/pkg/apis \ | |||
podgroup:v1alpha1 \ | |||
--go-header-file "${SCRIPT_ROOT}"/hack/boilerplate/boilerplate.generatego.txt | |||
"podgroup:v1alpha1 capacityscheduling:v1alpha1" \ |
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.
resourcequota:v1alpha1? In general introduction, we can say we're doing capacity scheduling, however, to make it a concrete concept/API, let's name it resourcequota.
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.
elasticquota
?
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.
Yes. elasticquota
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.
Yes, typo...
manifests/capacityscheduling/capacityscheduling_v1alpha1_elasticquota.yaml
Outdated
Show resolved
Hide resolved
manifests/capacityscheduling/capacityscheduling_v1alpha1_elasticquota.yaml
Outdated
Show resolved
Hide resolved
@@ -0,0 +1,4 @@ | |||
// +k8s:deepcopy-gen=package | |||
// +groupName=capacityscheduling.sigs.k8s.io |
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.
// +groupName=capacityscheduling.sigs.k8s.io | |
// +groupName=scheduling.sigs.k8s.io |
pkg/apis/config/v1beta1/types.go
Outdated
metav1.TypeMeta `json:",inline"` | ||
|
||
// KubeConfigPath is the path of kubeconfig. | ||
KubeConfigPath string `json:"kubeconfigpath,omitempty"` |
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.
nit: make it a *string in versioned pkg, so we can easily set a default value if it's nil; if it's a concrete string, we cannot tell if the zero value ("") is set by users.
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 general, we can set the default parameters in default.go
for all plugins: CoScheduling, NodeResouresAllocatable, CapacityScheduling.
Something like
func (csa *CapacitySchedulingArgs) SetDefaults() {
defaultPath := "/var/lib/kubernetes/kubeconfig"
if csa.KubeConfigPath == nil {
csa.KubeConfigPath = &defaultPath
}
...
We can then validate the parameters in validation.go
.
// Validate checks and verifies the configuration parameters.
func (conf *CapacitySchedulingArgs) Validate() Error
...
}
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.
line 55: // An example resource set might includes "cpu" (millicores) and "memory" (bytes)
includes -> include
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.
line 55: // An example resource set might includes "cpu" (millicores) and "memory" (bytes)
thanks. I address it together in this pr.
In general, we can set the default parameters default.go for all plugins: CoScheduling, NodeResouresAllocatable, CapacityScheduling.
Done
828dda5
to
88c2dea
Compare
@denkensk: Reopened this PR. In response to this:
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. |
@Huang-Wei @yuanchen8911 |
hack/update-codegen.sh
Outdated
podgroup:v1alpha1 \ | ||
--go-header-file "${SCRIPT_ROOT}"/hack/boilerplate/boilerplate.generatego.txt | ||
"scheduling:v1alpha1" \ | ||
--go-header-file "${SCRIPT_ROOT}"/hack/boilerplate/boilerplate.generatego.txt |
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.
Keep the ending character.
d1914c9
to
246ea08
Compare
/cc @Huang-Wei |
09a84c7
to
fd0cc56
Compare
pkg/apis/config/types.go
Outdated
metav1.TypeMeta | ||
|
||
// KubeConfigPath is the path of kubeconfig. | ||
KubeConfigPath *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.
Let's make it (internal version) 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.
Done
fd0cc56
to
457a643
Compare
pkg/controller/podgroup.go
Outdated
pgclientset "sigs.k8s.io/scheduler-plugins/pkg/generated/clientset/versioned" | ||
pginformer "sigs.k8s.io/scheduler-plugins/pkg/generated/informers/externalversions/podgroup/v1alpha1" | ||
pglister "sigs.k8s.io/scheduler-plugins/pkg/generated/listers/podgroup/v1alpha1" | ||
schedulingv1alpha1 "sigs.k8s.io/scheduler-plugins/pkg/apis/scheduling/v1alpha1" |
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.
nit: the aliases can be shortened to "schedXYZ" (save us 5 characters :))
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.
Done
457a643
to
1e13f94
Compare
@Huang-Wei |
1e13f94
to
312c38d
Compare
Thanks! /lgtm |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: denkensk, Huang-Wei The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
doc: resync.md: Document release branch upstream resync strategy
Add Capacity Scheduling plugin for the new scheduler framework.
This plugin will be put in kubernetes-sigs/scheduler-plugins firstly.
Kep : #10