Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork38
kubectl plugin - giving admins df (disk free) like utility for persistent volumes
License
yashbhutwala/kubectl-df-pv
Folders and files
| Name | Name | Last commit message | Last commit date | |
|---|---|---|---|---|
Repository files navigation
Akubectl plugin to seedf for persistent volumes.
☑kube-apiserver hasapi/v1/nodes/ endpoint enabled
☑ Appropriate RBAC. This utility is meant forcluster-admin like user; specifically, you need a service account with enough RBAC privileges to accessapi/v1/nodes/ from thekube-apiserver.
☑ Using a storage provisioner that populates pv metrics in a compatible manner (see what's beentested below)
curl https://krew.sh/df-pv| bash# . ~/.bashrc # run if you use bash shell# . ~/.zshrc # run if you use zsh shell
cd$GOPATH/src/github.com/mkdir -p yashbhutwalacd yashbhutwala/git clone git@github.com:yashbhutwala/kubectl-df-pv.gitcd kubectl-df-pv/make installdf-pv --help
download_path="./df-pv"version="v0.2.2"curl --fail -Lo$download_path"https://github.com/yashbhutwala/kubectl-df-pv/releases/download/${version}/kubectl-df-pv_${version}_darwin_amd64.tar.gz"chmod +x${download_path}mv${download_path} /some-dir-in-your-PATH/df-pv
kubectl df-pv
> kubectl df-pv --helpdf-pv emulates Unix style dffor persistent volumes w/ ability to filter by namespaceIt autoconverts all"sizes" to IEC values (see: https://en.wikipedia.org/wiki/Binary_prefix and https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/#meaning-of-memory)It colors the values based on"severity" [red:> 75% (too high); yellow:< 25% (too low); green:>= 25 and<= 75 (OK)]Usage: df-pv [flags]Flags: -h, --helphelpfor df-pv -n, --namespace stringif present, the namespace scopefor this CLI request (default is all namespaces) -v, --verbosity string log level; one of [info, debug, trace, warn, error, fatal, panic] (default"info")
df-pv -v trace2> trace.log☑GKE (kubernetes.io/gce-pd dynamic provisioner; both withssd andstandard)
☑kubeadm configured bare-metal cluster (rook ceph block dynamic provisioner usingscript)
☒kind (rancher/local-path-provisioner dynamic provisioner)
☒minikube (gcr.io/k8s-minikube/storage-provisioner minikube-hostpath dynamic provisioner)
[ ] EKS
[ ] AKS
☒ sort-by flag
☒ exclude namespaces
☒ only show a specific colored result ("red", "yellow", "green")
☑df for all Persistent Volumes in the cluster
☑ human readable output as default (using IEC format)
☑ color based on usage [red: > 75% (too high); yellow: < 25% (too low); green: >= 25 and <= 75 (OK)]
☑ print PV name
☑ print volume mount name
Have you ever wondered, "How much free disk space do all my PVs have?" Me too! That's why I built this plugin! I have always just wanted to quick way to see the disk usage of my Persistent Volumes (similar todf ordu in Unix). It turns out I'm not the only one, there has been many upstream Kubernetes issues open again and again about this, even some KEPs and PRs. I have compiled some of the issues and KEPs that I've seen in the wild here:
"this feature is needed .. !!!!" - @halradaideh
"There was a plan to implement this for 1.7 but we ran out of time."
"PVC should show how much of the available capacity is used vs available"
"Expose storage metrics to end users"
"exposing storage metrics to users"... "Status? Was it done?"
"Volume metrics exposed in /stats/summary not available in /metrics"
something similar to du in metrics
client-go issue about kubelet api by @DirectXMan12
blog about kubectl printers and columns
About
kubectl plugin - giving admins df (disk free) like utility for persistent volumes
Topics
Resources
License
Uh oh!
There was an error while loading.Please reload this page.
Stars
Watchers
Forks
Sponsor this project
Uh oh!
There was an error while loading.Please reload this page.
Packages0
Uh oh!
There was an error while loading.Please reload this page.
Contributors5
Uh oh!
There was an error while loading.Please reload this page.
