Kubernetes CPU allocation: is vCore vs vCPU vs core in Azure?

3.3k Views Asked by At

I am running a Java application on an Azure Kubernetes node with a Standard_D8s_v3 VM. I am unsure about CPU allocation for a kubernetes deployment. This mentions that 1 CPU is equals to 1 Azure vCore. However the Azure VM specs mentions that Standard_D8s_v3 has 8 vCPUs (not vCores). What is the difference between vCPU and vCore?

Here you can see that the ratio of a Ds_v3 VM vCPU to cores (not vCores) is 2:1 due to Hyperthreading. Which means that 2 vCPUs are needed for the same performance of 1. Is vCore == core? If so, my assumption is that I should double the size of the VM.

Or, should I assume that 1 kubernetes CPU is equals to 1 vCPU?

2

There are 2 best solutions below

2
On BEST ANSWER

Correct, 1 Kubernetes CPU equals 1 vCPU.

For example i am using Standard_D4s_v3 nodes which have 4 vCPU according to here.

When i do

kubectl get nodes
kubectl describe node <node-name>

i can see this

Capacity:
  cpu:                            4
Allocatable:
  cpu:                            3860m

Here is also good explanation whats the difference between a Core and vCPU on Azure.

0
On

The CPU resource is measured in CPU units. One CPU, in Kubernetes, is equivalent to:

1 AWS vCPU
1 GCP Core
1 Azure vCore
1 Hyperthread on a bare-metal Intel processor with Hyperthreading