Choosing of AWS Load Balancer for Kubernetes HA cluster - amazon-web-services

I am trying to implement CI/CD pipeline for my set of microservices by using Kubernetes HA cluster and Jenkins.
When I am exploring, I found that usage of load balancer for making a HA kubernetes cluster. I am planning to host my application in AWS. So I want to create and use an AWS elastic load balancer for my application by supporting HA kubernetes cluster.
My doubt here that, When I am exploring AWS load balancer, I am seeing that "Application Loadbalancer - http/https" and "Network Loadbalancer-TCP".
So here I am confused about which load balancer AWS resources I need to create? In my exploration, I understood that to create a network load balancer.
So my confusion is this. Can anyone clear that I am going in correct direction? Means creating network load balancer.
Can anyone correct me if I am going in wrong direction?
Let me know that should network load balancer will solve HA kubernetes cluster formation or not?

There isn't a right answer to your question, it really depends what you need to do. You can achieve HA with a network load balancer, a classic load balancer (even though this is the old generation and is not suggested) or an application load balancer.
The advantages of network load balancers are certainly related to performance and the possibility to attach elastic IPs and are ideal for balancing TPC traffic (level 4 routing).
On the other side, application load balancers are ideal for advanced load balancing of HTTP and HTTPS traffic (level 7 routing), with the possibility to do advanced request routing, suitable for complex application architectures (such as microservices)
This link might be useful https://aws.amazon.com/elasticloadbalancing/details/#details

Related

Elastic Load Balancer (Elastic Beanstalk) vs NGINIX

I am pretty new to AWS deployment (please send any helpful guides). And I read that it comes with an elastic load balancer but I've also heard that a lot of people put NGINX on an EC2 to use as a load balancer.
Do people commonly use either or? Having two seems redundant.
Nginx on an EC2 instance for load balancing would be a single point of failure, if the EC2 instance went down your app would be down. An AWS Load Balancer is actually multiple load balancer nodes distributed across multiple AWS availability zones to provide high availability. The EC2 instance would also be something for you to have to manage, where an AWS Load Balancer is managed for you by Amazon.
You mention Elastic Beanstalk in your question title. Elastic Beanstalk will use both. It uses a Load Balancer for distributing traffic across multiple instances, and it uses Nginx on each instance as a reverse proxy to your application.

nginx as a load balance on EKS

I am deploying an EKS cluster and plan to use Ingress. From my understanding when I specify Ingress AWS creates an Application Load Balancer. I am having trouble figuring out how nginx will fit into this scenario as a Load Balancer since I already have a Load Balancer in AWS.
I saw an example which deploys nginx as a pod and then configures the load balancing on nginx, but why do this when you can completely do with the Application Load Balancer which comes in AWS?
2 reasons come to mind.
Cost - you pay per ALB.
Experience. If you're experienced w/ nginx ingress, why use the ALB controller?

Load balancer for kubernetes clusters

I need some help configuring my load balancer for my Kubernetes clusters. The internal load balancer works fine. Now, I'd like to expose the service via https and I'm stumped on the Ingress configuration.
First of all, please take in count that whenever any HTTP(S) load balancer is configured through Ingress, you must not manually change or update the configuration of the HTTP(S) load balancer. That is, you must not edit any of the load balancer's components, including target proxies, URL maps, and backend services. Any changes that you make are overwritten by GKE.
So, once that we are aware about the above, We have to know that Ingress for Internal HTTP(S) Load Balancing deploys the Google Cloud Internal HTTP(S) Load Balancer. This private pool of load balancers is deployed in your network and provides internal load balancing for clients and backends within your VPC. As per this documentation.
Now, we are ready to configure an Ingress for Internal Load Balancer, This is an example about how to configure a simple Ingress in order to expose a simple service.
My suggestion is to try first to implement the first configuration in order to know how an ingress works, and then, try to configure an ingress for GKE as per this documentation.
Let me know if you still having doubts about it or if you need more assistance.
Have a nice day, and stay safe.

Creating Load Balancer for kube-api server with High Availability Kubernetes Cluster

I am trying to create a High availability Kubernetes cluster for my CI/CD pipeline for deploying my Spring Boot microservices.
I am following the following kubernetes official document for exploring:
https://kubernetes.io/docs/setup/independent/high-availability/
My confusion is that - when reading, I found that need to create Load Balancer for kube-api server for forming the HA cluster. Actually I am planning to use AWS Ec2 machines for forming the cluster. So I will get Elastic Load Balancer from AWS. So do I need to create separate Load balancer as described in document or can I use the ELB for the same ?
You can use only ELB for this purpose.
Hopefully these Kubernetes and ELBs, The Hard Way instructions will be useful for you.

How to create application load balancer on aws for kubernetes

Question is similar to following SO question. But I am not looking forward to create classic load balancer.
How to create Kubernetes load balancer on aws
AWS now provide 2 types of loadbalancer, classic load balancer and application load balancer. Please read following document for more information,
https://aws.amazon.com/blogs/aws/new-aws-application-load-balancer/
I already know how classic load balancer work with kubernetes. I wonder if there is any flag/ tool exist so that we can also configure application loadbalancer.
An AWS ALB Ingress Controller has been built which you can find on GitHub: https://github.com/coreos/alb-ingress-controller
I can tell you that as of K8 v1.2.3/4 there is no built-in support for Application Load Balancers.
That said, what I do is expose internally load balanced pods via a service NodePort. You can then implement any type of AWS load balancing you would like, including new Application Load Balancing features such as Content-Based Routing, by setting up your own AWS ALB that directs a URL path like /blog to a specific NodePort.
You can read more about NodePorts here: http://kubernetes.io/docs/user-guide/services/#type-nodeport
For bonus points, you could script the creation of the ALB via something like BOTO3 and have it provisioned when you provision the K8 services/pods/rc.