Google Professional Cloud Developer Question 20
Single answerGoogle Cloud PlatformYour team is modernizing an on-premises monolithic application by containerizing it to run on Google Kubernetes Engine (GKE). The application has tightly coupled components that share a local disk for temporary file storage and rely on the local file system for inter-process communication. What is the BEST approach to successfully containerize and deploy this application on GKE?
- A
Use a single container to package the entire monolith and deploy it as a single Pod on GKE.
- B
Break the monolith into separate microservices, each running in its own container, and use PersistentVolumes for shared storage.
- C
Deploy the monolith as multiple containers within a single Pod, using an emptyDir volume for shared storage.
- D
Convert the monolith into serverless functions and deploy them using Cloud Functions.
Show answer and explanation
Correct answer: C
Explanation
The best approach in this scenario is to deploy the monolith as multiple containers within a single Pod, using an emptyDir volume for shared temporary storage. This allows the tightly coupled components to communicate and share storage as they did previously, while leveraging Kubernetes' features. Although breaking the monolith into microservices or moving to serverless architecture is a long-term goal, those strategies are not immediately feasible due to the application's dependencies on shared storage and inter-process communication.
- A. Incorrect.
This approach does not address the challenge of shared storage and inter-process communication. Using a single container for the entire monolith misses the opportunity to benefit from Kubernetes' features like volumes.
- B. Incorrect.
While breaking the monolith into microservices is ideal for modernization, it is not the best short-term solution for an application tightly coupled with shared storage and inter-process communication. PersistentVolumes also add unnecessary complexity for temporary storage.
- C. Correct.
Deploying the monolith as multiple containers within a single Pod and using an emptyDir volume ensures that all containers in the Pod can share storage and communicate effectively. This approach leverages Kubernetes' native capabilities while keeping the architecture aligned with the application's current design.
- D. Incorrect.
This option is unsuitable because serverless functions are not designed to handle tightly coupled components that rely on shared storage or inter-process communication.