https://github.com/makocchi-git/kubectl-dfi
List and show disk resources of images on Kubernetes nodes.
https://github.com/makocchi-git/kubectl-dfi
k8s kubectl kubectl-plugin kubectl-plugins kubernetes
Last synced: 4 days ago
JSON representation
List and show disk resources of images on Kubernetes nodes.
- Host: GitHub
- URL: https://github.com/makocchi-git/kubectl-dfi
- Owner: makocchi-git
- License: mit
- Created: 2019-06-12T07:36:04.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2019-06-17T06:14:17.000Z (almost 6 years ago)
- Last Synced: 2025-03-25T10:12:34.989Z (21 days ago)
- Topics: k8s, kubectl, kubectl-plugin, kubectl-plugins, kubernetes
- Language: Go
- Homepage:
- Size: 96.7 KB
- Stars: 14
- Watchers: 1
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-kubectl-plugins - kubectl-dfi - git/kubectl-dfi)](https://github.com/makocchi-git/kubectl-dfi/stargazers) | (kubectl Plugins / Installing plugins via awesome-kubectl-plugins)
README
# kubectl dfi
[](https://travis-ci.org/makocchi-git/kubectl-dfi)
[](https://codeclimate.com/github/makocchi-git/kubectl-dfi/maintainability)
[](https://goreportcard.com/report/github.com/makocchi-git/kubectl-dfi)
[](https://codecov.io/gh/makocchi-git/kubectl-dfi)
[](https://github.com/topics/kubectl-plugin)
[](LICENSE)Print disk usage of container image on Kubernetes node(s) like a linux "df" command.
```shell
$ kubectl dfi
NAME IMAGE USED ALLOCATABLE CAPACITY %USED
node1-default-pool-500decb4-5q58 1982531K 47093746K 101241290K 1%
node2-default-pool-500decb4-7wpk 1891326K 47093746K 101241290K 1%
node3-default-pool-500decb4-9dd4 1982531K 47093746K 101241290K 1%
```And list images on Kubernetes node(s).
```shell
$ kubectl dfi --list node1-default-pool-500decb4-5q58
node1-default-pool-500decb4-5q58 286572K k8s.gcr.io/node-problem-detector:v0.4.1
node1-default-pool-500decb4-5q58 223242K gcr.io/stackdriver-agents/stackdriver-logging-agent:0.6-1.6.0-1
node1-default-pool-500decb4-5q58 135716K k8s.gcr.io/fluentd-elasticsearch:v2.0.4
node1-default-pool-500decb4-5q58 103488K k8s.gcr.io/fluentd-gcp-scaler:0.5
node1-default-pool-500decb4-5q58 102992K k8s.gcr.io/kube-proxy:v1.11.8-gke.6
node1-default-pool-500decb4-5q58 102319K k8s.gcr.io/kubernetes-dashboard-amd64:v1.8.3
...
```## Install
```shell
$ make
$ mv _output/kubectl-dfi /usr/local/bin/.# Happy dfi time!
$ kubectl dfi
```## Usage
```shell
# Show image usage of Kubernetes nodes.
kubectl dfi# Using label selector.
kubectl dfi -l key=value# Use image count with image disk usage.
kubectl dfi --count# Print raw(bytes) usage.
kubectl dfi --bytes --without-unit# Using binary prefix unit (GiB, MiB, etc)
kubectl dfi -g -B# List images on nodes.
kubectl dfi --list
```## Notice
`IMAGE USED` is simply sum up of container image size reported by kubelet.
In fact, node disk might be not used so much by container images because of cache by layered filesystem.## License
This software is released under the MIT License.