Skip to content

Conversation

zac-nixon
Copy link
Collaborator

Issue

#4238

Description

Presently, the error returned when using the wrong service type and instance targets is very unclear. In our documentation we state that you MUST use 'Loadbalancer' or 'NodePort' typed services however the error message returned by the controller does not make it obvious.

Manual testing:

{"level":"error","ts":"2025-06-24T18:30:37Z","msg":"Reconciler error","controller":"ingress","object":{"name":"echoserver","namespace":"echoserver2"},"namespace":"echoserver2","name":"echoserver","reconcileID":"0a027cdf-11ac-44e1-bd73-8bbc419e732c","error":"ingress: echoserver2/echoserver: TargetGroup port is empty. When using Instance targets, your service be must of type 'NodePort' or 'LoadBalancer'"}

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 🌟

@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Jun 24, 2025
@k8s-ci-robot k8s-ci-robot added approved Indicates a PR has been approved by an approver from all required OWNERS files. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Jun 24, 2025
@zac-nixon
Copy link
Collaborator Author

/retest

Copy link
Collaborator

@shraddhabang shraddhabang left a comment

Choose a reason for hiding this comment

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

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Jun 24, 2025
@@ -181,6 +181,14 @@ func (t *defaultModelBuildTask) buildTargetGroupSpec(ctx context.Context,
}
tgPort := t.buildTargetGroupPort(ctx, targetType, svcPort)
name := t.buildTargetGroupName(ctx, k8s.NamespacedName(ing.Ing), svc, port, tgPort, targetType, tgProtocol, tgProtocolVersion)

if tgPort == 0 {
if targetType == elbv2model.TargetTypeIP {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Out of curiosity, in which case, tgPort will be 0 with IP Targets ?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

technically, not possible but just being defensive in case that changes in the future.

@k8s-ci-robot k8s-ci-robot removed the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Jun 25, 2025
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: shraddhabang, wweiwei-li, zac-nixon

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

The pull request process is described here

Needs approval from an approver in each of these files:
  • OWNERS [shraddhabang,wweiwei-li,zac-nixon]

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

@wweiwei-li
Copy link
Collaborator

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Jun 25, 2025
@k8s-ci-robot k8s-ci-robot merged commit 3fb798e into kubernetes-sigs:main Jun 25, 2025
9 checks passed
shuqz pushed a commit to shuqz/shuqz-aws-load-balancer-controller that referenced this pull request Jul 29, 2025
clear confusion around using ClusterIP service and Instance targets
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants