1
0
mirror of https://github.com/dcarrillo/dotfiles.git synced 2025-01-21 07:16:46 +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 () { knodes () {
kubectl get node -o json \ {
| jq -r '.items[] | { echo -e "Name\tType\tNodePool\tNodeClass\tCapacity\tRegistered\tInitialized"
name:.metadata.name, kubectl get node -o json \
type:.metadata.labels."beta.kubernetes.io/instance-type", | jq -r '.items[] | {
karpenter:.metadata.labels."karpenter.sh/nodepool", name:.metadata.name,
capacity:.metadata.labels."karpenter.sh/capacity-type", type:.metadata.labels."beta.kubernetes.io/instance-type",
registered:.metadata.labels."karpenter.sh/registered", karpenter:.metadata.labels."karpenter.sh/nodepool",
initialized:.metadata.labels."karpenter.sh/initialized", nodeclass:.metadata.labels."eks.amazonaws.com/nodeclass",
} | [.name,.type,.karpenter,.capacity,.registered,.initialized] | @tsv' 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 () { kpretty () {