Kubernetes Tools¶
Helm¶
We use Helm as a package manager to more easily install other tools on Kubernetes.
There's several repositories with a large number of mature charts - the name of the Helm packages.
One being Helm/Stable another being Helm Hub.
Install¶
```bash tab="MacOS/Homebrew" brew install kubernetes-helm
```bash tab="Ubuntu/Snap" sudo snap install helm --classic
```bash tab="GoFish" gofish install helm
Kubecontext¶
Kubectx is a utility to manage and switch between Kubernetes (kubectl
) contexts and namespaces (via kubens
, see below).
Install¶
```bash tab="MacOS/Homebrew" brew install kubectx
Usage¶
Kubectx¶
kubectx minikube
Switched to context "minikube".
$ kubectx -
Switched to context "oregon".
$ kubectx -
Switched to context "minikube".
$ kubectx dublin=gke_ahmetb_europe-west1-b_dublin
Context "dublin" set.
Aliased "gke_ahmetb_europe-west1-b_dublin" as "dublin".
Kubens¶
Kubens (part of Kubectx) helps you manage your current Kubernetes namespace.
$ kubens kube-system
Context "test" set.
Active namespace is "kube-system".
$ kubens -
Context "test" set.
Active namespace is "default".
Kuard¶
Kuard is a small demo application to show your cluster works. Also exposes some info you might want to see.
kubectl run --restart=Never --image=gcr.io/kuar-demo/kuard-amd64:blue kuard
kubectl port-forward kuard 8080:8080
Open your browser to http://localhost:8080.
Stern¶
Stern allows you to tail
multiple pods on Kubernetes and multiple containers within the pod. Each result is color coded for quicker debugging.
Usage¶
Imagine a build in Jenkins using more than one container in the Pod. You want to tail the logs of all containers... you can with stern.
Kube Capacity¶
Kube Capacity is a simple CLI that provides an overview of the resource requests, limits, and utilization in a Kubernetes cluster.
NODE CPU REQUESTS CPU LIMITS MEMORY REQUESTS MEMORY LIMITS
* 560m (28%) 130m (7%) 572Mi (9%) 770Mi (13%)
example-node-1 220m (22%) 10m (1%) 192Mi (6%) 360Mi (12%)
example-node-2 340m (34%) 120m (12%) 380Mi (13%) 410Mi (14%)
NODE NAMESPACE POD CPU REQUESTS CPU LIMITS MEMORY REQUESTS MEMORY LIMITS
* * * 560m (28%) 780m (38%) 572Mi (9%) 770Mi (13%)
example-node-1 * * 220m (22%) 320m (32%) 192Mi (6%) 360Mi (12%)
example-node-1 kube-system metrics-server-lwc6z 100m (10%) 200m (20%) 100Mi (3%) 200Mi (7%)
example-node-1 kube-system coredns-7b5bcb98f8 120m (12%) 120m (12%) 92Mi (3%) 160Mi (5%)
example-node-2 * * 340m (34%) 460m (46%) 380Mi (13%) 410Mi (14%)
example-node-2 kube-system kube-proxy-3ki7 200m (20%) 280m (28%) 210Mi (7%) 210Mi (7%)
example-node-2 tiller tiller-deploy 140m (14%) 180m (18%) 170Mi (5%) 200Mi (7%)
NODE CPU REQUESTS CPU LIMITS CPU UTIL MEMORY REQUESTS MEMORY LIMITS MEMORY UTIL
* 560m (28%) 130m (7%) 40m (2%) 572Mi (9%) 770Mi (13%) 470Mi (8%)
example-node-1 220m (22%) 10m (1%) 10m (1%) 192Mi (6%) 360Mi (12%) 210Mi (7%)
example-node-2 340m (34%) 120m (12%) 30m (3%) 380Mi (13%) 410Mi (14%) 260Mi (9%)
Velero¶
RBAC Lookup¶
Install¶
``` bash tab="bash" brew install reactiveops/tap/rbac-lookup
Lookup user¶
Lookup GKE user¶
K9S¶
K9S is a tool that gives you a console UI on your kubernetes cluster/namespace.
Install¶
Use¶
By default is looks at a single namespace, and allows you to view elements of the pods running.
K9S¶
K9S is a tool that gives you a console UI on your kubernetes cluster/namespace.
Install¶
Use¶
By default is looks at a single namespace, and allows you to view elements of the pods running.
Dive¶
A tool for exploring a docker image, layer contents, and discovering ways to shrink your Docker image size.
Dive is a tool for analyzing Docker images.
Install¶
```bash tab="Debian based" wget https://github.com/wagoodman/dive/releases/download/v0.7.1/dive_0.7.1_linux_amd64.deb sudo apt install ./dive_0.7.1_linux_amd64.deb
```bash tab="RHEL based"
curl -OL https://github.com/wagoodman/dive/releases/download/v0.7.1/dive_0.7.1_linux_amd64.rpm
rpm -i dive_0.7.1_linux_amd64.rpm
```bash tab="Homebrew" brew tap wagoodman/dive brew install dive
Use¶
```bash tab="Existing image" dive
bash tab="For CI builds" CI=true dive <your-image>