Cloud Run services and Cloud Functions are frequently deployed and ENV-based service discovery is hard to maintain. How should you implement scalable dynamic service discovery?
Choose an answer
Tap an option to check your answer.
Correct answer: Create a Service Directory namespace; register services during deployment and query Service Directory at runtime..
Why this is the answer
Service Directory provides a managed solution for registering and discovering services, making it ideal for dynamic environments like Cloud Run and Cloud Functions. Services register themselves upon deployment, and clients can query Service Directory at runtime to find current endpoints, ensuring scalability and up-to-date information. Calling Cloud Run Admin and Cloud Functions APIs directly for discovery is inefficient and not designed for high-frequency runtime lookups, potentially leading to API rate limits and increased latency. Adopting a naming convention is a static approach that doesn't handle dynamic IP addresses, scaling, or service failures, making it unsuitable for scalable dynamic discovery. Installing HashiCorp Consul on a single Compute Engine VM introduces a single point of failure and requires managing the Consul infrastructure, which is antithetical to the serverless nature of Cloud Run and Cloud Functions.
Pass your exam — without the endless answer hunt
Get every verified question and explanation for this exam in one place, and save hours of prep. 1,000+ certifications · 20+ languages · free to start.
Pass your exam faster → No card needed