Skip to content

Commit

Permalink
feat: add antiAffinity to deploy sts in separate ndoes
Browse files Browse the repository at this point in the history
  • Loading branch information
hasakura12 committed Aug 26, 2024
1 parent cb472ae commit 4e0f062
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 2 deletions.
15 changes: 14 additions & 1 deletion k8s/relayer/templates/statefulset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,21 @@ spec:
{{- end }}
releaseTime: {{ dateInZone "2006-01-02 15:04:05Z" (now) "UTC"| quote }}
spec:
{{- if .Values.affinity_tolerations.enable }}
affinity:
{{- if .Values.affinity.antiAffinity }}
podAntiAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
- podAffinityTerm:
labelSelector:
matchExpressions:
- key: app
operator: In
values:
- {{ .Values.name }}
topologyKey: {{ .Values.affinity.antiAffinity.topologyKey }}
weight: {{ .Values.affinity.antiAffinity.weight }}
{{- end }}
{{- if .Values.affinity_tolerations.enable }}
nodeAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
nodeSelectorTerms:
Expand Down
8 changes: 7 additions & 1 deletion k8s/relayer/values.prod.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,18 @@ secret_plain:
ingress:
host: sdk-relayer.prod.biconomy.io

# datadog configs
# deploy to dedicated k8s node with taint
affinity_tolerations:
enable: true
key: "app"
values: "relayer-server"

# make sure pods are deployed in different nodes
affinity:
antiAffinity:
topologyKey: kubernetes.io/hostname
weight: 100

# wait for 120 * 10s to fail
startupProbe:
failureThreshold: 120
Expand Down

0 comments on commit 4e0f062

Please sign in to comment.