Skip to content

Commit 37f6bdd

Browse files
authored
feat(helm): add traffic distribution and topology spread constraints (#701)
1 parent a674588 commit 37f6bdd

File tree

4 files changed

+45
-0
lines changed

4 files changed

+45
-0
lines changed

deploy/charts/burrito/templates/datastore.yaml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,10 @@ spec:
8686
tolerations:
8787
{{- toYaml . | nindent 8 }}
8888
{{- end }}
89+
{{- with .deployment.topologySpreadConstraints }}
90+
topologySpreadConstraints:
91+
{{- toYaml . | nindent 8 }}
92+
{{- end }}
8993
volumes:
9094
- name: burrito-config
9195
configMap:
@@ -114,6 +118,9 @@ metadata:
114118
{{- toYaml .metadata.annotations | nindent 4}}
115119
spec:
116120
type: {{ .service.type }}
121+
{{- if .service.trafficDistribution }}
122+
trafficDistribution: {{ .service.trafficDistribution }}
123+
{{- end }}
117124
ports:
118125
{{- toYaml .service.ports | nindent 4 }}
119126
selector:

deploy/charts/burrito/templates/hermitcrab.yaml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@ metadata:
77
annotations:
88
{{- toYaml .service.annotations | nindent 4 }}
99
spec:
10+
{{- if .service.trafficDistribution }}
11+
trafficDistribution: {{ .service.trafficDistribution }}
12+
{{- end }}
1013
selector:
1114
{{- toYaml .metadata.labels | nindent 4 }}
1215
ports:
@@ -96,6 +99,10 @@ spec:
9699
{{- toYaml .deployment.nodeSelector | nindent 8 }}
97100
affinity:
98101
{{- toYaml .deployment.affinity | nindent 8 }}
102+
{{- with .deployment.topologySpreadConstraints }}
103+
topologySpreadConstraints:
104+
{{- toYaml . | nindent 8 }}
105+
{{- end }}
99106
---
100107
{{- if .tls.certManager.use }}
101108
apiVersion: cert-manager.io/v1

deploy/charts/burrito/templates/server.yaml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,10 @@ spec:
8383
tolerations:
8484
{{- toYaml . | nindent 8 }}
8585
{{- end }}
86+
{{- with .deployment.topologySpreadConstraints }}
87+
topologySpreadConstraints:
88+
{{- toYaml . | nindent 8 }}
89+
{{- end }}
8690
volumes:
8791
- name: burrito-config
8892
configMap:
@@ -124,6 +128,9 @@ metadata:
124128
{{- toYaml .metadata.annotations | nindent 4 }}
125129
spec:
126130
type: {{ .service.type }}
131+
{{- if .service.trafficDistribution }}
132+
trafficDistribution: {{ .service.trafficDistribution }}
133+
{{- end }}
127134
ports:
128135
{{- toYaml .service.ports | nindent 4 }}
129136
selector:

deploy/charts/burrito/values.yaml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,8 @@ hermitcrab:
157157
service:
158158
# -- Hermitcrab service annotations
159159
annotations: {}
160+
# -- Hermitcrab service traffic distribution policy
161+
trafficDistribution: ""
160162
deployment:
161163
# -- Hermitcrab replicas
162164
replicas: 1
@@ -166,6 +168,8 @@ hermitcrab:
166168
nodeSelector: {}
167169
# -- Hermitcrab affinity
168170
affinity: {}
171+
# -- Hermitcrab topology spread constraints
172+
topologySpreadConstraints: []
169173
# -- Hermitcrab image configuration
170174
image:
171175
pullPolicy: Always
@@ -374,12 +378,22 @@ server:
374378
extraVolumes: {}
375379
# -- Additional volume mounts
376380
extraVolumeMounts: {}
381+
# -- Server tolerations
382+
tolerations: []
383+
# -- Server node selector
384+
nodeSelector: {}
385+
# -- Server affinity
386+
affinity: {}
387+
# -- Server topology spread constraints
388+
topologySpreadConstraints: []
377389
# -- Service configuration for the Burrito server
378390
service:
379391
ports:
380392
- name: http
381393
port: 80
382394
targetPort: http
395+
# -- Server service traffic distribution policy
396+
trafficDistribution: ""
383397
# -- Ingress configuration for the Burrito server
384398
ingress:
385399
# -- Enable/Disable ingress creation for the Burrito server
@@ -436,6 +450,14 @@ datastore:
436450
extraVolumes: {}
437451
# -- Additional volume mounts
438452
extraVolumeMounts: {}
453+
# -- Datastore tolerations
454+
tolerations: []
455+
# -- Datastore node selector
456+
nodeSelector: {}
457+
# -- Datastore affinity
458+
affinity: {}
459+
# -- Datastore topology spread constraints
460+
topologySpreadConstraints: []
439461
# -- Service configuration for the Burrito datastore
440462
service:
441463
ports:
@@ -445,6 +467,8 @@ datastore:
445467
- name: https
446468
port: 443
447469
targetPort: http
470+
# -- Datastore service traffic distribution policy
471+
trafficDistribution: ""
448472
# -- TLS configuration for the Burrito datastore
449473
tls:
450474
# -- Enable/Disable TLS for the Burrito datastore (recommended for production use)

0 commit comments

Comments
 (0)