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

can we use NLB with EKS clusters created via eksctl? #133

Closed
jstrachan opened this issue Jul 23, 2018 · 14 comments · Fixed by #139
Closed

can we use NLB with EKS clusters created via eksctl? #133

jstrachan opened this issue Jul 23, 2018 · 14 comments · Fixed by #139
Milestone

Comments

@jstrachan
Copy link
Contributor

I've been trying out NLB instead of ELB as NLBs have stable static IP addresses; so you can use the nip.io trick of setting up Ingress without mandating a custom DNS name being used to setup wildcard CND via a CNAME to kick the tyres on EKS.

Things work great on kops but don't seem to work on EKS which am guessing is related to roles. It looks like these kinds of roles are required for setting up NLB on AWS with kops
https://gist.github.com/micahhausler/4f3a2ee540f5714e6dd91b4bacace3ae#file-create-cluster-sh-L30

so am guessing something similar is required on the NodeInstanceRole. Will try figure out whats really required...

@errordeveloper
Copy link
Contributor

errordeveloper commented Jul 23, 2018

@errordeveloper
Copy link
Contributor

FYI, I'm in a middle of refactoring these things (see #127 and #132), but I'm not sure yet if we will land refactoring changes before 0.1.0 or after.

@jstrachan
Copy link
Contributor Author

@errordeveloper thanks for the heads up.

Not sure if this is related to roles on the nodes or not; tried manually adding the nodes and no luck - can't seem to get the NLB working at all on EKS via eksctl. No clue why its not working TBH - this all just works on kops when those roles are added - so no idea if there's anything we can do in eksct to help get NLB working with ingress.

I wonder if you're right, we need the role added to the cluster/EKS control plane too?

@jstrachan
Copy link
Contributor Author

jstrachan commented Jul 23, 2018

BTW I've been following these instructions to setup NLB on the EKS cluster and no luck so far when the same thing works fine on kops:
https://aws.amazon.com/blogs/opensource/network-load-balancer-support-in-kubernetes-1-9/

@jstrachan
Copy link
Contributor Author

btw after chatting with @errordeveloper on slack - this issue could be that NLB cannot be used with EKS due to the beta annotation - still not 100% sure yet...

@jstrachan jstrachan changed the title add option to setup NLB policy roles can we use NLB with EKS clusters created via eksctl? Jul 23, 2018
@errordeveloper
Copy link
Contributor

cc @d-nishi @nckturner

@jstrachan
Copy link
Contributor Author

aha thanks to this tweet and noodling those related docs I found that adding this policy to the control plane role worked!

{
   "Version": "2012-10-17",
   "Statement": [{
      "Effect": "Allow",
      "Action": [
          "elasticloadbalancing:*",
          "ec2:CreateSecurityGroup",
          "ec2:Describe*"
      ],
      "Resource": "*"
    }
   ]
}

@errordeveloper
Copy link
Contributor

errordeveloper commented Jul 24, 2018 via email

@jstrachan
Copy link
Contributor Author

@errordeveloper great thanks! Was just gonna wait for the CloudFormation PRs to settle so I can see how best to do it; as using CloudFormation for the control plane is maybe a nice idea?

@errordeveloper
Copy link
Contributor

@jstrachan I don't think #132 will land before next week, in fact I'd rather not land it before 0.1.0.

@errordeveloper
Copy link
Contributor

I will add this to 0.1.0 milestone, in a way it's a bug too.

@aparamon
Copy link

aparamon commented Jan 30, 2019

Hmm, I have annotated my service with service.beta.kubernetes.io/aws-load-balancer-type=nlb, but I still get a ELB, not NLB attached:

>kubectl describe svc genghis
Name:                     genghis
Namespace:                default
Labels:                   <none>
Annotations:              kubectl.kubernetes.io/last-applied-configuration={"apiVersion":"v1","kind":"Service","metadata":{"annotations":{"s
ervice.beta.kubernetes.io/aws-load-balancer-type":"nlb"},"name":"genghis","namespace":...
                          service.beta.kubernetes.io/aws-load-balancer-type=nlb
Selector:                 app=genghis
Type:                     LoadBalancer
IP:                       10.100.135.56
LoadBalancer Ingress:     a7f89af5f249711e9a0160683d1063c6-892f351b073a621b.elb.eu-central-1.amazonaws.com
Port:                     <unset>  80/TCP
TargetPort:               80/TCP
NodePort:                 <unset>  30609/TCP
Endpoints:                192.168.114.45:80,192.168.131.233:80,192.168.159.254:80 + 1 more...
Session Affinity:         None
External Traffic Policy:  Cluster

Do I need to create the NLB beforehand?

@errordeveloper
Copy link
Contributor

@aparamon no, you don't need to create it beforehand. Did you manage to troubleshoot this? If not, please open another issue - we don't normally monitor closed issues.

@aparamon
Copy link

@errordeveloper I didn't, but in the end I used different architecture with a dedicated load-balancer node which runs ingress controller only and possesses static external IP (Elastic IP).
In fact, I realized that level 4 load-balancer (NLB) doesn't suit my application anyway. So EKS was somehow doing the right thing ;-)

torredil pushed a commit to torredil/eksctl that referenced this issue May 20, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants