Skip to content

Conversation

praddy26
Copy link
Contributor

@praddy26 praddy26 commented Sep 11, 2025

Issue

Fixes #1234

Description

This PR introduces the ability to configure target group attributes for specific ports in Network Load Balancers (NLB). Previously, target group attributes were applied uniformly across all ports in a service. With this change, users can now specify different attributes for different ports, providing more granular control over target group behavior.

Key changes:
• Added support for port-specific target group attributes using the format service.beta.kubernetes.io/aws-load-balancer-target-group-attributes.{port}
• Maintained backward compatibility with existing service.beta.kubernetes.io/aws-load-balancer-target-group-attributes annotation
• Port-specific attributes override the default attributes when specified
• Empty values in port-specific attributes don't override global values, allowing selective attribute inheritance

Example usage:

# Set deregistration delay globally to 60 seconds, with different values for ports 80 and 443
annotations:
  service.beta.kubernetes.io/aws-load-balancer-type: nlb
  # Global attributes for all target groups
  service.beta.kubernetes.io/aws-load-balancer-target-group-attributes: deregistration_delay.timeout_seconds=60
  # Port-specific attributes
  service.beta.kubernetes.io/aws-load-balancer-target-group-attributes.80: deregistration_delay.timeout_seconds=30
  service.beta.kubernetes.io/aws-load-balancer-target-group-attributes.443: deregistration_delay.timeout_seconds=120

# Example with empty values (inheriting from global attributes)
annotations:
  service.beta.kubernetes.io/aws-load-balancer-target-group-attributes: target.group-attr-1=80
  # Empty value will keep the global attribute value
  service.beta.kubernetes.io/aws-load-balancer-target-group-attributes.3306: target.group-attr-1=

Note: When a port-specific attribute has an empty value, it will not override the global attribute value. This allows you to selectively inherit global values while overriding others.

Checklist

  • Added tests that cover your change (if possible)
  • Added/modified documentation as required (such as the README.md, or the docs directory)
  • Manually tested
  • Made sure the title of the PR is a good description that can go into the release notes

BONUS POINTS checklist: complete for good vibes and maybe prizes?! 🤯

  • Backfilled missing tests for code in same general area 🎉
  • Refactored something and made the world a better place 🌟

… port kubernetes-sigs#4326

Signed-off-by: Pradeep Lakshmi Narasimha <pradeep.vaishnav4@gmail.com>
@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Sep 11, 2025
@k8s-ci-robot
Copy link
Contributor

Hi @praddy26. Thanks for your PR.

I'm waiting for a kubernetes-sigs member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

@k8s-ci-robot k8s-ci-robot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Sep 11, 2025
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: praddy26
Once this PR has been reviewed and has the lgtm label, please assign m00nf1sh for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@shraddhabang
Copy link
Collaborator

/ok-to-test

@k8s-ci-robot k8s-ci-robot added ok-to-test Indicates a non-member PR verified by an org member that is safe to test. and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Sep 11, 2025
@praddy26 praddy26 marked this pull request as draft September 12, 2025 08:29
@k8s-ci-robot k8s-ci-robot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Sep 12, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

AWS ALB Ingress Controller doesn't update Security Groups
3 participants