Home  >  Article  >  What software is ingress?

What software is ingress?

小老鼠
小老鼠Original
2023-07-07 11:08:263342browse

ingress is a non-threatening file software with a file size of 364KB. It is a k8s resource object used to expose services to the outside world. This resource object defines the binding of different host names and URLs to the corresponding back-end Service. Depending on the The path routes http and https traffic.

What software is ingress?

Ingress introduction

Ingress is a non-threatening file with a file size of 364KB. It is a k8s resource object used for Externally exposed services, this resource object defines the binding of different host names (domain names) and URLs to the corresponding back-end Service (k8s Service), routing http and https traffic according to different paths.

The relationship between nodePort, LoadBalancer and Ingress

There are three ways to expose services to the outside of the k8s cluster: nodePort, LoadBalancer and Ingress.

The nodePort method will cause more and more ports to be opened on the nodes when the number of services increases, which is difficult to manage.

LoadBalancer is more suitable to be used in conjunction with the LB of the cloud provider, but the cost cannot be underestimated when there are more and more LBs.

What software is ingress?

We can see that both LoadBalancers have their own IPs. If we send a request to LoadBalancer 22.33.44.55, it will be redirected to our internal service- nginx service goes. If you send a request to 77.66.55.44, it will be redirected to our internal service-python service.

This is indeed very convenient, but you must know that IP addresses are relatively rare and not cheap. Imagine that there are not just two services in our Kubernetes cluster, but if there are many, the cost of creating LoadBalancers for these services will increase exponentially.

Ingress is the method officially provided by k8s for exposing services to the outside world. It is also a method commonly used in production environments. Generally, in cloud environments, the LB Ingress Ctroller method is used to provide services to the outside world. You can use Ingress to use it. Internal services are exposed outside the cluster, which saves you valuable static IPs because you don't need to declare multiple LoadBalancer services. This time, it can also perform more additional configurations.

What software is ingress?

ingress Controller

Ingress Controller is a pod service that encapsulates a web front-end load balancer and is based on it It implements dynamic awareness of Ingress and dynamically generates the configuration file of the front-end web load balancer according to the definition of Ingress. For example, the Nginx Ingress Controller is essentially an Nginx, but it can dynamically generate the Nginx configuration file according to the definition of the Ingress resource, and then dynamically Reload .

What software is ingress?

So, in general, to use Ingress, you must first deploy the Ingress Controller entity (equivalent to the front-end Nginx), and then create the Ingress (equivalent to the k8s resource configured by Nginx Reflected), after the Ingress Controller is deployed, it will dynamically detect the creation of the Ingress and generate the corresponding configuration. There are many implementations of Ingress Controller: some are based on Nginx, some are based on HAProxy, and there are also Kong Ingress Controller based on OpenResty, etc.

The above is the detailed content of What software is ingress?. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn