
Answer-first summary for fast verification
Answer: Use an Ingress that uses the API's URL to route requests to the appropriate backend.
The best approach is to use an Ingress with URL-based routing. This allows different API versions to be hosted under distinct URL paths (e.g., /v1, /v2), ensuring backward compatibility. Existing consumers continue using the old URL, while new consumers adopt the updated version. Google recommends this method for versioning APIs in Kubernetes, as it decouples clients from backend changes and avoids disruptions. Other options like service discovery (B) lack explicit version control, multiple clusters (C) add complexity, and embedding versions in POST requests (D) violates RESTful principles.
Author: LeetQuiz Editorial Team
Ultimate access to all questions.
When designing an application with multiple microservices, each with its own RESTful API deployed as separate Kubernetes Services, how should you configure the connections to ensure API consumers and third-party systems are not impacted by API changes or new version releases, following Google's recommended best practices?
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.
No comments yet.