Google Cloud Professional Cloud Developer — Question 87
You are porting an existing Apache/MySQL/PHP application stack from a single machine to Google
Kubernetes Engine. You need to determine how to containerize the application. Your approach should follow Google-recommended best practices for availability.
What should you do?
Answer options
- A. Package each component in a separate container. Implement readiness and liveness probes.
- B. Package the application in a single container. Use a process management tool to manage each component.
- C. Package each component in a separate container. Use a script to orchestrate the launch of the components.
- D. Package the application in a single container. Use a bash script as an entrypoint to the container, and then spawn each component as a background job.
Correct answer: A
Explanation
The correct answer is A because packaging each component in its own container allows for better scalability and availability, along with the implementation of readiness and liveness probes to monitor the health of each service. Options B and D are incorrect as they attempt to run multiple components in a single container, which goes against best practices for containerization. Option C, while better than B and D, lacks the health monitoring that probes provide, which is crucial for maintaining availability.