Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can kubernetes Ingress Nginx be autoscaled?

When the Ingress Nginx controller reach its full capacity does it auto scale? Is Kubernetes Ingress even scalable?

like image 492
xFiler Avatar asked Feb 07 '18 17:02

xFiler


People also ask

Can nginx ingress controller be used as an egress controller?

Install NGINX Plus Ingress Controller This is because we are using NGINX Plus Ingress Controller for egress only, which means we don't need an external IP address. The sidecar proxy will route egress traffic to the NGINX Plus Ingress Controller's Pod IP.

Is nginx Ingress a load balancer?

Coming to your query Ingress-nginx is not a load balancer but on a broader lever can help you with load balancing.

Is Kubernetes ingress-nginx?

Overview. ingress-nginx is an Ingress controller for Kubernetes using NGINX as a reverse proxy and load balancer. Learn more about Ingress on the main Kubernetes documentation site.

Is ingress same as nginx?

Ingress controller get the packet, checks ingress rules and determines to which service to deliver the packet. Nginx ingress controller uses LoadBalancer type service actually as entrypoint to the cluster. Then is checks ingress rules and distributes the load. This can be very confusing.

How do I use nginx ingress controller with Kubernetes?

Nginx ingress controller by Nginx Inc We will be using the Nginx controller from the kubernetes community. Ingress controller needs a specific namespace, service account, cluster role bindings, configmaps etc. You can create all the kubernetes objects mentioned using the yaml file from official ingress repo.

How many Nginx ingress controllers are there?

There are two nginx ingress controllers. We will be using the Nginx controller from the kubernetes community. Ingress controller needs a specific namespace, service account, cluster role bindings, configmaps etc.

What is the difference between ingress and Kubernetes load balancer?

This also offers a public user-friendly URL for the end-users. But the Ingress is just routing rules, Kubernetes requires an Ingress Controller that grabs these routing rules and configure the Load Balancer dynamically in your K8s cluster. The cloud environments like AWS, AZure, GCP, etc., the Ingress Controller is supplied by the cloud provider.

What is the ingressclass annotation in Kubernetes?

Before the IngressClass resource and ingressClassName field were added in Kubernetes 1.18, Ingress classes were specified with a kubernetes.io/ingress.class annotation on the Ingress. This annotation was never formally defined, but was widely supported by Ingress controllers.


2 Answers

In principle, the NGINX ingress controller is indeed scalable -- it pulls its entire configuration from the Kubernetes API server and is in itself basically stateless.

In practice, this depends very much on how your ingress controller is set up. First of all, the ingress controller will not auto-scale by itself. If you have deployed it using a Deployment controller, you can use horizontal pod autoscaling as described in the documentation. If you have deployed it using a DaemonSet, the ingress controller will automatically scale up and down with your cluster (maybe even automatically, if you're using the cluster autoscaler).

In both scenarios, you're going to need a Service definition (possibly of type NodePort or LoadBalancer, to allow for external traffic) that matches all pods created by the deployment/daemon set to distribute traffic among them.

like image 99
helmbert Avatar answered Oct 28 '22 17:10

helmbert


Yes, it is possible to autoscale nginx ingress controller in two ways:

  1. Kubernetes' Horizontal Pod Autoscaler.
  2. Use multiple nginx ingress controllers per https://github.com/nginxinc/kubernetes-ingress/tree/master/examples/multiple-ingress-controllers. In this approach, you would need multiple nginx ingress resources too to load-balance the traffic to the backend pods. https://github.com/nginxinc/kubernetes-ingress/tree/master/examples/complete-example has example/sample ingress resource for nginx.

The "least connection" (least conn) configuration is not related to autoscaling of nginx. It is the load-balancing algorithm used by nginx and can be changed to others (round robin or ip hash) in the nginx configuration file (nginx.conf) using ConfigMaps.

like image 22
Vikram Hosakote Avatar answered Oct 28 '22 16:10

Vikram Hosakote