Google Cloud Professional Cloud Developer — Question 200
You are designing an application that consists of several microservices. Each microservice has its own RESTful API and will be deployed as a separate Kubernetes Service. You want to ensure that the consumers of these APIs aren't impacted when there is a change to your API, and also ensure that third-party systems aren't interrupted when new versions of the API are released. How should you configure the connection to the application following Google-recommended best practices?
Answer options
- A. Use an Ingress that uses the API's URL to route requests to the appropriate backend.
- B. Leverage a Service Discovery system, and connect to the backend specified by the request.
- C. Use multiple clusters, and use DNS entries to route requests to separate versioned backends.
- D. Combine multiple versions in the same service, and then specify the API version in the POST request.
Correct answer: A
Explanation
The correct answer is A because using an Ingress allows you to manage traffic efficiently and route requests to the appropriate backend based on the API's URL, ensuring consumers are not affected by API changes. The other options may introduce complexity or potential service interruptions, such as relying on Service Discovery or managing multiple clusters, which do not align with the best practices for versioning and stability.