Skip to content

EV-6336: feat(istio): waypoint pull secret support for private registries#4483

Open
electricjesus wants to merge 4 commits intomasterfrom
worktree-graceful-wobbling-squirrel
Open

EV-6336: feat(istio): waypoint pull secret support for private registries#4483
electricjesus wants to merge 4 commits intomasterfrom
worktree-graceful-wobbling-squirrel

Conversation

@electricjesus
Copy link
Member

@electricjesus electricjesus commented Feb 27, 2026

Description

Jira: EV-6336

When users create an Istio waypoint Gateway (gatewayClassName: istio-waypoint) in their namespace, istiod automatically creates a waypoint Deployment there. On clusters with private registries (like AKS with gcr.io/unique-caldron-775), the waypoint pod fails with ImagePullBackOff because the pull secret only exists in the operator namespace and istiod doesn't inject imagePullSecrets into waypoint pod specs.

This PR fixes the issue with two changes:

Part 1: Pass imagePullSecrets to istiod via Helm values

  • Adds ImagePullSecrets field to GlobalConfig in the Istio render package
  • Populates global.imagePullSecrets in istiod Helm values from Installation pull secrets
  • This makes istiod inject imagePullSecrets references into waypoint pod specs it creates

Part 2: New waypoint sub-controller

  • Watches for istio-waypoint Gateway resources across all namespaces
  • Copies pull Secret objects from the operator namespace to waypoint namespaces so the references resolve
  • Tracks copied secrets with operator.tigera.io/istio-waypoint-pull-secret label for cleanup
  • Cleans up stale secrets when gateways are removed or Istio CR is deleted

Both parts are no-ops when no pull secrets are configured (omitempty / early return).

Testing:

  • Unit tests for Helm values serialization (render package)
  • 8 controller tests covering: no secrets, single/multiple gateways, same/different namespaces, gateway deletion cleanup, non-matching gatewayClassName, Istio CR deletion, and missing Installation
  • All existing istio controller and render tests continue to pass

Components affected: pkg/render/istio, pkg/controller/istio, internal/controller

Release Note

Istio waypoint Gateways now work on clusters with private registries. The operator passes imagePullSecrets to istiod via Helm values and copies pull secrets to namespaces containing waypoint Gateways.

For PR author

  • Tests for change.
  • If changing pkg/apis/, run make gen-files
  • If changing versions, run make gen-versions

Add ImagePullSecrets field to GlobalConfig and populate it from
Installation pull secrets when rendering istiod Helm values. This
makes istiod inject imagePullSecrets references into waypoint pod
specs it creates, enabling image pulls from private registries.
Add a new controller that watches for istio-waypoint Gateway resources
and copies pull secrets from the operator namespace to waypoint
namespaces. This ensures waypoint pods can pull images from private
registries. Secrets are tracked with a label for cleanup when gateways
are removed or the Istio CR is deleted.
@electricjesus electricjesus requested a review from a team as a code owner February 27, 2026 11:17
@marvin-tigera marvin-tigera added this to the v1.42.0 milestone Feb 27, 2026
@electricjesus electricjesus changed the title feat(istio): waypoint pull secret support for private registries EV-6336: feat(istio): waypoint pull secret support for private registries Feb 27, 2026

// WaypointPullSecretLabel is the label applied to secrets copied by this controller
// for tracking and cleanup purposes.
WaypointPullSecretLabel = "operator.tigera.io/istio-waypoint-pull-secret"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Curious why a label is the right call here instead of using owner references? If there's a reason it would be good to expand on that in the comment.

Copy link
Member Author

@electricjesus electricjesus Mar 5, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Went with labels here since we need to find and clean up these secrets across namespaces; not just on Gateway deletion, but also when pull secrets get removed from Installation or the Istio CR gets deleted. MatchingLabels makes that easy. Owner refs would only cover the Gateway-deletion case via GC, and we'd still need some way to track secrets for the other cleanup paths. Similar to how ESGatewaySelectorLabel works in the logstorage controller.

return fmt.Errorf("istio-controller failed to create periodic reconcile watch: %w", err)
}

if err := waypoint.Add(mgr, opts); err != nil {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hm, a bit of a new pattern here (I think all the other "sub" controllers are just added in the same place as main controllers).

Not necessarily against this, though.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it was just easier for me to understand this format, but also happy to go with the established pattern. Let me know what your preference would be as a maintainer 😅

…et cleanup

Replace manual cleanupAllSecrets/cleanupStaleSecrets methods with a
single NewPassthrough(toCreate, toDelete) call. This follows the
existing codebase pattern for managing object lifecycle through the
component handler.

The explicit len(pullSecrets)==0 early return is removed — the mainline
reconcile logic now handles this naturally: when no secrets are needed,
toCreate is empty and all existing labeled secrets flow into toDelete.

Also expand the WaypointPullSecretLabel comment to explain why labels
are used instead of owner references (cross-namespace cleanup needs).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants