8000 fix(multicluster): affinities for controllers by alpeb · Pull Request #14028 · linkerd/linkerd2 · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

fix(multicluster): affinities for controllers #14028

8000
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

alpeb
Copy link
Member
@alpeb alpeb commented May 15, 2025

Fixes #14008

In the linkerd-multicluster chart (or via linkerd mc install|upgrade), setting enablePodAntiAffinity: true for specific multicluster controllers or globally was causing the following error:

Error: template: linkerd-multicluster/templates/controller/pdb.yaml:12:7: executing "linkerd-multicluster/templates/controller/pdb.yaml" at <include "partials.annotations.created-by" .>: error calling include: template: linkerd-multicluster/charts/partials/templates/_metadata.tpl:2:33: executing "partials.annotations.created-by" at <.Values.cliVersion>: nil pointer evaluating interface {}.cliVersion

The problem was with the PodDisruptionBudget manifest not passing the proper context to the annotations.created-by partials.

Also, the nodeAffinity setting wasn't being taken into account for such controllers.

The output can be tested with bin/linkerd mc install -f values.yaml, using this as values.yaml (put something that makes sense for nodeAffinity, if you want to apply this to the cluster):

controllers:
- link:
    ref:
      name: target1
  enablePodAntiAffinity: true
  nodeAffinity:
    foo: bar

@alpeb alpeb requested a review from a team as a code owner May 15, 2025 21:43
Fixes #14008

In the linkerd-multicluster chart (or via `linkerd mc install|upgrade`),
setting `enablePodAntiAffinity: true` for specific multicluster
controllers or globally was causing the following error:

```
Error: template: linkerd-multicluster/templates/controller/pdb.yaml:12:7: executing "linkerd-multicluster/templates/controller/pdb.yaml" at <include "partials.annotations.created-by" .>: error calling include: template: linkerd-multicluster/charts/partials/templates/_metadata.tpl:2:33: executing "partials.annotations.created-by" at <.Values.cliVersion>: nil pointer evaluating interface {}.cliVersion
```

The problem was with the PodDisruptionBudget manifest not passing the
proper context to the `annotations.created-by` partials.

Also, the `nodeAffinity` setting wasn't being taken into account for
such controllers.

The output can be tested with `bin/linkerd mc install -f values.yaml`,
using this as `values.yaml` (put something that makes sense for
nodeAffinity, if you want to apply this to the cluster):

```yaml
controllers:
- link:
    ref:
      name: target1
  enablePodAntiAffinity: true
  nodeAffinity:
    foo: bar
```

Note: Also added `multicluster/charts/**` to the changed-files actions
list, for the multicluster tests to be triggered whenever a multicluster
manifest changes.
@alpeb alpeb force-pushed the alpeb/fix-mc-enablepodantiaffinity branch from 4f52556 to 50c9960 Compare May 15, 2025 22:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

linkerd-multicluster helm chart and linkerd mc install fails evaluate cliVersion
1 participant
0