kubernetes-sigs / aws-load-balancer-controller

A Kubernetes controller for Elastic Load Balancers
https://kubernetes-sigs.github.io/aws-load-balancer-controller/
Apache License 2.0
3.96k stars 1.47k forks source link

fix: use pod target namespace to get pod info from repo when resolving endpoint #3914

Closed Revolution1 closed 6 days ago

Revolution1 commented 4 weeks ago

Issue

close #3913

Description

Checklist

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

k8s-ci-robot commented 4 weeks ago

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: Revolution1 Once this PR has been reviewed and has the lgtm label, please assign johngmyers for approval. For more information see the Kubernetes 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: - **[OWNERS](https://github.com/kubernetes-sigs/aws-load-balancer-controller/blob/main/OWNERS)** Approvers can indicate their approval by writing `/approve` in a comment Approvers can cancel approval by writing `/approve cancel` in a comment
k8s-ci-robot commented 4 weeks ago

Welcome @Revolution1!

It looks like this is your first PR to kubernetes-sigs/aws-load-balancer-controller 🎉. Please refer to our pull request process documentation to help your PR have a smooth ride to approval.

You will be prompted by a bot to use commands during the review process. Do not be afraid to follow the prompts! It is okay to experiment. Here is the bot commands documentation.

You can also check if kubernetes-sigs/aws-load-balancer-controller has its own contribution guidelines.

You may want to refer to our testing guide if you run into trouble with your tests not passing.

If you are having difficulty getting your pull request seen, please follow the recommended escalation practices. Also, for tips and tricks in the contribution process you may want to read the Kubernetes contributor cheat sheet. We want to make sure your contribution gets all the attention it needs!

Thank you, and welcome to Kubernetes. :smiley:

k8s-ci-robot commented 4 weeks ago

Hi @Revolution1. 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](https://git.k8s.io/community/contributors/guide/pull-requests.md). If you have questions or suggestions related to my behavior, please file an issue against the [kubernetes-sigs/prow](https://github.com/kubernetes-sigs/prow/issues/new?title=Prow%20issue:) repository.
kellyyan commented 2 weeks ago

Hi, I've tested this locally and it looks good. I created a service in namespace kube-system, 2 pods in namespace echoserver and used the yaml file below. I had to add a security group rule to the cluster for it to succeed. Looping in @shraddhabang to add the ok-to-test label.

apiVersion: v1
kind: Service
metadata:
  annotations:
    service.beta.kubernetes.io/aws-load-balancer-nlb-target-type: ip
    service.beta.kubernetes.io/aws-load-balancer-scheme: internet-facing
    service.beta.kubernetes.io/aws-load-balancer-type: nlb
  name: mux
  namespace: kube-system
spec:
  loadBalancerClass: service.k8s.aws/nlb
  ports:
  - name: 1dcf5c8
    nodePort: 31718
    port: 31040
  - name: d90d676
    nodePort: 32450
    port: 31815
  type: LoadBalancer
---
apiVersion: v1
kind: Endpoints
metadata:
  name: mux
  namespace: kube-system
subsets:
- addresses:
  - ip: 192.168.35.73
    nodeName: ip-192-168-60-76.ec2.internal
    targetRef:
      kind: Pod
      name: echoserver-658d7b6fb-57crd
      namespace: echoserver
      uid: 9f30aeb9-e358-40c8-828d-f2bb3151e2b9
  ports:
  - name: d90d676
    port: 8080
    protocol: TCP
- addresses:
  - ip: 192.168.20.48
    nodeName: ip-192-168-8-65.ec2.internal
    targetRef:
      kind: Pod
      name: echoserver-658d7b6fb-82t6j
      namespace: echoserver
      uid: 8cdbff5b-0918-47aa-bce0-6c88b3663ff0
  ports:
  - name: 1dcf5c8
    port: 8080
    protocol: TCP
shraddhabang commented 2 weeks ago

/ok-to-test

shraddhabang commented 2 weeks ago

/lgtm /approved

kellyyan commented 2 weeks ago

/assign johngmyers Pinging @johngmyers for approval

wweiwei-li commented 6 days ago

/lgtm /approved