Topic 1 Question 79
You want your Google Kubernetes Engine cluster to automatically add or remove nodes based on CPU load. What should you do?
Configure a HorizontalPodAutoscaler with a target CPU usage. Enable the Cluster Autoscaler from the GCP Console.
Configure a HorizontalPodAutoscaler with a target CPU usage. Enable autoscaling on the managed instance group for the cluster using the gcloud command.
Create a deployment and set the maxUnavailable and maxSurge properties. Enable the Cluster Autoscaler using the gcloud command.
Create a deployment and set the maxUnavailable and maxSurge properties. Enable autoscaling on the cluster managed instance group from the GCP Console.
ユーザの投票
コメント(17)
Answer: A Support: How does Horizontal Pod Autoscaler work with Cluster Autoscaler?
Horizontal Pod Autoscaler changes the deployment's or replicaset's number of replicas based on the current CPU load. If the load increases, HPA will create new replicas, for which there may or may not be enough space in the cluster. If there are not enough resources, CA will try to bring up some nodes, so that the HPA-created pods have a place to run. If the load decreases, HPA will stop some of the replicas. As a result, some nodes may become underutilized or completely empty, and then CA will terminate such unneeded nodes.
👍 46Unfaithful2021/07/22i'm for A, but the question in ambiguous, because requires the autoscale of nodes (not pod) when the cpu overload, but in answer use k8s pod autoscaler based on cpu load ( cpu load for pod, not nodes ). strange
👍 22natpilot2020/01/26Create Horizontal Autoscaler (min,max for pods): kubectl autoscale deployment my-app --max 6 --min 4 --cpu-percent 50 Autoscaling cluster: gcloud container clusters create example-cluster
--zone us-central1-a
--node-locations us-central1-a,us-central1-b,us-central1-f
--num-nodes 2 --enable-autoscaling --min-nodes 1 --max-nodes 4 Check scaling an application and Horizontal Pod Autoscaler: https://kubernetes.io/docs/tasks/run-application/horizontal-pod-autoscale/ Manual Cluster Resizing: https://cloud.google.com/kubernetes-engine/docs/how-to/resizing-a-cluster https://cloud.google.com/kubernetes-engine/docs/how-to/scaling-apps👍 5MaxNRG2021/10/28
シャッフルモード