PROFESSIONAL-CLOUD-DEVELOPER · Question #268
You are working on a new application that is deployed on Cloud Run and uses Cloud Functions. Each time new features are added, new Cloud Functions and Cloud Run services are deployed. You use ENV vari
The correct answer is B. Create a Service Directory namespace. Use API calls to register the services during deployment,. Google Cloud Service Directory is the purpose-built, fully managed service registry for dynamic service discovery. You create a namespace, then register each Cloud Run service and Cloud Function endpoint during deployment via API calls. Other services query Service Directory at r
Question
You are working on a new application that is deployed on Cloud Run and uses Cloud Functions. Each time new features are added, new Cloud Functions and Cloud Run services are deployed. You use ENV variables to keep track of the services and enable interservice communication, but the maintenance of the ENV variables has become difficult. You want to implement dynamic discovery in a scalable way. What should you do?
Options
- AConfigure your microservices to use the Cloud Run Admin and Cloud Functions APIs to query for
- BCreate a Service Directory namespace. Use API calls to register the services during deployment,
- CRename the Cloud Functions and Cloud Run services endpoint is using a well-documented
- DDeploy Hashicorp Consul on a single Compute Engine instance. Register the services with
How the community answered
(58 responses)- A16% (9)
- B72% (42)
- C7% (4)
- D5% (3)
Explanation
Google Cloud Service Directory is the purpose-built, fully managed service registry for dynamic service discovery. You create a namespace, then register each Cloud Run service and Cloud Function endpoint during deployment via API calls. Other services query Service Directory at runtime to discover endpoints dynamically, eliminating the need to manage ENV variables manually. Choice A (querying Admin APIs directly) is possible but not a scalable discovery pattern and tightly couples services to GCP management APIs. Choice C (naming conventions) does not enable dynamic discovery-it still requires hardcoded ENV variables. Choice D (HashiCorp Consul on a single Compute Engine instance) introduces a single point of failure, is not fully managed, and requires ongoing infrastructure maintenance.
Topics
Community Discussion
No community discussion yet for this question.