If I expose a (single) web service (say http://a.b.c.d
or https://a.b.c.d
) on a (small) Kubernetes 1.13 cluster, what is the benefit of using Ingress
over a Service
of type ClusterIP
with externalIPs [ a.b.c.d ]
alone?
The address a.b.c.d
is routed to one of my cluster nodes. Ingress
requires installing and maintaining an ingress controller, so I am wondering when this is justified.
In Kubernetes, a Service and an Ingress are both used to expose your application to the external world, but they operate at different layers of the networking stack and have different functionalities.
A Service is a Kubernetes resource that provides a stable IP address and DNS name for a set of Pods that provide the same functionality. It allows for load balancing traffic between the Pods, and also provides a way for one Pod to discover and communicate with another Pod using its stable DNS name or IP address. Services are used within the cluster to route traffic between internal components and can also be exposed to the outside world using a NodePort or LoadBalancer.
An Ingress, on the other hand, is a Kubernetes resource that provides a way to expose HTTP and HTTPS routes from outside the cluster to services within the cluster. It acts as a layer 7 (application layer) load balancer, routing incoming traffic based on the request's path or hostname. An Ingress is typically used for applications that require more advanced routing and traffic management capabilities, such as SSL termination, virtual hosting, and path-based routing.
In summary, a Service is used for internal traffic management within the cluster, while an Ingress is used to route external traffic into the cluster and to specific services based on advanced routing rules.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With