Skip to content

Commit

Permalink
Implementing topology spread constraints (kube-burner#497)
Browse files Browse the repository at this point in the history
Signed-off-by: Raul Sevilla <[email protected]>
Co-authored-by: vishnuchalla <[email protected]>
  • Loading branch information
rsevilla87 and vishnuchalla committed Nov 7, 2023
1 parent 16acaa9 commit b44f9ba
Show file tree
Hide file tree
Showing 13 changed files with 85 additions and 15 deletions.
12 changes: 10 additions & 2 deletions cmd/kube-burner/ocp-config/cluster-density-ms/deployment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,20 @@ spec:
replicas: {{.podReplicas}}
selector:
matchLabels:
app: cluster-density-{{.Replica}}
name: cluster-density-{{.Replica}}
template:
metadata:
labels:
app: cluster-density-{{.Replica}}
name: cluster-density-{{.Replica}}
app: cluster-density-ms
spec:
topologySpreadConstraints:
- maxSkew: 1
topologyKey: kubernetes.io/hostname
whenUnsatisfiable: ScheduleAnyway
labelSelector:
matchLabels:
app: cluster-density-ms
affinity:
nodeAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
Expand Down
2 changes: 1 addition & 1 deletion cmd/kube-burner/ocp-config/cluster-density-ms/service.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ metadata:
name: cluster-density-{{.Replica}}
spec:
selector:
app: cluster-density-{{.Replica}}
name: cluster-density-{{.Replica}}
ports:
- name: http
protocol: TCP
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,20 @@ spec:
replicas: {{.podReplicas}}
selector:
matchLabels:
app: client-{{.Replica}}
name: client-{{.Replica}}
template:
metadata:
labels:
app: client-{{.Replica}}
name: client
name: client-{{.Replica}}
app: client
spec:
topologySpreadConstraints:
- maxSkew: 1
topologyKey: kubernetes.io/hostname
whenUnsatisfiable: ScheduleAnyway
labelSelector:
matchLabels:
app: client
affinity:
nodeAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,20 @@ spec:
replicas: {{.podReplicas}}
selector:
matchLabels:
app: cluster-density-{{.Replica}}
name: cluster-density-{{.Replica}}
template:
metadata:
labels:
app: cluster-density-{{.Replica}}
name: nginx
name: cluster-density-{{.Replica}}
app: nginx
spec:
topologySpreadConstraints:
- maxSkew: 1
topologyKey: kubernetes.io/hostname
whenUnsatisfiable: ScheduleAnyway
labelSelector:
matchLabels:
app: nginx
affinity:
nodeAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ metadata:
spec:
podSelector:
matchLabels:
name: nginx
app: nginx
ingress:
- from:
- namespaceSelector:
Expand Down
2 changes: 1 addition & 1 deletion cmd/kube-burner/ocp-config/cluster-density-v2/service.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ metadata:
name: cluster-density-{{.Replica}}
spec:
selector:
name: nginx
app: nginx
ports:
- name: http
protocol: TCP
Expand Down
12 changes: 10 additions & 2 deletions cmd/kube-burner/ocp-config/cluster-density/deployment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,20 @@ spec:
replicas: {{.podReplicas}}
selector:
matchLabels:
app: cluster-density-{{.Replica}}
name: cluster-density-{{.Replica}}
template:
metadata:
labels:
app: cluster-density-{{.Replica}}
name: cluster-density-{{.Replica}}
app: cluster-density
spec:
topologySpreadConstraints:
- maxSkew: 1
topologyKey: kubernetes.io/hostname
whenUnsatisfiable: ScheduleAnyway
labelSelector:
matchLabels:
app: cluster-density
affinity:
nodeAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
Expand Down
2 changes: 1 addition & 1 deletion cmd/kube-burner/ocp-config/cluster-density/service.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ metadata:
name: cluster-density-{{.Replica}}
spec:
selector:
app: cluster-density-{{.Replica}}
name: cluster-density-{{.Replica}}
ports:
- name: http
protocol: TCP
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,15 @@ spec:
metadata:
labels:
name: curl-{{.Replica}}-{{.Iteration}}
app: curl
spec:
topologySpreadConstraints:
- maxSkew: 1
topologyKey: kubernetes.io/hostname
whenUnsatisfiable: ScheduleAnyway
labelSelector:
matchLabels:
app: curl
affinity:
nodeAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,15 @@ spec:
metadata:
labels:
name: webserver-{{.Replica}}-{{.Iteration}}
app: webserver
spec:
topologySpreadConstraints:
- maxSkew: 1
topologyKey: kubernetes.io/hostname
whenUnsatisfiable: ScheduleAnyway
labelSelector:
matchLabels:
app: webserver
affinity:
nodeAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,15 @@ spec:
metadata:
labels:
name: perfapp-{{.Replica}}-{{.Iteration}}
app: perfapp
spec:
topologySpreadConstraints:
- maxSkew: 1
topologyKey: kubernetes.io/hostname
whenUnsatisfiable: ScheduleAnyway
labelSelector:
matchLabels:
app: perfapp
affinity:
nodeAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,15 @@ spec:
metadata:
labels:
name: postgres-{{.Replica}}-{{.Iteration}}
app: postgres
spec:
topologySpreadConstraints:
- maxSkew: 1
topologyKey: kubernetes.io/hostname
whenUnsatisfiable: ScheduleAnyway
labelSelector:
matchLabels:
app: postgres
affinity:
nodeAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
Expand Down
10 changes: 9 additions & 1 deletion cmd/kube-burner/ocp-config/node-density/pod.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,17 @@ kind: Pod
apiVersion: v1
metadata:
labels:
app: node-density-{{.Iteration}}
name: node-density-{{.Iteration}}
app: pause
name: {{.JobName}}-{{.Iteration}}
spec:
topologySpreadConstraints:
- maxSkew: 1
topologyKey: kubernetes.io/hostname
whenUnsatisfiable: ScheduleAnyway
labelSelector:
matchLabels:
app: pause
affinity:
nodeAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
Expand Down

0 comments on commit b44f9ba

Please sign in to comment.