1
0
mirror of https://github.com/dcarrillo/dotfiles.git synced 2025-01-21 03:46:48 +00:00

[.zshrc] Update knodes function

This commit is contained in:
Daniel Carrillo 2025-01-10 13:25:29 +01:00
parent 6ba0c5d93a
commit 722a32eb47
Signed by: dcarrillo
GPG Key ID: E4CD5C09DAED6E16

22
.zshrc
View File

@ -91,15 +91,19 @@ kexec () {
}
knodes () {
kubectl get node -o json \
| jq -r '.items[] | {
name:.metadata.name,
type:.metadata.labels."beta.kubernetes.io/instance-type",
karpenter:.metadata.labels."karpenter.sh/nodepool",
capacity:.metadata.labels."karpenter.sh/capacity-type",
registered:.metadata.labels."karpenter.sh/registered",
initialized:.metadata.labels."karpenter.sh/initialized",
} | [.name,.type,.karpenter,.capacity,.registered,.initialized] | @tsv'
{
echo -e "Name\tType\tNodePool\tNodeClass\tCapacity\tRegistered\tInitialized"
kubectl get node -o json \
| jq -r '.items[] | {
name:.metadata.name,
type:.metadata.labels."beta.kubernetes.io/instance-type",
karpenter:.metadata.labels."karpenter.sh/nodepool",
nodeclass:.metadata.labels."eks.amazonaws.com/nodeclass",
capacity:.metadata.labels."karpenter.sh/capacity-type",
registered:.metadata.labels."karpenter.sh/registered",
initialized:.metadata.labels."karpenter.sh/initialized",
} | [.name,.type,.karpenter,.nodeclass,.capacity,.registered,.initialized] | @tsv'
} | column -t
}
kpretty () {