Skip to content

chenjiandongx/kubectl-images

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

27 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

kubectl-images

🕸 Show container images used in the cluster.

kubectl-images makes use of the kubectl command. It first calls kubectl get pods to retrieve pods details and filters out the container image information of each pod, then prints out the final result in a table view.

🔰 Installation

Krew

$ kubectl krew install images
Updated the local copy of plugin index.
Installing plugin: images
Installed plugin: images
\
 | Use this plugin:
 | 	kubectl images
 | Documentation:
 | 	https://github.com/chenjiandongx/kubectl-images
/

Build from source code

$ git clone https://github.com/chenjiandongx/kubectl-images.git
$ cd kubectl-images && go build -ldflags="-s -w" -o kubectl-images . && mv ./kubectl-images /usr/local/bin
$ kubectl images --help

Download the binary

export VERSION=0.3.2

# Linux
$ curl -Lo kubectl-images https://github.com/chenjiandongx/kubectl-images/releases/download/v${VERSION}/kubectl-images_linux_amd64
# MacOS
$ curl -Lo kubectl-images https://github.com/chenjiandongx/kubectl-images/releases/download/v${VERSION}/kubectl-images_darwin_amd64
# Windows
$ curl -Lo kubectl-images https://github.com/chenjiandongx/kubectl-images/releases/download/v${VERSION}/kubectl-images_windows_amd64

$ chmod +x kubectl-images && mv kubectl-images /usr/local/bin/
$ kubectl images --help

📝 Usage

~ 🐶 kubectl images --help
Show container images used in the cluster.

Usage:
  kubectl-images [podname-regex] [flags]

Examples:
  # display a table of all images in current namespace using podName/containerName/containerImage as columns.
  kubectl images

  # display a table of images that match 'nginx' podname regex in 'dev' namespace using podName/containerImage as columns.
  kubectl images -n dev nginx -c 1,2

Flags:
  -A, --all-namespaces         if present, list images in all namespaces.
  -c, --columns string         specify the columns to display, separated by comma. [0:Namespace, 1:PodName, 2:ContainerName, 3:ContainerImage] (default "1,2,3")
  -h, --help                   help for kubectl-images
  -k, --kubeconfig string      path to the kubeconfig file to use for CLI requests.
  -n, --namespace string       if present, list images in the specified namespace only. Use current namespace as fallback.
  -o, --output-format string   output format. [json|table] (default "table")
      --version                version for kubectl-images

🔖 Glances

image image

📃 License

MIT ©chenjiandongx

About

🕸 Show container images used in the cluster.

Topics

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages