Skip to content

Commit 98cdc61

Browse files
authored
Merge pull request #476 from jpedro1992/configs
networkAware update configs
2 parents 5020c0f + 658ed84 commit 98cdc61

File tree

18 files changed

+545
-43
lines changed

18 files changed

+545
-43
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ The kube-scheduler binary includes the below list of plugins. They can be config
3232
* [Node Resource Topology](pkg/noderesourcetopology/README.md)
3333
* [Preemption Toleration](pkg/preemptiontoleration/README.md)
3434
* [Trimaran](pkg/trimaran/README.md)
35+
* [Network-Aware Scheduling](pkg/networkaware/README.md)
3536

3637
Additionally, the kube-scheduler binary includes the below list of sample plugins. These plugins are not intended for use in production
3738
environments.

cmd/scheduler/main.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,8 @@ func main() {
4646
app.WithPlugin(capacityscheduling.Name, capacityscheduling.New),
4747
app.WithPlugin(coscheduling.Name, coscheduling.New),
4848
app.WithPlugin(loadvariationriskbalancing.Name, loadvariationriskbalancing.New),
49+
app.WithPlugin(networkoverhead.Name, networkoverhead.New),
50+
app.WithPlugin(topologicalsort.Name, topologicalsort.New),
4951
app.WithPlugin(noderesources.AllocatableName, noderesources.NewAllocatable),
5052
app.WithPlugin(noderesourcetopology.Name, noderesourcetopology.New),
5153
app.WithPlugin(preemptiontoleration.Name, preemptiontoleration.New),
@@ -54,8 +56,6 @@ func main() {
5456
// app.WithPlugin(crossnodepreemption.Name, crossnodepreemption.New),
5557
app.WithPlugin(podstate.Name, podstate.New),
5658
app.WithPlugin(qos.Name, qos.New),
57-
app.WithPlugin(networkoverhead.Name, networkoverhead.New),
58-
app.WithPlugin(topologicalsort.Name, topologicalsort.New),
5959
)
6060

6161
code := cli.Run(command)

kep/260-network-aware-scheduling/README.md

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1486,7 +1486,10 @@ Unit tests and Integration tests will be added:
14861486
# Graduation criteria
14871487

14881488
- Alpha
1489-
- [ ] The implementation of the AppGroup controller (AppGroup CRD).
1489+
- [ ] The design and implementation of the [AppGroup CRD](https://github.com/diktyo-io/appgroup-api).
1490+
- [ ] The design and implementation of the [NetworkTopology CRD](https://github.com/diktyo-io/networktopology-api).
1491+
- [ ] The implementation of the [AppGroup controller](https://github.com/diktyo-io/appgroup-controller) (AppGroup CRD).
1492+
- [ ] The implementation of the [NetworkTopology controller](https://github.com/diktyo-io/networktopology-controller) (NetworkTopology CRD).
14901493
- [ ] The development of the bandwidth resource component.
14911494
- [ ] The implementation of the `TopologicalSort` plugin.
14921495
- [ ] The implementation of the `NetworkOverhead` plugin.
@@ -1503,4 +1506,6 @@ Received feedback and comments on the design and implementation. Recording avail
15031506
- 2021-11-4: Initial KEP sent out for review, including Summary, Motivation, Proposal, Test plans and Graduation criteria.
15041507
- 2022-01-11: KEP v0.1 sent out for review after receiving feedback on the initial KEP.
15051508
- 2022-01-19: KEP v0.1 revised after feedback. Further details added.
1506-
- 2022-02-02: KEP v0.1 updated after revision. Further API modifications.
1509+
- 2022-02-02: KEP v0.1 updated after revision. Further API modifications.
1510+
- 2022-09-06: Creation of the [Diktyo-io community](https://github.com/diktyo-io) for releasing additional network-aware components.
1511+
- 2022-12-08: Initial [PR](https://github.com/kubernetes-sigs/scheduler-plugins/pull/432) merged in sig-scheduling.
Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
# first: create namespace and service account
2+
apiVersion: v1
3+
kind: Namespace
4+
metadata:
5+
name: network-aware-controllers
6+
---
7+
apiVersion: v1
8+
kind: ServiceAccount
9+
metadata:
10+
name: appgroup-controller
11+
namespace: network-aware-controllers
12+
---
13+
# second: rbac
14+
kind: ClusterRole
15+
apiVersion: rbac.authorization.k8s.io/v1
16+
metadata:
17+
name: appgroup-controller
18+
rules:
19+
- apiGroups: [""]
20+
resources: ["pods"]
21+
verbs: ["get", "list", "watch"]
22+
- apiGroups: ["appgroup.diktyo.k8s.io"]
23+
resources: ["appgroups"]
24+
verbs: ["get", "list", "watch", "create", "delete", "update", "patch"]
25+
---
26+
kind: ClusterRoleBinding
27+
apiVersion: rbac.authorization.k8s.io/v1
28+
metadata:
29+
name: appgroup-controller
30+
subjects:
31+
- kind: ServiceAccount
32+
name: appgroup-controller
33+
namespace: network-aware-controllers
34+
roleRef:
35+
kind: ClusterRole
36+
name: appgroup-controller
37+
apiGroup: rbac.authorization.k8s.io
38+
---
39+
# third: deployment
40+
# Please check the repo for further info: https://github.com/diktyo-io/appgroup-controller
41+
kind: Deployment
42+
apiVersion: apps/v1
43+
metadata:
44+
name: appgroup-controller
45+
namespace: network-aware-controllers
46+
labels:
47+
app: appgroup-controller
48+
spec:
49+
replicas: 1
50+
selector:
51+
matchLabels:
52+
app: appgroup-controller
53+
template:
54+
metadata:
55+
labels:
56+
app: appgroup-controller
57+
spec:
58+
serviceAccountName: appgroup-controller
59+
containers:
60+
- name: appgroup-controller
61+
image: localhost:5000/appgroup-controller/controller:latest
62+
command:
63+
- /bin/controller
64+
imagePullPolicy: IfNotPresent

manifests/appgroup/cluster-role.yaml

Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
apiVersion: v1
2+
kind: ServiceAccount
3+
metadata:
4+
name: network-aware-scheduler
5+
namespace: kube-system
6+
---
7+
apiVersion: rbac.authorization.k8s.io/v1
8+
kind: ClusterRole
9+
metadata:
10+
name: network-aware-scheduler-handler
11+
rules:
12+
- apiGroups: [ "scheduling.sigs.k8s.io" ]
13+
resources: [ "podgroups", "elasticquotas", "podgroups/status", "elasticquotas/status" ]
14+
verbs: [ "get", "list", "watch", "create", "delete", "update", "patch" ]
15+
- apiGroups: ["appgroup.diktyo.k8s.io"]
16+
resources: ["appgroups"]
17+
verbs: ["get", "list", "watch", "create", "delete", "update", "patch"]
18+
- apiGroups: ["networktopology.diktyo.k8s.io"]
19+
resources: ["networktopologies"]
20+
verbs: ["get", "list", "watch", "create", "delete", "update", "patch"]
21+
---
22+
apiVersion: rbac.authorization.k8s.io/v1
23+
kind: ClusterRoleBinding
24+
metadata:
25+
name: network-aware-scheduler-as-kube-scheduler
26+
subjects:
27+
- kind: ServiceAccount
28+
name: network-aware-scheduler
29+
namespace: kube-system
30+
roleRef:
31+
kind: ClusterRole
32+
name: network-aware-scheduler-handler
33+
apiGroup: rbac.authorization.k8s.io
34+
---
35+
apiVersion: rbac.authorization.k8s.io/v1
36+
kind: ClusterRoleBinding
37+
metadata:
38+
name: my-scheduler-as-volume-scheduler
39+
subjects:
40+
- kind: ServiceAccount
41+
name: my-scheduler
42+
namespace: kube-system
43+
roleRef:
44+
kind: ClusterRole
45+
name: system:volume-scheduler
46+
apiGroup: rbac.authorization.k8s.io
47+
---
48+
apiVersion: rbac.authorization.k8s.io/v1
49+
kind: RoleBinding
50+
metadata:
51+
name: network-aware-scheduler-as-kube-scheduler
52+
namespace: kube-system
53+
subjects:
54+
- kind: ServiceAccount
55+
name: network-aware-scheduler
56+
namespace: kube-system
57+
roleRef:
58+
kind: Role
59+
name: extension-apiserver-authentication-reader
60+
apiGroup: rbac.authorization.k8s.io
61+
---
62+
apiVersion: rbac.authorization.k8s.io/v1
63+
kind: ClusterRoleBinding
64+
metadata:
65+
name: networkawarescheduler
66+
namespace: kube-system
67+
subjects:
68+
- kind: User
69+
name: system:kube-scheduler
70+
namespace: kube-system
71+
apiGroup: rbac.authorization.k8s.io
72+
roleRef:
73+
kind: ClusterRole
74+
name: network-aware-scheduler-handler
75+
apiGroup: rbac.authorization.k8s.io

manifests/appgroup/deploy.yaml

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
apiVersion: apps/v1
2+
kind: Deployment
3+
metadata:
4+
labels:
5+
component: scheduler
6+
tier: control-plane
7+
name: network-aware-scheduler
8+
namespace: kube-system
9+
spec:
10+
selector:
11+
matchLabels:
12+
component: scheduler
13+
tier: control-plane
14+
replicas: 1
15+
template:
16+
metadata:
17+
labels:
18+
component: scheduler
19+
tier: control-plane
20+
version: second
21+
spec:
22+
nodeSelector:
23+
node-role.kubernetes.io/master: ""
24+
serviceAccountName: network-aware-scheduler
25+
containers:
26+
- image: localhost:5000/scheduler-plugins/kube-scheduler:latest
27+
imagePullPolicy: Never
28+
command:
29+
- /bin/kube-scheduler
30+
- --authentication-kubeconfig=/etc/kubernetes/scheduler.conf
31+
- --authorization-kubeconfig=/etc/kubernetes/scheduler.conf
32+
- --config=/etc/kubernetes/scheduler-config/scheduler-config.yaml
33+
name: scheduler
34+
securityContext:
35+
privileged: false
36+
volumeMounts:
37+
- mountPath: /etc/kubernetes/scheduler.conf
38+
name: kubeconfig
39+
- mountPath: /etc/kubernetes/scheduler-config
40+
name: network-aware-scheduler-config-vol
41+
hostNetwork: false
42+
hostPID: false
43+
volumes:
44+
- hostPath:
45+
path: /etc/kubernetes/scheduler.conf
46+
type: File
47+
name: kubeconfig
48+
- configMap:
49+
name: network-aware-scheduler-config
50+
name: network-aware-scheduler-config-vol

manifests/appgroup/scheduler-config.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,9 @@ profiles:
1212
- name: TopologicalSort
1313
disabled:
1414
- name: "*"
15+
preFilter:
16+
enabled:
17+
- name: NetworkOverhead
1518
filter:
1619
enabled:
1720
- name: NetworkOverhead
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
apiVersion: v1
2+
kind: ConfigMap
3+
metadata:
4+
name: network-aware-scheduler-config
5+
namespace: kube-system
6+
data:
7+
scheduler-config.yaml: |
8+
apiVersion: kubescheduler.config.k8s.io/v1beta3
9+
kind: KubeSchedulerConfiguration
10+
leaderElection:
11+
leaderElect: false
12+
clientConnection:
13+
kubeconfig: "/etc/kubernetes/scheduler.conf"
14+
profiles:
15+
- schedulerName: network-aware-scheduler
16+
plugins:
17+
queueSort:
18+
enabled:
19+
- name: TopologicalSort
20+
disabled:
21+
- name: "*"
22+
preFilter:
23+
enabled:
24+
- name: NetworkOverhead
25+
filter:
26+
enabled:
27+
- name: NetworkOverhead
28+
score:
29+
disabled: # Preferably avoid the combination of NodeResourcesFit with NetworkOverhead
30+
- name: NodeResourcesFit
31+
enabled: # A higher weight is given to NetworkOverhead to favor allocation schemes with lower latency.
32+
- name: NetworkOverhead
33+
weight: 5
34+
pluginConfig:
35+
- name: TopologicalSort
36+
args:
37+
namespaces:
38+
- "default"
39+
- name: NetworkOverhead
40+
args:
41+
namespaces:
42+
- "default"
43+
weightsName: "UserDefined" # or "NetperfCosts"
44+
networkTopologyName: "net-topology-test"

manifests/install/all-in-one.yaml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,13 @@ rules:
88
- apiGroups: ["scheduling.sigs.k8s.io"]
99
resources: ["podgroups", "elasticquotas", "podgroups/status", "elasticquotas/status"]
1010
verbs: ["get", "list", "watch", "create", "delete", "update", "patch"]
11+
# for network-aware plugins add the following lines (scheduler-plugins v.0.24.9)
12+
#- apiGroups: [ "appgroup.diktyo.k8s.io" ]
13+
# resources: [ "appgroups" ]
14+
# verbs: [ "get", "list", "watch", "create", "delete", "update", "patch" ]
15+
#- apiGroups: [ "networktopology.diktyo.k8s.io" ]
16+
# resources: [ "networktopologies" ]
17+
# verbs: [ "get", "list", "watch", "create", "delete", "update", "patch" ]
1118
---
1219
kind: ClusterRoleBinding
1320
apiVersion: rbac.authorization.k8s.io/v1

manifests/install/charts/as-a-second-scheduler/templates/rbac.yaml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,13 @@ rules:
6666
- apiGroups: ["scheduling.sigs.k8s.io"]
6767
resources: ["podgroups", "elasticquotas", "podgroups/status", "elasticquotas/status"]
6868
verbs: ["get", "list", "watch", "create", "delete", "update", "patch"]
69+
# for network-aware plugins add the following lines (scheduler-plugins v.0.24.9)
70+
#- apiGroups: [ "appgroup.diktyo.k8s.io" ]
71+
# resources: [ "appgroups" ]
72+
# verbs: [ "get", "list", "watch", "create", "delete", "update", "patch" ]
73+
#- apiGroups: [ "networktopology.diktyo.k8s.io" ]
74+
# resources: [ "networktopologies" ]
75+
# verbs: [ "get", "list", "watch", "create", "delete", "update", "patch" ]
6976
---
7077
kind: ClusterRoleBinding
7178
apiVersion: rbac.authorization.k8s.io/v1

0 commit comments

Comments
 (0)