Skip to content

[aws-load-balancer-controller] Add support for multiple namespaces in watchNamespace#1318

Open
ahmedsamer wants to merge 1 commit intoaws:masterfrom
ahmedsamer:feature/watchNamespace-multiple-namespaces
Open

[aws-load-balancer-controller] Add support for multiple namespaces in watchNamespace#1318
ahmedsamer wants to merge 1 commit intoaws:masterfrom
ahmedsamer:feature/watchNamespace-multiple-namespaces

Conversation

@ahmedsamer
Copy link
Copy Markdown

@ahmedsamer ahmedsamer commented Apr 16, 2026

Description

This PR adds support for the watchNamespace parameter to accept multiple namespaces, addressing the limitation where the AWS Load Balancer Controller could only watch a single namespace.

Changes

  • templates/deployment.yaml: Added logic to check if watchNamespace is a list and iterate through multiple namespaces
  • README.md: Updated documentation to clarify that watchNamespace accepts both string and list formats
  • values.yaml: Added examples demonstrating both single and multiple namespace configurations

Backward Compatibility

This change is fully backward compatible. Existing configurations using a string value will continue to work as before.

Usage Examples

Single namespace (existing behavior):

watchNamespace: my-namespace

Multiple namespaces (new feature):

watchNamespace:
  - namespace1
  - namespace2
  - namespace3

Testing

The template logic uses Helm's `kindIs "slice"` function to detect whether the value is a list, ensuring proper handling of both formats.

Closes

Closes #1306

… watchNamespace

This enhancement allows the watchNamespace parameter to accept either:
- A single namespace as a string (backward compatible)
- Multiple namespaces as a list

The template now checks if watchNamespace is a slice and iterates through
each namespace, passing multiple --watch-namespace flags to the controller.

This resolves the limitation where the controller could only watch a single
namespace at a time, improving deployment flexibility for multi-namespace
environments.

Closes aws#1306
@ahmedsamer ahmedsamer requested a review from a team as a code owner April 16, 2026 16:15
@ahmedsamer
Copy link
Copy Markdown
Author

ahmedsamer commented Apr 16, 2026

Test Results

I've tested the changes locally with helm template:

Single namespace (string) - backward compatible:

helm template test . --set clusterName=test-cluster --set watchNamespace=my-namespace

Result:

- --watch-namespace=my-namespace

Multiple namespaces (list) - new feature:

helm template test . --set clusterName=test-cluster --set watchNamespace="{ns1,ns2,ns3}"

Result:

- --watch-namespace=ns1
- --watch-namespace=ns2
- --watch-namespace=ns3

Chart Version

The validation script indicates that the Chart version needs to be bumped from 3.2.1. Since this is a new feature (not a bug fix), should I bump it to:

  • 3.3.0 (minor version bump for new feature)?
  • Or would you prefer to handle versioning during the merge?

Please let me know and I'll update accordingly.

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.

watchNamespace to accept a list of namespaces to watch

1 participant