
Answer-first summary for fast verification
Answer: Define a Service of type ClusterIP for `dispatch-order`. Configure `create-order` to use the Service IP address.
The correct answer is to define a Service of type ClusterIP for `dispatch-order` and configure `create-order` to use the Service IP address. ClusterIP exposes the Service on a cluster-internal IP, making it only reachable within the cluster. This ensures `dispatch-order` is not publicly accessible while allowing `create-order`, which is in the same GKE cluster, to access it. Other options involve exposing the service publicly (LoadBalancer) or risking port conflicts with autoscaling (NodePort), which are not suitable for this scenario. References: [Google Cloud Documentation](https://cloud.google.com/kubernetes-engine/docs/how-to/exposing-apps) and [Kubernetes Documentation](https://kubernetes.io/docs/concepts/services-networking/service/).
Author: LeetQuiz Editorial Team
Ultimate access to all questions.
No comments yet.
You have two workloads on Google Kubernetes Engine (GKE): create-order and dispatch-order. The create-order workload manages customer order creation, while dispatch-order handles sending orders to your shipping partner. Both workloads have cluster autoscaling enabled. The create-order deployment needs to access the dispatch-order deployment's web service, but dispatch-order must not be exposed publicly. How should you define the services?
A
Define a Service of type NodePort for dispatch-order and an Ingress Resource for that Service. Configure create-order to use the Ingress IP address.
B
Define a Service of type LoadBalancer for dispatch-order and an Ingress Resource for that Service. Configure create-order to use the Ingress IP address.
C
Define a Service of type LoadBalancer for dispatch-order. Configure create-order to use the Service IP address.
D
Define a Service of type ClusterIP for dispatch-order. Configure create-order to use the Service IP address.