You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add support for NLB target group attributes (ProxyProtocolV2, PreserveClientIP)
This change adds support for configuring two NLB-specific target group attributes:
1. Proxy Protocol v2: Enable with `--nlb-proxy-protocol-v2` flag (default: false)
- Enables Proxy Protocol v2 for NLB target groups
- Opt-in feature, disabled by default
2. Preserve Client IP: Configure with `--nlb-preserve-client-ip` flag (default: true)
- Preserves client IP address in NLB target group connections
- Enabled by default
These attributes are only applied to Network Load Balancer target groups and do not
affect Application Load Balancers.
BREAKING CHANGE:
The `preserve_client_ip` attribute is now explicitly set to true by the controller
on all NLB target groups. Previously, this attribute was not explicitly set, which
relied on AWS NLB's default behavior (which is also true).
If your NLB target groups currently have `preserve_client_ip=false` set outside of
the controller, updating to this version will override it to true. To maintain the
previous behavior of `preserve_client_ip=false`, pass the `--nlb-preserve-client-ip=false`
flag when running the controller.
Changes:
- Add NLB attribute flags to controller CLI
- Extend AWS adapter with WithNLBProxyProtocolV2() and WithNLBPreserveClientIP() methods
- Update CloudFormation template generation to conditionally add NLB attributes
- Add comprehensive test coverage (5 test cases)
- Update README with v0.20 upgrade notes and breaking change documentation
Signed-off-by: speruri <surya.srikar.peruri@zalando.de>
Version `v0.20` adds support for NLB target group attributes:
55
+
56
+
-**Proxy Protocol v2**: Enable with `--nlb-proxy-protocol-v2` flag (default: false, disabled)
57
+
- Enables Proxy Protocol v2 for Network Load Balancer target groups
58
+
- Only applies to NLBs; ALBs do not support this feature
59
+
60
+
-**Preserve Client IP**: Configure with `--nlb-preserve-client-ip` flag (default: true, enabled)
61
+
- Preserves client IP address in NLB target group connections
62
+
- Defaults to true, matching AWS NLB default behavior
63
+
- Set to false to override and disable this feature
64
+
-**Breaking change**: Previously this attribute was not explicitly set. Updating to v0.20 will set `preserve_client_ip.enabled=true` on all NLB target groups. For setups that require it disabled, use `--nlb-preserve-client-ip=false`
65
+
66
+
These attributes are only applied to Network Load Balancer target groups. Application Load Balancers are not affected.
67
+
49
68
### <v0.19 to >=v0.19
50
69
51
70
Version `v0.19` adds support for IPv6 target group IP address type. When using IPv6 targets, ensure your load balancer is configured as dualstack (`--ip-addr-type=dualstack` or `alb.ingress.kubernetes.io/ip-address-type: dualstack`). IPv4-only load balancers cannot route to IPv6 targets and will fail with a clear error message.
Copy file name to clipboardExpand all lines: controller.go
+8Lines changed: 8 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -81,6 +81,8 @@ var (
81
81
nlbZoneAffinitystring
82
82
nlbCrossZonebool
83
83
nlbHTTPEnabledbool
84
+
nlbProxyProtocolV2Enabledbool
85
+
nlbPreserveClientIPEnabledbool
84
86
ingressAPIVersionstring
85
87
internalDomains []string
86
88
targetAccessModestring
@@ -183,6 +185,10 @@ func loadSettings() error {
183
185
Default("false").BoolVar(&nlbCrossZone)
184
186
kingpin.Flag("nlb-http-enabled", "Enable HTTP (port 80) for Network Load Balancers. By default this is disabled as NLB can't provide HTTP -> HTTPS redirect.").
185
187
Default("false").BoolVar(&nlbHTTPEnabled)
188
+
kingpin.Flag("nlb-proxy-protocol-v2", "Enable Proxy Protocol v2 for Network Load Balancers. This setting only applies to 'network' Load Balancers.").
kingpin.Flag("nlb-preserve-client-ip", "Enable preserve client IP address for Network Load Balancers. This setting only applies to 'network' Load Balancers.").
kingpin.Flag("deny-internal-domains", "Sets a rule on ALB's Listeners that denies requests with the Host header as a internal domain. Domains can be set with the -internal-domains flag.").
187
193
Default("false").BoolVar(&denyInternalDomains)
188
194
kingpin.Flag("internal-domains", "Define the internal domains to be blocked when -deny-internal-domains is set to true. Set it multiple times for multiple domains. The maximum size of each name is 128 characters. The following wildcard characters are supported: * (matches 0 or more characters) and ? (matches exactly 1 character).").
0 commit comments