Google Professional Cloud Developer Question 21
Select 3Google Cloud PlatformYour organization is modernizing an existing monolithic application by migrating it to Google Kubernetes Engine (GKE). The application currently stores session data in memory, making it difficult to scale effectively. What steps should you take to modernize this application and make it scalable while leveraging GKE?
- A
Refactor the application to store session data in a distributed cache such as Memorystore.
- B
Configure a StatefulSet in GKE to ensure each pod maintains its own session data.
- C
Containerize the application using Docker and deploy it to GKE as a Deployment.
- D
Leverage Kubernetes Horizontal Pod Autoscaler to dynamically scale pods based on CPU usage.
- E
Use a Persistent Volume Claim (PVC) to store session data for each pod.
Show answer and explanation
Correct answers: A, C, D
Explanation
To modernize the application and make it scalable on GKE, session state must be externalized from the pods. A distributed cache like Memorystore ensures session data is shared across instances, enabling horizontal scaling. Containerizing the application and deploying it as a Deployment on GKE is essential for leveraging Kubernetes features like the Horizontal Pod Autoscaler to dynamically scale pods. These steps ensure the application is modernized and ready for a scalable, containerized environment.
- A. Correct.
Storing session data in a distributed cache like Memorystore ensures session data is shared across all instances of the application, enabling horizontal scaling.
- B. Incorrect.
Using a StatefulSet is not suitable for this scenario because StatefulSets are designed for stateful applications, and storing session data in-memory per pod would not solve the scalability issue.
- C. Correct.
Containerizing the application and deploying it to GKE as a Deployment is a necessary step to modernize and run the application in a Kubernetes environment.
- D. Correct.
Kubernetes Horizontal Pod Autoscaler allows the application to scale dynamically based on resource usage, improving performance and scalability.
- E. Incorrect.
Using a Persistent Volume Claim (PVC) for session data is not recommended for this scenario, as it would not effectively address the need for scalable session management.