Difference between revisions of ".status.capacity"

From wikieduonline
Jump to navigation Jump to search
(Created page with "* <code>kubectl get nodes -o json | jq ".items[] | {name:.metadata.name} + .status.capacity"</code>")
 
 
(5 intermediate revisions by the same user not shown)
Line 1: Line 1:
 
* <code>[[kubectl get nodes]] -o json | [[jq]] ".items[] | {name:.metadata.name} + .status.capacity"</code>
 
* <code>[[kubectl get nodes]] -o json | [[jq]] ".items[] | {name:.metadata.name} + .status.capacity"</code>
 +
 +
 +
[[kubectl get nodes -o json]] | [[jq -r]] '.items[] | select(.status.capacity."[[nvidia.com/gpu]]" != null) | {name: .metadata.name, capacity: .status.capacity}'
 +
 +
 +
 +
{
 +
  "name": "node1",
 +
  "cpu": "8",
 +
  "[[ephemeral-storage]]": "65504Mi",
 +
  "hugepages-1Gi": "0",
 +
  "hugepages-2Mi": "1364Mi",
 +
  "memory": "32946972Ki",
 +
  "pods": "110"
 +
}
 +
{
 +
  "name": "node2",
 +
  "cpu": "8",
 +
  "ephemeral-storage": "65504Mi",
 +
  "hugepages-1Gi": "0",
 +
  "hugepages-2Mi": "1364Mi",
 +
  "memory": "32946972Ki",
 +
  "pods": "110"
 +
}
 +
{
 +
  "name": "node3",
 +
  "cpu": "8",
 +
  "ephemeral-storage": "65504Mi",
 +
  "hugepages-1Gi": "0",
 +
  "hugepages-2Mi": "1364Mi",
 +
  "memory": "32946972Ki",
 +
  "pods": "110"
 +
}
 +
 +
== See also ==
 +
* {{kubectl get nodes}}
 +
 +
[[Category:Kubernetes]]

Latest revision as of 08:53, 18 October 2024


kubectl get nodes -o json | jq -r '.items[] | select(.status.capacity."nvidia.com/gpu" != null) | {name: .metadata.name, capacity: .status.capacity}'


{
 "name": "node1",
 "cpu": "8",
 "ephemeral-storage": "65504Mi",
 "hugepages-1Gi": "0",
 "hugepages-2Mi": "1364Mi",
 "memory": "32946972Ki",
 "pods": "110"
}
{
 "name": "node2",
 "cpu": "8",
 "ephemeral-storage": "65504Mi",
 "hugepages-1Gi": "0",
 "hugepages-2Mi": "1364Mi",
 "memory": "32946972Ki",
 "pods": "110"
}
{
 "name": "node3",
 "cpu": "8",
 "ephemeral-storage": "65504Mi",
 "hugepages-1Gi": "0",
 "hugepages-2Mi": "1364Mi",
 "memory": "32946972Ki",
 "pods": "110"
}

See also[edit]

Advertising: