generated from kubernetes/kubernetes-template-project
-
Notifications
You must be signed in to change notification settings - Fork 485
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
capacity scheduling on framework api define
- Loading branch information
Showing
61 changed files
with
2,098 additions
and
121 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
apiVersion: apiextensions.k8s.io/v1 | ||
kind: CustomResourceDefinition | ||
metadata: | ||
name: elasticquotas.scheduling.sigs.k8s.io | ||
spec: | ||
group: scheduling.sigs.k8s.io | ||
versions: | ||
- name: v1alpha1 | ||
served: true | ||
storage: true | ||
scope: Namespaced | ||
names: | ||
plural: elasticquotas | ||
singular: elasticquota | ||
kind: ElasticQuota | ||
shortNames: | ||
- eq | ||
- eqs | ||
validation: | ||
openAPIV3Schema: | ||
type: object | ||
properties: | ||
spec: | ||
type: object | ||
properties: | ||
min: | ||
type: object | ||
max: | ||
type: object | ||
status: | ||
type: object | ||
properties: | ||
used: | ||
type: object |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
apiVersion: scheduling.sigs.k8s.io/v1alpha1 | ||
kind: ElasticQuota | ||
metadata: | ||
name: test | ||
namespace: test | ||
spec: | ||
max: | ||
cpu: 20 | ||
memory: 40Gi | ||
nvidia.com/gpu: 2 | ||
min: | ||
cpu: 10 | ||
memory: 20Gi | ||
nvidia.com/gpu: 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
apiVersion: kubescheduler.config.k8s.io/v1beta1 | ||
kind: KubeSchedulerConfiguration | ||
leaderElection: | ||
leaderElect: false | ||
clientConnection: | ||
kubeconfig: "REPLACE_ME_WITH_KUBE_CONFIG_PATH" | ||
profiles: | ||
- schedulerName: default-scheduler | ||
plugins: | ||
preFilter: | ||
enabled: | ||
- name: CapacityScheduling | ||
postFilter: | ||
enabled: | ||
- name: CapacityScheduling | ||
disabled: | ||
- name: "*" | ||
reserve: | ||
enabled: | ||
- name: CapacityScheduling | ||
pluginConfig: | ||
- name: CapacityScheduling | ||
args: | ||
kubeConfigPath: "REPLACE_ME_WITH_KUBE_CONFIG_PATH" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
/* | ||
Copyright 2020 The Kubernetes Authors. | ||
Licensed under the Apache License, Version 2.0 (the "License"); | ||
you may not use this file except in compliance with the License. | ||
You may obtain a copy of the License at | ||
http://www.apache.org/licenses/LICENSE-2.0 | ||
Unless required by applicable law or agreed to in writing, software | ||
distributed under the License is distributed on an "AS IS" BASIS, | ||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
See the License for the specific language governing permissions and | ||
limitations under the License. | ||
*/ | ||
|
||
package capacity | ||
|
||
// GroupName is the group name used in this package | ||
const ( | ||
GroupName = "capacity.sigs.k8s.io" | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
/* | ||
Copyright 2020 The Kubernetes Authors. | ||
Licensed under the Apache License, Version 2.0 (the "License"); | ||
you may not use this file except in compliance with the License. | ||
You may obtain a copy of the License at | ||
http://www.apache.org/licenses/LICENSE-2.0 | ||
Unless required by applicable law or agreed to in writing, software | ||
distributed under the License is distributed on an "AS IS" BASIS, | ||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
See the License for the specific language governing permissions and | ||
limitations under the License. | ||
*/ | ||
|
||
// +k8s:deepcopy-gen=package | ||
// +groupName=capacity.sigs.k8s.io | ||
|
||
// Package v1alpha1 is the v1alpha1 version of the API. | ||
package v1alpha1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
/* | ||
Copyright 2020 The Kubernetes Authors. | ||
Licensed under the Apache License, Version 2.0 (the "License"); | ||
you may not use this file except in compliance with the License. | ||
You may obtain a copy of the License at | ||
http://www.apache.org/licenses/LICENSE-2.0 | ||
Unless required by applicable law or agreed to in writing, software | ||
distributed under the License is distributed on an "AS IS" BASIS, | ||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
See the License for the specific language governing permissions and | ||
limitations under the License. | ||
*/ | ||
|
||
package v1alpha1 | ||
|
||
import ( | ||
v1 "k8s.io/api/core/v1" | ||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" | ||
) | ||
|
||
// +genclient | ||
// +genclient:noStatus | ||
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object | ||
|
||
// ElasticQuota sets elastic quota restrictions per namespace | ||
type ElasticQuota struct { | ||
metav1.TypeMeta `json:",inline"` | ||
|
||
// Standard object's metadata. | ||
// +optional | ||
metav1.ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` | ||
|
||
// ElasticQuotaSpec defines the Min and Max for Quota. | ||
// +optional | ||
Spec ElasticQuotaSpec `json:"spec,omitempty" protobuf:"bytes,2,opt,name=spec"` | ||
|
||
// ElasticQuotaStatus defines the observed use. | ||
// +optional | ||
Status ElasticQuotaStatus `json:"status,omitempty" protobuf:"bytes,3,opt,name=status"` | ||
} | ||
|
||
// ElasticQuotaSpec defines the Min and Max for Quota. | ||
type ElasticQuotaSpec struct { | ||
// Min is the set of desired guaranteed limits for each named resource. | ||
// +optional | ||
Min v1.ResourceList `json:"min,omitempty" protobuf:"bytes,1,rep,name=min, casttype=ResourceList,castkey=ResourceName"` | ||
|
||
// Max is the set of desired max limits for each named resource. The usage of max is based on the resource configurations of | ||
// successfully scheduled pods. | ||
// +optional | ||
Max v1.ResourceList `json:"max,omitempty" protobuf:"bytes,2,rep,name=max, casttype=ResourceList,castkey=ResourceName"` | ||
} | ||
|
||
// ElasticQuotaStatus defines the observed use. | ||
type ElasticQuotaStatus struct { | ||
// Used is the current observed total usage of the resource in the namespace. | ||
// +optional | ||
Used v1.ResourceList `json:"used,omitempty" protobuf:"bytes,1,rep,name=used,casttype=ResourceList,castkey=ResourceName"` | ||
} | ||
|
||
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object | ||
|
||
// ElasticQuotaList is a list of ElasticQuota items. | ||
type ElasticQuotaList struct { | ||
metav1.TypeMeta `json:",inline"` | ||
|
||
// Standard list metadata. | ||
// +optional | ||
metav1.ListMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` | ||
|
||
// Items is a list of ElasticQuota objects. | ||
Items []ElasticQuota `json:"items" protobuf:"bytes,2,rep,name=items"` | ||
} |
71 changes: 37 additions & 34 deletions
71
...odgroup/v1alpha1/zz_generated.deepcopy.go → ...apacity/v1alpha1/zz_generated.deepcopy.go
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.