Your application is deployed in a Google Kubernetes Engine (GKE) cluster. You want to expose this application publicly behind a Cloud Load Balancing HTTP(S) load balancer. What should you do?
A.
Configure a GKE Ingress resource.
B.
Configure a GKE Service resource.
C.
Configure a GKE Ingress resource with type: LoadBalancer.
D.
Configure a GKE Service resource with type: LoadBalancer.
For me the right answer is D.
The Ingress Object create a global http(s) L.B. The advantage of having a layer 7 load balancer is that we can configure advanced things at network layer 7. For example to route traffic based on the path of the request and so on. In the question it seems that is not needed, so for me a Load Balancer Service is ok since it creates a network load balancer (TCP/UDP) that is ok for HTTP or HTTPS exposing (since we can configure any TCP/UDP port to be exposed to The Internet)
A)
The important part of the question is this "...expose this application publicly behind a Cloud Load Balancing HTTP(S) load balancer." This means it is an L7 exposure using HTTPS (a Service of type "LoadBalancer" would only create an L4 exposure - IP only... No HTTPS).
So Ingress is the choice you should make. And in GKE, luckily this is one thing - create an ingress and the LB will be attached automagically ;D
The correct answer is A. Configure a GKE Ingress resource.
Here's why:
Ingress for External Load Balancing: Ingress is the Kubernetes resource specifically designed for managing external HTTP(S) traffic to services within your cluster. When you create an Ingress resource, GKE automatically provisions and configures a Cloud Load Balancing HTTP(S) load balancer to route traffic to your application.
Let's break down why the other options are incorrect:
B. Configure a GKE Service resource: Services in Kubernetes are used to expose applications within the cluster. While you can create a Service of type LoadBalancer , this will create an internal load balancer within the cluster, not an external one.
C. Configure a GKE Ingress resource with type: LoadBalancer: Ingress resources don't have a type field. The LoadBalancer type is used for Services, not Ingress.
D. Configure a GKE Service resource with type: LoadBalancer: This would create an internal load balancer within the cluster, not an external one.
A. Configure a GKE Ingress resource. This option correctly configures the Ingress resource which is designed to expose HTTP and HTTPS routes from outside the cluster to services within the cluster.
B. Configure a GKE Service resource.
This option only exposes the application internally within the cluster unless the service type is specified as LoadBalancer.
C. Configure a GKE Ingress resource with type: LoadBalancer.
This option is incorrect because Ingress resources do not have a type: LoadBalancer property. The Ingress resource itself manages the creation of a load balancer.
D. Configure a GKE Service resource with type: LoadBalancer.
This option creates a TCP/UDP load balancer, not an HTTP(S) load balancer, which does not meet the requirements for an HTTP(S) load balancer.
To expose your application publicly behind a Cloud Load Balancing HTTP(S) load balancer in a Google Kubernetes Engine (GKE) cluster, we should configure a GKE Ingress resource. This approach allows you to define rules for routing external HTTP(S) traffic to internal services based on hostnames and URL paths.
The correct answer is D
Configuring a GKE ingress resource is not enough, you also need to expose the service with the type NodePort and then configure the ingress resource to point to that service.
D is sufficient, then D is the correct answer. A lacks some more work.
To expose your application publicly behind a Cloud Load Balancing HTTP(S) load balancer in a GKE cluster, you should configure a GKE Ingress resource or a GKE Service resource with type: LoadBalancer.
To configure a GKE Ingress resource, you need to define rules for routing HTTP(S) traffic to the application in the cluster. This is done by creating an Ingress object, which is associated with one or more Service objects, each of which is associated with a set of Pods. The GKE Ingress controller will then create a Google Cloud HTTP(S) Load Balancer and configure it according to the information in the Ingress and its associated Services.
Alternatively, you can configure a GKE Service resource with type: LoadBalancer to expose your application publicly. This will create a Cloud Load Balancing HTTP(S) load balancer and associate it with the Service. The Service will then route traffic to the application Pods.
https://cloud.google.com/kubernetes-engine/docs/concepts/ingress
GKE Ingress for HTTP(S) Load Balancing
This page provides a general overview of what Ingress for HTTP(S) Load Balancing is and how it works. Google Kubernetes Engine (GKE) provides a built-in and managed Ingress controller called GKE Ingress. This controller implements Ingress resources as Google Cloud load balancers for HTTP(S) workloads in GKE.
(D) is not correct as service with type LoadBalancer create network load balancer not http load balancer.
(A) is correct ingress will create http balancer without the need of specify type
https://cloud.google.com/kubernetes-engine/docs/concepts/ingress#overview
https://cloud.google.com/kubernetes-engine/docs/tutorials/http-balancer:
"When you specify kind: Service with type: LoadBalancer in the resource manifest, GKE creates a Service of type LoadBalancer"
D is correct
Changing my answer to A
https://cloud.google.com/kubernetes-engine/docs/concepts/ingress:
"In GKE, an Ingress object defines rules for routing HTTP(S) traffic to applications running in a cluster. An Ingress object is associated with one or more Service objects, each of which is associated with a set of Pods. To learn more about how Ingress exposes applications using Services, see Service networking overview.
When you create an Ingress object, the GKE Ingress controller creates a Google Cloud HTTP(S) Load Balancer and configures it according to the information in the Ingress and its associated Services."
A voting comment increases the vote count for the chosen answer by one.
Upvoting a comment with a selected answer will also increase the vote count towards that answer by one.
So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.
donchick
Highly Voted 3 years, 11 months ago[Removed]
2 years, 6 months agomastodilu
3 years, 6 months agoValant
Highly Voted 3 years agothewalker
Most Recent 4 months, 1 week agothewalker
4 months, 1 week agod_ella2001
4 months, 2 weeks agoIbrahim_Hasan
7 months ago__rajan__
1 year, 2 months ago[Removed]
1 year, 9 months agoomermahgoub
1 year, 10 months agotomato123
2 years, 3 months agonehaxlpb
2 years, 4 months agoruben82
2 years, 6 months agoruben82
2 years, 6 months agolxs
1 year, 11 months ago[Removed]
3 years, 4 months agosyu31svc
3 years, 4 months agosyu31svc
3 years, 4 months agomastodilu
3 years, 6 months ago