Skip to content

Commit

Permalink
Fix service-mirror template when running in HA mode
Browse files Browse the repository at this point in the history
Two clusters can be linked in HA mode. When HA values are used, the
service-mirror deployment receives some pod affinity rules to ensure
fair scheduling of pods across a cluster's nodes.

The service-mirror Deployment's template seems to be broken at the
moment when using HA values. Affinity rules are incorrectly grouped
under a top-level `podAntiAffinity` field. The Kubernetes API requires
the rules to be grouped under a top-level `affinity` field. This change
rectifies that by introducing the missing parent.

Fixes #11603

Signed-off-by: Matei David <[email protected]>
  • Loading branch information
mateiidavid committed Nov 13, 2023
1 parent 4018b2f commit 006f6e2
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ metadata:
{{- with .Values.commonLabels }}{{ toYaml . | trim | nindent 4 }}{{- end }}
{{- include "partials.image-pull-secrets" .Values.imagePullSecrets }}
---
{{- $tree := deepCopy . }}
apiVersion: apps/v1
kind: Deployment
metadata:
Expand Down Expand Up @@ -120,10 +121,9 @@ spec:
mirror.linkerd.io/cluster-name: {{.Values.targetClusterName}}
{{- with .Values.podLabels }}{{ toYaml . | trim | nindent 8 }}{{- end }}
spec:
{{- if .Values.enablePodAntiAffinity -}}
{{- $local := dict "label" "mirror.linkerd.io/cluster-name" "component" .Values.targetClusterName -}}
{{- include "linkerd.pod-affinity" $local | nindent 6 -}}
{{- end }}
{{- $_ := set $tree "component" .Values.targetClusterName -}}
{{- $_ := set $tree "label" "mirror.linkerd.io/cluster-name" -}}
{{- include "linkerd.affinity" $tree | nindent 6 }}
containers:
- args:
- service-mirror
Expand Down

0 comments on commit 006f6e2

Please sign in to comment.