Google Professional Cloud Developer Question 381
Single answerGoogle Cloud PlatformYou are deploying a machine learning model as a containerized application on Google Kubernetes Engine (GKE). The model requires at least 4 CPUs and 8 GB of memory to function correctly under normal load. You also want to ensure that the application can scale up during peak times and avoid over-provisioning. Which configuration should you include in the Kubernetes Deployment manifest to define the workload specifications?
- A
Set 'resources.requests' to 'cpu: 4' and 'memory: 8Gi' and 'resources.limits' to 'cpu: 8' and 'memory: 16Gi'.
- B
Set 'resources.requests' to 'cpu: 2' and 'memory: 4Gi' and 'resources.limits' to 'cpu: 4' and 'memory: 8Gi'.
- C
Set 'resources.requests' to 'cpu: 4' and 'memory: 8Gi' and do not specify 'resources.limits'.
- D
Set 'resources.requests' to 'cpu: 8' and 'memory: 16Gi' and 'resources.limits' to 'cpu: 8' and 'memory: 16Gi'.
Show answer and explanation
Correct answer: A
Explanation
Defining workload specifications in Kubernetes requires balancing the application's minimum resource requirements with the ability to handle peak load efficiently. By setting 'resources.requests' to the minimum needed (4 CPUs and 8 GB memory) and 'resources.limits' to a higher value (8 CPUs and 16 GB memory), you ensure the application has the resources it needs to run under normal conditions while allowing it to scale during high demand. This approach also prevents resource overuse by other workloads in the cluster.
- A. Correct.
This is the correct configuration. Setting 'resources.requests' to 'cpu: 4' and 'memory: 8Gi' ensures the application has the minimum required resources to function optimally. Setting 'resources.limits' to 'cpu: 8' and 'memory: 16Gi' allows the application to scale up during peak load without over-provisioning.
- B. Incorrect.
This option underprovisions the requested resources ('cpu: 2' and 'memory: 4Gi') below the minimum required for the application to function correctly, leading to possible resource starvation.
- C. Incorrect.
While this configuration ensures the application has the minimum required resources, omitting 'resources.limits' can result in unbounded resource usage, potentially affecting other workloads in the cluster.
- D. Incorrect.
This option overprovisions both the requested and limited resources, leading to inefficient resource usage and unnecessary costs.