1
0
mirror of https://github.com/dcarrillo/dotfiles.git synced 2025-01-21 10:36:47 +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

6
.zshrc
View File

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