helm/v2-alpha: manager templating rewrites sidecar values

Author: camilamacedo86Created Jul 23, 2026Updated Jul 23, 2026

What happened

The Helm plugin applies manager-related replacements across the whole rendered Deployment.

As a result, matching values in sidecars can also be rewritten.

Example:

yaml
- name: proxy
  livenessProbe:
    httpGet:
      path: /healthz
      port: 9440
  ports:
  - containerPort: 9440
    name: health

Becomes:

yaml
- name: proxy
  livenessProbe:
    httpGet:
      path: /healthz
      port: {{ .Values.manager.healthProbe.port }}
  ports:
  - containerPort: {{ .Values.manager.healthProbe.port }}
    name: health

Changing manager.healthProbe.port then also changes the sidecar.

Expected behavior

Only values from the manager container should use manager chart values.

Sidecars should remain unchanged.

Cause

The rules in:

pkg/plugins/optional/helm/v2alpha/scaffolds/internal/kustomize/templater/appliers/ports.go

match across the whole Deployment instead of only the manager container.

Webhook detection has the same problem because it also checks the full rendered document.

Suggested approach

We might want to address this at the design level instead of fixing each port rule separately.

Ideally, all manager-specific templating should be scoped to the manager container, including:

  • ports
  • probes
  • arguments
  • metrics
  • webhooks
  • future manager values

The templater could reuse the same manager-container lookup already used by the extractor.

Tests should cover a Deployment with a manager and a sidecar and verify that only the manager is templated.

Source: kubernetes-sigs/kubebuilder