Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AWS NLB's target group is not taking into account node labels. #240

Closed
cjose3 opened this issue Jul 15, 2021 · 1 comment
Closed

AWS NLB's target group is not taking into account node labels. #240

cjose3 opened this issue Jul 15, 2021 · 1 comment
Labels
kind/bug Categorizes issue or PR as related to a bug.

Comments

@cjose3
Copy link

cjose3 commented Jul 15, 2021

What happened:
The NLB's target group is registering all nodes of the cluster.

What you expected to happen:
The NLB's target group registers ONLY those nodes with labels defined by the annotation service.beta.kubernetes.io/aws-load-balancer-target-node-labels.

How to reproduce it (as minimally and precisely as possible):
Create a service such:

apiVersion: v1
kind: Service
metadata:
  annotations:
    service.beta.kubernetes.io/aws-load-balancer-backend-protocol: tcp
    service.beta.kubernetes.io/aws-load-balancer-cross-zone-load-balancing-enabled: "true"
    service.beta.kubernetes.io/aws-load-balancer-proxy-protocol: '*'
    service.beta.kubernetes.io/aws-load-balancer-target-node-labels: lifecycle=Ec2Spot,intent=public-apps
    service.beta.kubernetes.io/aws-load-balancer-type: nlb
  name: ingress-svc
spec:
  externalTrafficPolicy: Cluster
  selector:
    app.kubernetes.io/name: kong
  type: LoadBalancer

On a cluster with two group of nodes. A group with labels such lifecycle=Ec2Spot,intent=public-apps and another without them.

Anything else we need to know?:
We have 10 nodes running on a private subnet with labels like:

lifecycle=Ec2Spot
intent=apps

and two nodes on public subnet with labels like:

lifecycle=Ec2Spot
intent=public-apps

We want to have as targets for the load balancer only nodes running on the public subnet.

Environment:

  • Kubernetes version (use kubectl version):
Client Version: version.Info{Major:"1", Minor:"21", GitVersion:"v1.21.2", GitCommit:"092fbfbf53427de67cac1e9fa54aaa09a28371d7", GitTreeState:"clean", BuildDate:"2021-06-16T12:59:11Z", GoVersion:"go1.16.5", Compiler:"gc", Platform:"linux/amd64"}
Server Version: version.Info{Major:"1", Minor:"18+", GitVersion:"v1.18.16-eks-7737de", GitCommit:"7737de131e58a68dda49cdd0ad821b4cb3665ae8", GitTreeState:"clean", BuildDate:"2021-03-10T21:33:25Z", GoVersion:"go1.13.15", Compiler:"gc", Platform:"linux/amd64"}
  • Cloud provider or hardware configuration:
AWS EKS
Platform version
eks.6
  • Others:

/kind bug

@k8s-ci-robot k8s-ci-robot added the kind/bug Categorizes issue or PR as related to a bug. label Jul 15, 2021
@cjose3 cjose3 closed this as completed Jul 15, 2021
@cjose3
Copy link
Author

cjose3 commented Jul 15, 2021

I'm closing this issue because it has been addressed here
According to the AWS documentation related to kubernetes versions, this feature was introduced in 1.19 and we're using 1.18.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Categorizes issue or PR as related to a bug.
Projects
None yet
Development

No branches or pull requests

2 participants