mirror of
https://github.com/dcarrillo/dotfiles.git
synced 2024-11-14 17:01:12 +00:00
[.zshrc] Add knodes function
This commit is contained in:
parent
fbd8604a03
commit
d081f1b383
12
.zshrc
12
.zshrc
@ -88,6 +88,18 @@ kexec () {
|
||||
[ -n "$cid" ] && kubectl exec -ti "$cid" -- "${cmd[@]}"
|
||||
}
|
||||
|
||||
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'
|
||||
}
|
||||
|
||||
siteinfo () {
|
||||
local url=$(echo "$1" | sed 's#^https\?://##')
|
||||
local ip="$(dig +short "$url" | tail -1)"
|
||||
|
Loading…
Reference in New Issue
Block a user