kubectl get pods --all-namespaces
(you can use -A
instead of --all-namespaces
)
kubectl top pods --all-namespaces --sum=true
If you want to see resource usage with container granularity, add --containers=true
:
kubectl top pods --all-namespaces --containers=true
$ kubectl top nodes
NAME CPU(cores) CPU% MEMORY(bytes) MEMORY%
pp-hetzner01 4250m 35% 53130Mi 82%
kubectl get pods -o "custom-columns=NAMESPACE:.metadata.namespace,NAME:.metadata.name,MEMORY_REQUESTS:.spec.containers[*].resources.requests.memory,MEMORY_LIMITS:.spec.containers[*].resources.limits.memory,CPU_REQUESTS:.spec.containers[*].resources.requests.cpu,CPU_LIMITS:.spec.containers[*].resources.limits.cpu" -A | sort
If you want to get a secret (e.g. for debugging), that is used in a pod like this:
- name: KEYCLOAK_INGEST_PASSWORD
valueFrom:
secretKeyRef:
name: service-accounts
key: insdcIngestUserPassword
You can get the secret like this:
kubectl get secret service-accounts -o jsonpath="{.data.insdcIngestUserPassword}" | base64 --decode; echo