How to manually extract the vCPU consumption in Tanzu Kubernetes Grid
search cancel

How to manually extract the vCPU consumption in Tanzu Kubernetes Grid

book

Article ID: 337412

calendar_today

Updated On:

Products

Tanzu Kubernetes Grid

Issue/Introduction

To measure Tanzu Kubernetes Grid (TKG) core consumption on vSphere you need to first measure the vCPU consumption.

VMware gets vCPU consumption if you opt-in to telemetry. For customers that do not opt-in to telemetry, you can extract the vCPU consumption. This articles covers how to manually extract the vCPU consumption. 


Environment

VMware Tanzu Kubernetes Grid 1.x

Resolution

To manually extract the vCPU consumption, follow these steps: 

1. Get a listing of all TKG deployed clusters:

tanzu cluster list --include-management-cluster



Screen Shot 2021-07-05 at 11.34.20 PM.png

 

2. Repeat the following steps per cluster, including the Management Cluster.

a. Get cluster credentials for each Kubernetes cluster from the Tanzu CLI.

tanzu cluster kubeconfig get [cluster-name] --admin


Screen Shot 2021-07-05 at 11.36.18 PM.png

b. Get all the nodes in the cluster.

kubectl get nodes

c. Record the total CPU capacity per cluster in the provided template.

kubectl describe node [node-name]

d. Optional: Describe all nodes at once.

kubectl describe node

e. Optional: Describe all nodes at once and filter the results.
  • Windows: kubectl describe node | select-string cpu
  • Linux/Mac: kubectl describe node| grep cpu
Screen Shot 2021-07-09 at 12.05.00 PM.png

3. Add up the total CPU capacity from all the clusters, and record the total CPU capacity for the TKG environment in the provided template.