Skip to content

Commit 2b9ef83

Browse files
[http-add-on] Add topologySpreadConstraints to operator and scaler (#793)
* feat(http-add-on): add topologySpreadConstraints to operator Signed-off-by: Starlight Romero <28881133+starlightromero@users.noreply.github.com> * feat(http-add-on): add topologySpreadConstraints to scaler Signed-off-by: Starlight Romero <28881133+starlightromero@users.noreply.github.com> --------- Signed-off-by: Starlight Romero <28881133+starlightromero@users.noreply.github.com>
1 parent 9823aea commit 2b9ef83

File tree

4 files changed

+32
-0
lines changed

4 files changed

+32
-0
lines changed

.github/workflows/ci-http-add-on.yml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,26 @@ jobs:
9898
tag: canary
9999
rbac:
100100
aggregateToDefaultRoles: true
101+
operator:
102+
topologySpreadConstraints:
103+
- maxSkew: 1
104+
topologyKey: "kubernetes.io/hostname"
105+
whenUnsatisfiable: "ScheduleAnyway"
106+
labelSelector:
107+
matchLabels:
108+
app.kubernetes.io/component: operator
109+
app.kubernetes.io/instance: http-add-on
110+
app.kubernetes.io/name: http-add-on
111+
scaler:
112+
topologySpreadConstraints:
113+
- maxSkew: 1
114+
topologyKey: "kubernetes.io/hostname"
115+
whenUnsatisfiable: "ScheduleAnyway"
116+
labelSelector:
117+
matchLabels:
118+
app.kubernetes.io/component: operator
119+
app.kubernetes.io/instance: http-add-on
120+
app.kubernetes.io/name: http-add-on
101121
interceptor:
102122
replicas:
103123
min: 1

http-add-on/templates/operator/deployment.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,10 @@ spec:
119119
tolerations:
120120
{{- toYaml . | nindent 8 }}
121121
{{- end }}
122+
{{- with .Values.operator.topologySpreadConstraints }}
123+
topologySpreadConstraints:
124+
{{- toYaml . | nindent 8 }}
125+
{{- end }}
122126
{{- if .Values.operator.priorityClassName }}
123127
priorityClassName: {{ .Values.operator.priorityClassName }}
124128
{{- end }}

http-add-on/templates/scaler/deployment.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,10 @@ spec:
111111
tolerations:
112112
{{- toYaml . | nindent 8 }}
113113
{{- end }}
114+
{{- with .Values.scaler.topologySpreadConstraints }}
115+
topologySpreadConstraints:
116+
{{- toYaml . | nindent 8 }}
117+
{{- end }}
114118
{{- if .Values.scaler.priorityClassName }}
115119
priorityClassName: {{ .Values.scaler.priorityClassName }}
116120
{{- end }}

http-add-on/values.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,8 @@ operator:
7979
tolerations: []
8080
# -- Affinity for pod scheduling ([docs](https://kubernetes.io/docs/tasks/configure-pod-container/assign-pods-nodes-using-node-affinity/))
8181
affinity: {}
82+
# -- Topology spread constraints ([docs](https://kubernetes.io/docs/concepts/scheduling-eviction/topology-spread-constraints/))
83+
topologySpreadConstraints: []
8284
# -- Annotations to be added to the operator pods
8385
podAnnotations: {}
8486

@@ -116,6 +118,8 @@ scaler:
116118
tolerations: []
117119
# -- Affinity for pod scheduling ([docs](https://kubernetes.io/docs/tasks/configure-pod-container/assign-pods-nodes-using-node-affinity/))
118120
affinity: {}
121+
# -- Topology spread constraints ([docs](https://kubernetes.io/docs/concepts/scheduling-eviction/topology-spread-constraints/))
122+
topologySpreadConstraints: []
119123
resources:
120124
limits:
121125
cpu: 0.5

0 commit comments

Comments
 (0)