nerdexam
Google

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…

Designing and developing applications on Google Kubernetes Engine

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)
  • A
    79% (48)
  • B
    7% (4)
  • C
    2% (1)
  • D
    13% (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

#GKE#Containerization#Health Checks#Application Architecture

Community Discussion

No community discussion yet for this question.

Full PROFESSIONAL-CLOUD-DEVELOPER Practice