Zama Ques
Zama Ques

Reputation: 1534

Memory and CPU requirements for Pod in GKE Cluster

Few queries on GKE Cluster resource requirements for Pods

A) What is the default memory and cpu allocation to Pods in a GKE cluster. A /27 subnet mask can accommodate 32 Pods in a Node in a GKE Cluster. But I want to understand how many pods we can spawn in a cluster with specific hardware specifications e.g in a node with 4 gb RAM and 2 CPU , what is the max number of pods that can be spawned with workload requirements of 200m memory and 1/4th of a Core per Pods besides the system pods. Also assuming single container per Pod.

B) Any way to measure CPU and memory usage in a GKE cluster ?

C) Another query is suppose I am offering a web service using Kuberenetes Load Balancer Service . What is the algorithm used to distribute traffic to the worker nodes. Or is it something like the Load Balancer uses Pods as back-ends instead of worker nodes

Upvotes: 0

Views: 2217

Answers (1)

Hernan
Hernan

Reputation: 120

The default CPU request is 0.1 Core, and there is No default CPU Limit set; and No Request nor Limit set for memory. [1]

That is why it is so important to define CPU/Memory Requests and Limits. One “not expected” pod/container/app can be hogging your node resources.

The amount of pods that can spawn, depends on many factors. The goal is that all resource requests are set based on real usage data and utilization is continuously tracked and monitored to correct those values (or behaviours).

A /27 CIDR Range will allow a maximum of 9-16 nodes, as the block always contains at least twice as many addresses as the maximum number of Pods per node. With the default maximum of 110 Pods per node, It assigns a /24 CIDR block.[2]

With Monitoring you can check the CPU/Memory usage of the cluster, you can view cluster's key metrics, such as CPU utilization, memory utilization. Cloud Operations for GKE has to be enabled.[3][4] (Cloud Console->Monitoring->Overview->View GKE Dashboard

The Http(s) Load balancer uses the pods/container/apps “exposed” outside the cluster by your definition.[5]

Upvotes: 1

Related Questions