Reputation: 23267
Question is straightforward, but I've not been able to quite figure out which steps a request follows when it reaches kubernetes system.
Ingress Controller
, LoadBalancer
, ClusterIP
...So, I know there are several ways to make pods externally accessible:
NodePort
service.LoadBalancer
service.Ingress
rule.Some questions here related with best-practices or mandatory facts?
Ingress
is in front of a ClusterIP Service
mandatory?
1.1 Could or shouldn't I create an Ingress
in front of a NodePort
or a LoadBalancer
service?
Ingress Controllers
are LoadBalancer Services
? I mean, traefik
or other Ingress Controllers
are all of them deployed as LoadBalancer
services?
Misunderstanding arises from several texts I've found over there:
LoadBalancer
is placed first of Ingress Controllers
.Ingress
is in front of a LoadBalancer
.Above questions arises from an attempt of expose externally a mongodb
replicatset.
LoadBalancer
for each node. Is this correct?Ingress Controller
for those LoadBalancer
. Can this be possible?Upvotes: 1
Views: 307
Reputation: 5635
Ingress is in front of a ClusterIP Service mandatory?
If you want the service accessible externally, then you will need an externally accessible service. This can be a LoadBalancer service or an Ingress. A ClusterIP service is not accessible outside the cluster.
Could or shouldn't I create an Ingress in front of a NodePort or a LoadBalancer service?
You can create an Ingress in front of a NodePort or LoadBalancer, but there's no point in creating an Ingress in front of a LoadBalancer unless you want two different endpoints for accessing the same service (the LoadBalancer will get one IP and the Ingress Controller's own LoadBalancer will get another IP). However, using an Ingress will allow you to have additional functionality, such as SSL Certificates, which the standard LoadBalancer service resource does not (normally) provide
Ingress Controllers are LoadBalancer Services? I mean, traefik or other Ingress Controllers are all of them deployed as LoadBalancer services?
Correct. An Ingress controller opens an endpoint for traffic into the cluster, and then uses the ingress resources you create in the cluster to determine how and where to route the traffic.
The endpoint is a publicly accessible endpoint (unless you configure it to be an internal loadbalancer, in which case only machines within your corporate network will be able to access it).
The controller will normally update the Ingress resource in your cluster so you will see the IP of the loadbalancer belonging to the ingress
Upvotes: 3