kubectl-counts

command module
v0.0.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 25, 2021 License: Apache-2.0 Imports: 1 Imported by: 0

README

Kubectl Counts

CircleCI GoDoc Go Report Card GitHub release GitHub go.mod Go version

Filter Kubernetes resources by matching their names

Requirements

  • Kubernetes 1.17.0+
  • Kubectl 1.17.0+
  • Krew 0.4.0+

Installation

Installation via krew

$ kubectl krew version # make sure you are running 0.4.0+
$ kubectl krew install counts
$ kubectl krew upgrade

Manual Installation

$ export KUBECTL_COUNTS_VERSION=$(curl -s https://api.github.com/repos/wshihadeh/kubectl-counts/releases/latest | jq -r .tag_name)
$ curl -L -O https://github.com/wshihadeh/kubectl-counts/releases/download/${KUBECTL_COUNTS_VERSION}/kubectl-counts-$(uname -s)-$(uname -m).tar.gz
$ tar zxvf kubectl-counts-$(uname -s)-$(uname -m).tar.gz
$ mv kubectl-counts /usr/local/bin
$ chmod +x /usr/local/bin/kubectl-counts

Or

$ git clone git@github.com:wshihadeh/kubectl-counts.git
$ cd kubectl-counts
$ ./install.sh

Examples

Get pod counts:

$ kubectl counts pod --by-ns
$ kubectl counts pod --by-node
$ kubectl counts pod --by-restarts
$ kubectl counts pod --by-status

Get service counts:

$ kubectl counts services --by-ns
$ kubectl counts services --by-type

Get jobs counts:

$ kubectl counts jobs --by-ns
$ kubectl counts jobs --by-container
$ kubectl counts jobs --by-image

Get deployment counts

$ kubectl counts deployments --by-ns

Get ingress counts

$ kubectl counts ingresses --by-ns
$ kubectl counts ingresses --by-class
$ kubectl counts ingresses --by-address

How to get developer build?

$ go get -u github.com/wshihadeh/kubectl-counts

$ cd ${GOPATH}/src/github.com/wshihadeh/kubectl-counts

$ make all

Reference

License

Apache-2.0

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
pkg

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL