-
Notifications
You must be signed in to change notification settings - Fork 38.7k
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
apiVersion: v1 | ||
kind: Namespace | ||
metadata: | ||
labels: | ||
team: devops |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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 | ||
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 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Duplicated with L553? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. duplicates should be L627 and L553 instead of here. There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 |
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.
or maybe something like this?
countParam: $measureNamespaces
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 parameter is not reused across workloads, we want to explicitly use a single namespace, hence its hardcoded.