PROFESSIONAL-CLOUD-DEVELOPER · Question #102
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…
The correct answer is A. Package each component in a separate container. Implement readiness and liveness probes. Packaging each component (Apache, MySQL, PHP) in a separate container and implementing readiness and liveness probes follows Google's recommended best practices for Kubernetes. This is the microservices/container best practice: one process per container, which allows each…
Question
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?
Options
- APackage each component in a separate container. Implement readiness and liveness probes.
- BPackage the application in a single container. Use a process management tool to manage each
- CPackage each component in a separate container. Use a script to orchestrate the launch of the
- DPackage the application in a single container. Use a bash script as an entrypoint to the container,
How the community answered
(61 responses)- A79% (48)
- B7% (4)
- C2% (1)
- D13% (8)
Explanation
Packaging each component (Apache, MySQL, PHP) in a separate container and implementing readiness and liveness probes follows Google's recommended best practices for Kubernetes. This is the microservices/container best practice: one process per container, which allows each component to scale independently, be updated separately, and fail in isolation without taking down the others. Readiness probes ensure a pod only receives traffic when it's ready, and liveness probes allow Kubernetes to restart unhealthy containers automatically, maximizing availability. Options B and D (single container with process manager or bash script) violate the one-process-per-container principle and make scaling and fault isolation harder. Option C (separate containers with a launch script) bypasses Kubernetes' native orchestration, which is the wrong approach when using GKE.
Topics
Community Discussion
No community discussion yet for this question.