Skip to content

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
@alpeb alpeb merged commit eb4bfd3 into main May 22, 2025
39 checks passed
@alpeb alpeb deleted the alpeb/fix-mc-enablepodantiaffinity branch May 22, 2025 16:46
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

3 participants