Skip to content
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

Added benchmarks for pod affinity NamespaceSelector #101329

Merged
merged 1 commit into from
Apr 26, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
apiVersion: v1
kind: Namespace
metadata:
labels:
team: devops
146 changes: 146 additions & 0 deletions test/integration/scheduler_perf/config/performance-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -475,3 +475,149 @@
params:
initNodes: 5000
measurePods: 2000

- name: SchedulingRequiredPodAntiAffinityWithNSSelector
featureGates:
PodAffinityNamespaceSelector: true
workloadTemplate:
- opcode: createNodes
countParam: $initNodes
uniqueNodeLabelStrategy:
labelKey: kubernetes.io/hostname
- opcode: createNamespaces
prefix: init-ns
countParam: $initNamespaces
namespaceTemplatePath: config/namespace-with-labels.yaml
- opcode: createNamespaces
prefix: measure-ns
count: 1
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

or maybe something like this?

countParam: $measureNamespaces

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the parameter is not reused across workloads, we want to explicitly use a single namespace, hence its hardcoded.

namespaceTemplatePath: config/namespace-with-labels.yaml
- opcode: createPodSets
countParam: $initNamespaces
namespacePrefix: init-ns
createPodsOp:
opcode: createPods
countParam: $initPodsPerNamespace
podTemplatePath: config/pod-anti-affinity-ns-selector.yaml
- opcode: createPods
countParam: $measurePods
podTemplatePath: config/pod-anti-affinity-ns-selector.yaml
collectMetrics: true
namespace: measure-ns-0
workloads:
- name: 5000Nodes
params:
initNodes: 5000
initPodsPerNamespace: 40
initNamespaces: 100
measurePods: 1000

- name: SchedulingPreferredAntiAffinityWithNSSelector
featureGates:
PodAffinityNamespaceSelector: true
workloadTemplate:
- opcode: createNodes
countParam: $initNodes
uniqueNodeLabelStrategy:
labelKey: kubernetes.io/hostname
- opcode: createNamespaces
prefix: init-ns
countParam: $initNamespaces
namespaceTemplatePath: config/namespace-with-labels.yaml
- opcode: createNamespaces
prefix: measure-ns
count: 1
namespaceTemplatePath: config/namespace-with-labels.yaml
- opcode: createPodSets
countParam: $initNamespaces
namespacePrefix: init-ns
createPodsOp:
opcode: createPods
countParam: $initPodsPerNamespace
podTemplatePath: config/pod-preferred-anti-affinity-ns-selector.yaml
- opcode: createPods
countParam: $measurePods
podTemplatePath: config/pod-preferred-anti-affinity-ns-selector.yaml
collectMetrics: true
namespace: measure-ns-0
workloads:
- name: 5000Nodes
params:
initNodes: 5000
initPodsPerNamespace: 40
initNamespaces: 100
measurePods: 1000

ahg-g marked this conversation as resolved.
Show resolved Hide resolved
- name: SchedulingRequiredPodAffinityWithNSSelector
featureGates:
PodAffinityNamespaceSelector: true
workloadTemplate:
- opcode: createNodes
countParam: $initNodes
labelNodePrepareStrategy:
labelKey: "topology.kubernetes.io/zone"
labelValues: ["zone1"]
- opcode: createNamespaces
prefix: init-ns
countParam: $initNamespaces
namespaceTemplatePath: config/namespace-with-labels.yaml
- opcode: createNamespaces
prefix: measure-ns
count: 1
namespaceTemplatePath: config/namespace-with-labels.yaml
- opcode: createPodSets
countParam: $initNamespaces
namespacePrefix: init-ns
createPodsOp:
opcode: createPods
countParam: $initPodsPerNamespace
podTemplatePath: config/pod-affinity-ns-selector.yaml
- opcode: createPods
countParam: $measurePods
podTemplatePath: config/pod-affinity-ns-selector.yaml
collectMetrics: true
namespace: measure-ns-0
workloads:
- name: 5000Nodes
params:
initNodes: 5000
initPodsPerNamespace: 50
initNamespaces: 100
measurePods: 1000

- name: SchedulingPreferredAffinityWithNSSelector
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Duplicated with L553?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

duplicates should be L627 and L553 instead of here.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yup, removed the duplicate.

featureGates:
PodAffinityNamespaceSelector: true
workloadTemplate:
- opcode: createNodes
countParam: $initNodes
uniqueNodeLabelStrategy:
labelKey: kubernetes.io/hostname
- opcode: createNamespaces
prefix: init-ns
countParam: $initNamespaces
namespaceTemplatePath: config/namespace-with-labels.yaml
- opcode: createNamespaces
prefix: measure-ns
count: 1
namespaceTemplatePath: config/namespace-with-labels.yaml
- opcode: createPodSets
countParam: $initNamespaces
namespacePrefix: init-ns
createPodsOp:
opcode: createPods
countParam: $initPodsPerNamespace
podTemplatePath: config/pod-preferred-affinity-ns-selector.yaml
- opcode: createPods
countParam: $measurePods
podTemplatePath: config/pod-preferred-affinity-ns-selector.yaml
collectMetrics: true
namespace: measure-ns-0
workloads:
- name: 5000Nodes
params:
initNodes: 5000
initPodsPerNamespace: 50
initNamespaces: 100
measurePods: 1000

Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
apiVersion: v1
kind: Pod
metadata:
generateName: affinity-pod-
labels:
color: blue
spec:
affinity:
podAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
- labelSelector:
matchLabels:
color: blue
topologyKey: topology.kubernetes.io/zone
namespaceSelector:
matchLabels:
team: devops
containers:
- image: k8s.gcr.io/pause:3.4.1
name: pause
ports:
- containerPort: 80
resources:
limits:
cpu: 100m
memory: 500Mi
requests:
cpu: 100m
memory: 500Mi
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
apiVersion: v1
kind: Pod
metadata:
generateName: anti-affinity-pod-
labels:
color: green
spec:
affinity:
podAntiAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
- labelSelector:
matchLabels:
color: green
topologyKey: kubernetes.io/hostname
namespaceSelector:
matchLabels:
team: devops
containers:
- image: k8s.gcr.io/pause:3.4.1
name: pause
ports:
- containerPort: 80
resources:
limits:
cpu: 100m
memory: 500Mi
requests:
cpu: 100m
memory: 500Mi
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
apiVersion: v1
kind: Pod
metadata:
generateName: preferred-affinity-pod-
labels:
color: red
spec:
affinity:
podAffinity:
preferredDuringSchedulingIgnoredDuringExecution:
- podAffinityTerm:
labelSelector:
matchLabels:
color: red
topologyKey: kubernetes.io/hostname
namespaceSelector:
matchLabels:
team: devops
weight: 1
containers:
- image: k8s.gcr.io/pause:3.4.1
name: pause
ports:
- containerPort: 80
resources:
limits:
cpu: 100m
memory: 500Mi
requests:
cpu: 100m
memory: 500Mi
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
apiVersion: v1
kind: Pod
metadata:
generateName: anti-affinity-pod-
labels:
color: green
spec:
affinity:
podAntiAffinity:
preferredDuringSchedulingIgnoredDuringExecution:
- podAffinityTerm:
labelSelector:
matchLabels:
color: green
topologyKey: kubernetes.io/hostname
namespaceSelector:
matchLabels:
team: devops
weight: 1
containers:
- image: k8s.gcr.io/pause:3.4.1
name: pause
ports:
- containerPort: 80
resources:
limits:
cpu: 100m
memory: 500Mi
requests:
cpu: 100m
memory: 500Mi