ASSOCIATE-CLOUD-ENGINEER · Question #152
You have created a Kubernetes deployment, called Deployment-A, with 3 replicas on your cluster. Another deployment, called Deployment-B, needs access to Deployment-A. You cannot expose Deployment-A ou
The correct answer is D. Create a Service of type ClusterIP for Deployment A. Have Deployment B use the Service IP. A is not correct because this exposes Deployment A over the public internet. B is not correct because LoadBalancer will expose the service publicly. C is not correct because this exposes the service externally using a cloud provider's load balancer, and Ingress can work only with
Question
Options
- ACreate a Service of type NodePort for Deployment A and an Ingress Resource for that Service.
- BCreate a Service of type LoadBalancer for Deployment A. Have Deployment B use the Service IP
- CCreate a Service of type LoadBalancer for Deployment A and an Ingress Resource for that
- DCreate a Service of type ClusterIP for Deployment A. Have Deployment B use the Service IP
How the community answered
(36 responses)- A6% (2)
- B3% (1)
- C11% (4)
- D81% (29)
Explanation
A is not correct because this exposes Deployment A over the public internet. B is not correct because LoadBalancer will expose the service publicly. C is not correct because this exposes the service externally using a cloud provider's load balancer, and Ingress can work only with nodeport, not LoadBalancer. D is correct because this exposes the service on a cluster-internal IP address. Choosing this method makes the service reachable only from within the cluster. https://kubernetes.io/docs/concepts/services-networking/service/
Topics
Community Discussion
No community discussion yet for this question.