- 1 Home
- 2 Installation
- 3 Usage
- 3.1 Syntax
- 3.2 Example commands
- 3.2.1 Single pod info
- 3.2.10 Container images
- 3.2.11 Advanced labels
- 3.2.12 Odditites and sorting
- 3.2.13 Pod volumes
- 3.2.14 Pod exec command
- 3.2.15 Excluding rows
- 3.2.16 Extra selections
- 3.2.17 Security information
- 3.2.18 POSIX capabilities
- 3.2.19 Column labels
- 3.2.2 Using labels
- 3.2.3 Named containers
- 3.2.4 Alternate status view
- 3.2.5 Pick and un-mix
- 3.2.6 Filtered trees
- 3.2.7 Labels and containers
- 3.2.8 Status details
- 3.2.9 Container status
- 4 Commands
Home
Kubectl-ice is a cli based application that lets you cleanly list all containers in kubernetes pods including init containers and view running kubernetes information about those multi-container pods to assist in troubleshooting and information gathering
Intro
Kubectl-ice is a kubectl plugin that allows you to easily view advanced configuration of all containers that are running inside pods, I created it so I could peer inside the pods and see the details of the containers that are inside running pods and then extended it so all containers could be viewed at once.
ice lists detailed information about the containers present inside a pod, useful for trouble-shooting multi container issues. You can view volume, image, port and executable configurations, along with current cpu and memory metrics all at the container level (requires metrics server)
Features
- Runs on Windows, Linux and MacOS
- Only uses read permissions, no writes are called
- Tree view adds each container in a pod, then each pod in a replica or stateful set etc, all the way up to the node level
- Selectors work just like they do with the standard kubectl command
- Sortable output columns
- List all the containers in a kubernetes pod including Init and Ephemeral containers
- Include or exclude rows from output using the match flag, useful to exclude containers with low memory or cpu usage
- List only cpu and memory results that dont fall within range using the oddities flag
- Also displays information on init and ephemerial containers
- Pods can be filtered using their priority and priorityClassName
- Most sub commands utilize aliases meaning less typing (eg command and cmd are the same)
- Easily view securityContext details and POSIX capabilities
- Use the show-namespace flag to output the pods namespace
- Colour output
License
Licensed under Apache 2.0 see LICENSE
Installation
ice can be installed a few different ways but the easist at the minute is by using krew if you have it, as it’s a simple one line command and everything is done for you.
Using krew
$ kubectl krew install ice
update with
$ kubectl krew update
$ kubectl krew upgrade ice
dont have krew? check it out at: https://github.com/GoogleContainerTools/krew
From binary
Manual download steps are slightly more technical but easy enough if you know your way around a computer.
- download the required binary from the downloads page
- unzip and copy the kubectl-ice file to a location in your path
- run
kubectl-ice help
from a terminal to check its working
From Source
clone and build the source using the following commands
git clone https://github.com/NimbleArchitect/kubectl-ice.git
cd kubectl-ice
make bin
then copy ./bin/kubectl-ice to somewhere in your path and run kubectl-ice help
to check its working
Usage
So you have ice installed and you’re eager to get started, first make sure kubectl-ice is in your path with by typing the following in your terminal or command prompt:
kubectl ice version
you should get an about screen back with information on how to find help and further documentation, if on the other hand you are looking at an error you will need to check the installation instructions above.
kubectl-ice uses syntex just like kubectl except it doesn’t have commands for listing Pods, DaemonSets, Jobs etc due to only working at the container level, you know that bit the Pod uses to do its actual work, thats the bit ice works with and displays information on.
Syntax
In it’s simplest form ice can be run in one of the following ways:
kubectl ice subcommand
kubectl-ice subcommand
where subcommand
should be replaced with any of the known commands like cpu
, memory
, status
, volumes
along with many more available from the commands section
when you run the command as above kubectl-ice will scan all pods in your current namespace and context, showing the selected information on all containers within each of the scanned pods, if you only want a list of matching container names you need to use the -c flag so you end up with something like the following (remember to replace mycontainer below with the name of the container you are interested in.)
kubectl ice status -c mycontainer
you can also ask kubectl-ice to search and list a specific pod by adding the pod name to the end of the command, ending up with a command that looks like
kubectl ice status mypod
again replace mypod
above with the name of the pod you want to see details of. Whilst this all sounds Ok in the documentation, what does it allow us to achieve, for that we need to set the scene…
Imagine we have a web pod running that contains an Nginx pod and a python application that serves as a frontend website, on top of this the pod also contains a backend password container that manages passwords and security certificates, so 3 containers running in this web pod, now if we had hundreds of these pods running and lets say a few of these pods start crashing due to memory over use. With the kubernetes default tools you have to get pods to find out which pod is causing a problem, then you have to describe pods to list the containers that have a problem then maybe you need to check the nodes the pod is running on (in case its a node problem) then possible check the labels… I’m sure you get the idea that whilst its powerful it can also be a bit long winded at times. Enter kubectl-ice to the stage and we have a single command along the lines of
kubectl ice status --match 'restarts>0' --node-tree
the above command will show the status of all containers that have a restart count of more than but not equal to 0, in a nice tree view that is grouped and rooted by the node name, you can also show specific labels and annotations as columns within the output using the flags --pod-label
, --node-label
and --annotation
In a nutshell multiple commands can be reduced down to a single command… that’s is a big win for me.
On top of everything else we can also read yaml directly via stdin or via the -f flag rather than reading from the k8s api, using this approach we can read the output of helm template
and kubectl-ice will allow us to check things like the memory requirements or security capabilities requested by a chart before actually being installed, we can also use helm get manifest to read details from already installed charts.
Example commands
Single pod info
Shows the currently used memory along with the configured memory requests and limits of all containers (side cars) in the pod named web-pod
$ kubectl-ice memory web-pod
CONTAINER USED REQUEST LIMIT %REQ %LIMIT
app-init 0 0 0 - -
app-watcher 4.99Mi 1M 512M 523.06 1.02
app-broken 0 1M 512M - -
myapp 4.98Mi 1M 256M 521.83 2.04
debugger-k5znj 0 0 0 - -
Container images
need to chack on the currently configured image versions use the image command
$ kubectl-ice image -l app=userandomcpu
PODNAME CONTAINER PULL IMAGE
demo-random-cpu-55954b64b4-9t7m2 init-myservice IfNotPresent busybox:1.28
demo-random-cpu-55954b64b4-9t7m2 web-frontend Always python:latest
demo-random-cpu-55954b64b4-9t7m2 nginx IfNotPresent nginx:1.7.9
demo-random-cpu-55954b64b4-km6bg init-myservice IfNotPresent busybox:1.28
demo-random-cpu-55954b64b4-km6bg web-frontend Always python:latest
demo-random-cpu-55954b64b4-km6bg nginx IfNotPresent nginx:1.7.9
demo-random-cpu-55954b64b4-knc6n init-myservice IfNotPresent busybox:1.28
demo-random-cpu-55954b64b4-knc6n web-frontend Always python:latest
demo-random-cpu-55954b64b4-knc6n nginx IfNotPresent nginx:1.7.9
demo-random-cpu-55954b64b4-vr4hg init-myservice IfNotPresent busybox:1.28
demo-random-cpu-55954b64b4-vr4hg web-frontend Always python:latest
demo-random-cpu-55954b64b4-vr4hg nginx IfNotPresent nginx:1.7.9
Advanced labels
return cpu requests size and limits of each container where the pods have an app label that matches useoddcpu and the container name is equal to web-frontend
$ kubectl-ice cpu -l "app in (useoddcpu)" -c web-frontend
PODNAME CONTAINER USED REQUEST LIMIT %REQ %LIMIT
demo-odd-cpu-5f947f9db4-2g7p2 web-frontend 3m 1m 1000m 239.26 0.24
demo-odd-cpu-5f947f9db4-59jm6 web-frontend 3m 1m 1000m 228.24 0.23
demo-odd-cpu-5f947f9db4-6gzw7 web-frontend 137m 1m 1000m 13605.66 13.61
demo-odd-cpu-5f947f9db4-6s97l web-frontend 3m 1m 1000m 242.12 0.24
demo-odd-cpu-5f947f9db4-86mb8 web-frontend 3m 1m 1000m 236.35 0.24
demo-odd-cpu-5f947f9db4-cwvdq web-frontend 135m 1m 1000m 13408.25 13.41
demo-odd-cpu-5f947f9db4-dcg8p web-frontend 2m 1m 1000m 189.21 0.19
demo-odd-cpu-5f947f9db4-fhs8q web-frontend 3m 1m 1000m 231.62 0.23
demo-odd-cpu-5f947f9db4-gzcrm web-frontend 3m 1m 1000m 239.25 0.24
demo-odd-cpu-5f947f9db4-hf872 web-frontend 2m 1m 1000m 196.35 0.20
demo-odd-cpu-5f947f9db4-hft68 web-frontend 3m 1m 1000m 219.94 0.22
demo-odd-cpu-5f947f9db4-jp8fw web-frontend 3m 1m 1000m 235.47 0.24
demo-odd-cpu-5f947f9db4-k2gtp web-frontend 135m 1m 1000m 13417.88 13.42
demo-odd-cpu-5f947f9db4-kj8s7 web-frontend 3m 1m 1000m 229.13 0.23
demo-odd-cpu-5f947f9db4-qtxp2 web-frontend 3m 1m 1000m 262.48 0.26
demo-odd-cpu-5f947f9db4-vg2d5 web-frontend 3m 1m 1000m 252.21 0.25
Odditites and sorting
given the listed output above the optional –oddities flag picks out the containers that have a high cpu usage when compared to the other containers listed we also sort the list in descending order by the %REQ column
$ kubectl-ice cpu -l "app in (useoddcpu)" -c web-frontend --oddities --sort '!%REQ'
PODNAME CONTAINER USED REQUEST LIMIT %REQ %LIMIT
demo-odd-cpu-5f947f9db4-6gzw7 web-frontend 137m 1m 1000m 13605.66 13.61
demo-odd-cpu-5f947f9db4-k2gtp web-frontend 135m 1m 1000m 13417.88 13.42
demo-odd-cpu-5f947f9db4-cwvdq web-frontend 135m 1m 1000m 13408.25 13.41
Pod volumes
list all container volumes with mount points
$ kubectl-ice volumes web-pod
CONTAINER VOLUME TYPE BACKING SIZE RO MOUNT-POINT
app-init kube-api-access-c47d7 Projected kube-root-ca.crt - true /var/run/secrets/kubernetes.io/serviceaccount
app-watcher app ConfigMap app.py - false /myapp/
app-watcher kube-api-access-c47d7 Projected kube-root-ca.crt - true /var/run/secrets/kubernetes.io/serviceaccount
app-broken kube-api-access-c47d7 Projected kube-root-ca.crt - true /var/run/secrets/kubernetes.io/serviceaccount
myapp app ConfigMap app.py - false /myapp/
myapp kube-api-access-c47d7 Projected kube-root-ca.crt - true /var/run/secrets/kubernetes.io/serviceaccount
Pod exec command
retrieves the command line and any arguments specified at the container level
$ kubectl-ice command web-pod
CONTAINER COMMAND ARGUMENTS
app-init sh -c sleep 2; exit 0 -
app-watcher python /myapp/mainapp.py -
app-broken sh -c sleep 2; exit 1 -
myapp python /myapp/mainapp.py -
debugger-k5znj - -
Excluding rows
use the –match flag to show only the output rows where the used memory column is greater than or equal to 3MB, this has the effect of exclusing any row where the used memory column is currently under 4096kB, the value 4096 can be replaced with any whole number in kilobytes
$ kubectl-ice mem -l app=userandomcpu --match 'used>=4096'
PODNAME CONTAINER USED REQUEST LIMIT %REQ %LIMIT
demo-random-cpu-55954b64b4-9t7m2 web-frontend 6.71Mi 1M 256M 704.10 2.75
demo-random-cpu-55954b64b4-km6bg web-frontend 8.29Mi 1M 256M 869.17 3.40
demo-random-cpu-55954b64b4-knc6n web-frontend 5.41Mi 1M 256M 566.89 2.21
demo-random-cpu-55954b64b4-vr4hg web-frontend 8.63Mi 1M 256M 904.81 3.53
Extra selections
using the –select flag allows you to filter the pod selection to only pods that have a priorityClassName thats equal to system-cluster-critical, you can also match against priority
$ kubectl-ice status --select 'priorityClassName=system-cluster-critical' -A
NAMESPACE PODNAME CONTAINER READY STARTED RESTARTS STATE REASON EXIT-CODE SIGNAL AGE
kube-system coredns-78fcd69978-qnjtj coredns true true 1 Running - - - 46h
kube-system metrics-server-77c99ccb96-kjq9s metrics-server true true 1 Running - - - 46h
Security information
listing runAsUser and runAsGroup settings along with other related container security information
$ kubectl-ice security -n kube-system
PODNAME CONTAINER ALLOW_PRIVILEGE_ESCALATION PRIVILEGED RO_ROOT_FS RUN_AS_NON_ROOT RUN_AS_USER RUN_AS_GROUP
coredns-78fcd69978-qnjtj coredns false - true - - -
etcd-minikube etcd - - - - - -
kindnet-2mhhp kindnet-cni - false - - - -
kindnet-qpdhv kindnet-cni - false - - - -
kube-apiserver-minikube kube-apiserver - - - - - -
kube-controller-manager-minikube kube-controller-manager - - - - - -
kube-proxy-f98q8 kube-proxy - true - - - -
kube-proxy-hdx8w kube-proxy - true - - - -
kube-scheduler-minikube kube-scheduler - - - - - -
metrics-server-77c99ccb96-kjq9s metrics-server - - true true 1000 -
storage-provisioner storage-provisioner - - - - - -
POSIX capabilities
display configured capabilities related to each container
$ kubectl-ice capabilities -n kube-system
PODNAME CONTAINER ADD DROP
coredns-78fcd69978-qnjtj coredns NET_BIND_SERVICE all
etcd-minikube etcd - -
kindnet-2mhhp kindnet-cni NET_RAW,NET_ADMIN -
kindnet-qpdhv kindnet-cni NET_RAW,NET_ADMIN -
kube-apiserver-minikube kube-apiserver - -
kube-controller-manager-minikube kube-controller-manager - -
kube-proxy-f98q8 kube-proxy - -
kube-proxy-hdx8w kube-proxy - -
kube-scheduler-minikube kube-scheduler - -
metrics-server-77c99ccb96-kjq9s metrics-server - -
storage-provisioner storage-provisioner - -
Column labels
with the –node-label and –pod-label flags its possible to show the values of the labels as columns in the output table
$ kubectl-ice status --node-label "beta.kubernetes.io/os" --pod-label "component" -n kube-system
PODNAME CONTAINER beta.kubernetes.io/os component READY STARTED RESTARTS STATE REASON EXIT-CODE SIGNAL AGE
coredns-78fcd69978-qnjtj coredns linux - true true 1 Running - - - 46h
etcd-minikube etcd linux etcd true true 1 Running - - - 46h
kindnet-2mhhp kindnet-cni linux - true true 1 Running - - - 46h
kindnet-qpdhv kindnet-cni linux - true true 1 Running - - - 46h
kube-apiserver-minikube kube-apiserver linux kube-apiserver true true 1 Running - - - 46h
kube-controller-manager-minikube kube-controller-manager linux kube-controller-manager true true 1 Running - - - 46h
kube-proxy-f98q8 kube-proxy linux - true true 1 Running - - - 46h
kube-proxy-hdx8w kube-proxy linux - true true 1 Running - - - 46h
kube-scheduler-minikube kube-scheduler linux kube-scheduler true true 1 Running - - - 46h
metrics-server-77c99ccb96-kjq9s metrics-server linux - true true 1 Running - - - 46h
storage-provisioner storage-provisioner linux - true true 2 Running - - - 46h
Using labels
using labels you can search all pods that are part of a deployment where the label app matches demoprobe and list selected information about the containers in each pod, this example shows the currently configured probe information and gives details of configured startup, readiness and liveness probes of each container
$ kubectl-ice probes -l app=demoprobe
PODNAME CONTAINER PROBE DELAY PERIOD TIMEOUT SUCCESS FAILURE CHECK ACTION
demo-probe-765fd4d8f7-n6kc7 web-frontend liveness 10 5 1 1 3 Exec /bin/true
demo-probe-765fd4d8f7-n6kc7 web-frontend readiness 5 5 1 1 3 Exec cat /tmp/health
demo-probe-765fd4d8f7-n6kc7 nginx liveness 60 60 1 1 8 HTTPGet http://:80/
demo-probe-765fd4d8f7-x2zr6 web-frontend liveness 10 5 1 1 3 Exec /bin/true
demo-probe-765fd4d8f7-x2zr6 web-frontend readiness 5 5 1 1 3 Exec cat /tmp/health
demo-probe-765fd4d8f7-x2zr6 nginx liveness 60 60 1 1 8 HTTPGet http://:80/
Named containers
the optional container flag (-c) searchs all selected pods and lists only containers that match the name web-frontend
$ kubectl-ice command -c web-frontend
PODNAME CONTAINER COMMAND ARGUMENTS
demo-memory-7ddb58cd5b-5kf9g web-frontend python /myapp/halfmemapp.py -
demo-memory-7ddb58cd5b-csbds web-frontend python /myapp/halfmemapp.py -
demo-memory-7ddb58cd5b-d4zwp web-frontend python /myapp/halfmemapp.py -
demo-memory-7ddb58cd5b-pdm9c web-frontend python /myapp/halfmemapp.py -
demo-odd-cpu-5f947f9db4-2g7p2 web-frontend python /myapp/oddcpuapp.py -
demo-odd-cpu-5f947f9db4-59jm6 web-frontend python /myapp/oddcpuapp.py -
demo-odd-cpu-5f947f9db4-6gzw7 web-frontend python /myapp/oddcpuapp.py -
demo-odd-cpu-5f947f9db4-6s97l web-frontend python /myapp/oddcpuapp.py -
demo-odd-cpu-5f947f9db4-86mb8 web-frontend python /myapp/oddcpuapp.py -
demo-odd-cpu-5f947f9db4-cwvdq web-frontend python /myapp/oddcpuapp.py -
demo-odd-cpu-5f947f9db4-dcg8p web-frontend python /myapp/oddcpuapp.py -
demo-odd-cpu-5f947f9db4-fhs8q web-frontend python /myapp/oddcpuapp.py -
demo-odd-cpu-5f947f9db4-gzcrm web-frontend python /myapp/oddcpuapp.py -
demo-odd-cpu-5f947f9db4-hf872 web-frontend python /myapp/oddcpuapp.py -
demo-odd-cpu-5f947f9db4-hft68 web-frontend python /myapp/oddcpuapp.py -
demo-odd-cpu-5f947f9db4-jp8fw web-frontend python /myapp/oddcpuapp.py -
demo-odd-cpu-5f947f9db4-k2gtp web-frontend python /myapp/oddcpuapp.py -
demo-odd-cpu-5f947f9db4-kj8s7 web-frontend python /myapp/oddcpuapp.py -
demo-odd-cpu-5f947f9db4-qtxp2 web-frontend python /myapp/oddcpuapp.py -
demo-odd-cpu-5f947f9db4-vg2d5 web-frontend python /myapp/oddcpuapp.py -
demo-probe-765fd4d8f7-n6kc7 web-frontend sh -c touch /tmp/health; sleep 2000; exit 0 -
demo-probe-765fd4d8f7-x2zr6 web-frontend sh -c touch /tmp/health; sleep 2000; exit 0 -
demo-random-cpu-55954b64b4-9t7m2 web-frontend python /myapp/randomcpuapp.py -
demo-random-cpu-55954b64b4-km6bg web-frontend python /myapp/randomcpuapp.py -
demo-random-cpu-55954b64b4-knc6n web-frontend python /myapp/randomcpuapp.py -
demo-random-cpu-55954b64b4-vr4hg web-frontend python /myapp/randomcpuapp.py -
Alternate status view
the tree flag shows the containers and pods in a tree view, with values calculated all the way up to the parent
$ kubectl-ice status -l app=demoprobe --tree
NAMESPACE NAME READY STARTED RESTARTS STATE REASON EXIT-CODE SIGNAL AGE
ice Deployment/demo-probe true true 20 - - - - -
ice └─ReplicaSet/demo-probe-765fd4d8f7 true true 20 - - - - -
ice └─Pod/demo-probe-765fd4d8f7-n6kc7 true true 10 Running - - - 19h
ice └─Container/nginx true true 0 Running - - - 19h
ice └─Container/web-frontend true true 10 Running - - - 25m
ice └─Pod/demo-probe-765fd4d8f7-x2zr6 true true 10 Running - - - 19h
ice └─Container/nginx true true 0 Running - - - 19h
ice └─Container/web-frontend true true 10 Running - - - 25m
Pick and un-mix
Using the -A flag to search all namespaces we can exclude all standard containers with the –match T!=C flag. The -T flag is optional and is provided to show that only Init and Ephemeral containers are displayed
$ kubectl-ice cpu -A -T --match T!=C
T NAMESPACE PODNAME CONTAINER USED REQUEST LIMIT %REQ %LIMIT
I default web-pod app-init 0m 0m 0m - -
I ice demo-memory-7ddb58cd5b-5kf9g init-myservice 0m 1m 100m - -
I ice demo-memory-7ddb58cd5b-csbds init-myservice 0m 1m 100m - -
I ice demo-memory-7ddb58cd5b-d4zwp init-myservice 0m 1m 100m - -
I ice demo-memory-7ddb58cd5b-pdm9c init-myservice 0m 1m 100m - -
I ice demo-odd-cpu-5f947f9db4-2g7p2 init-myservice 0m 100m 100m - -
I ice demo-odd-cpu-5f947f9db4-59jm6 init-myservice 0m 100m 100m - -
I ice demo-odd-cpu-5f947f9db4-6gzw7 init-myservice 0m 100m 100m - -
I ice demo-odd-cpu-5f947f9db4-6s97l init-myservice 0m 100m 100m - -
E ice demo-odd-cpu-5f947f9db4-6s97l debugger-vvz4z 0m 0m 0m - -
I ice demo-odd-cpu-5f947f9db4-86mb8 init-myservice 0m 100m 100m - -
I ice demo-odd-cpu-5f947f9db4-cwvdq init-myservice 0m 100m 100m - -
I ice demo-odd-cpu-5f947f9db4-dcg8p init-myservice 0m 100m 100m - -
I ice demo-odd-cpu-5f947f9db4-fhs8q init-myservice 0m 100m 100m - -
I ice demo-odd-cpu-5f947f9db4-gzcrm init-myservice 0m 100m 100m - -
I ice demo-odd-cpu-5f947f9db4-hf872 init-myservice 0m 100m 100m - -
I ice demo-odd-cpu-5f947f9db4-hft68 init-myservice 0m 100m 100m - -
I ice demo-odd-cpu-5f947f9db4-jp8fw init-myservice 0m 100m 100m - -
I ice demo-odd-cpu-5f947f9db4-k2gtp init-myservice 0m 100m 100m - -
I ice demo-odd-cpu-5f947f9db4-kj8s7 init-myservice 0m 100m 100m - -
I ice demo-odd-cpu-5f947f9db4-qtxp2 init-myservice 0m 100m 100m - -
I ice demo-odd-cpu-5f947f9db4-vg2d5 init-myservice 0m 100m 100m - -
I ice demo-random-cpu-55954b64b4-9t7m2 init-myservice 0m 120m 120m - -
I ice demo-random-cpu-55954b64b4-km6bg init-myservice 0m 120m 120m - -
I ice demo-random-cpu-55954b64b4-knc6n init-myservice 0m 120m 120m - -
I ice demo-random-cpu-55954b64b4-vr4hg init-myservice 0m 120m 120m - -
I ice web-pod app-init 0m 0m 0m - -
E ice web-pod debugger-k5znj 0m 0m 0m - -
Filtered trees
The tree view also allows us to use the –match flag to filter based on resource type (T column) so we include deployments only providing us with a nice total of memory used for each deployment
$ kubectl-ice mem -T --tree --match T==D
T NAMESPACE NAME USED REQUEST LIMIT %REQ %LIMIT
D ice Deployment/demo-memory 328.13Mi 11.44Mi 2334.59Mi 0.01 2.87
D ice Deployment/demo-odd-cpu 103.47Mi 1459.12Mi 8754.73Mi 0.00 0.01
D ice Deployment/demo-random-cpu 15.69Mi 194.55Mi 1167.30Mi 0.00 0.01
D ice Deployment/demo-odd-cpu 7.14Mi 97.27Mi 583.65Mi 0.00 0.01
D ice Deployment/demo-probe 6.42Mi 3.81Mi 976.56Mi 0.00 0.17
D ice Deployment/demo-random-cpu 21.33Mi 194.55Mi 1167.30Mi 0.00 0.01
Labels and containers
you can also search specific pods and list all containers with a specific name, in this example all pods with the label app=userandomcpu are searched and only the containers that match the name web-fronteend are shown
$ kubectl-ice cpu -l app=userandomcpu -c web-frontend
PODNAME CONTAINER USED REQUEST LIMIT %REQ %LIMIT
demo-random-cpu-55954b64b4-9t7m2 web-frontend 569m 125m 1000m 454.43 56.80
demo-random-cpu-55954b64b4-km6bg web-frontend 449m 125m 1000m 358.72 44.84
demo-random-cpu-55954b64b4-knc6n web-frontend 206m 125m 1000m 164.19 20.52
demo-random-cpu-55954b64b4-vr4hg web-frontend 456m 125m 1000m 364.08 45.51
Status details
using the details flag displays the timestamp and message columns
$ kubectl-ice status -l app=myapp --details
T PODNAME CONTAINER READY STARTED RESTARTS STATE REASON EXIT-CODE SIGNAL TIMESTAMP MESSAGE
I web-pod app-init true - 0 Terminated Completed 0 0 2022-08-04 19:00:53 -
C web-pod app-broken false false 68 Waiting CrashLoopBackOff - - - back-off 5m0s restarting failed
C web-pod app-watcher true true 0 Running - - - 2022-08-04 19:00:59 -
C web-pod myapp true true 0 Running - - - 2022-08-04 19:01:12 -
E web-pod debugger-k5znj false - 0 Terminated Completed 0 0 2022-08-04 19:02:59 -
Container status
most commands work the same way including the status command which also lets you see which container(s) are causing the restarts and by using the optional –previous flag you can view the containers previous exit code
$ kubectl-ice status -l app=myapp --previous
PODNAME CONTAINER STATE REASON EXIT-CODE SIGNAL TIMESTAMP MESSAGE
web-pod app-init - - - - - -
web-pod app-broken Terminated Error 1 0 2022-08-05 13:59:58 -
web-pod app-watcher - - - - - -
web-pod myapp - - - - - -
web-pod debugger-k5znj - - - - - -
Commands
if kubectl-ice is in your path you can replace the command kubectl-ice
with kubectl ice
(remove the dash) to
make it feel more like a native kubectl command, this also works if you have kubectl set as an alias, for example
if k is aliased to kubectl you can type k ice subcommand
instead of kubectl-ice subcommand
all sub commands support the --color argument
flag, this flag can also be set using the environment variable ICE_COLOR, the --color
flag overrides the environment variable when both are set
Argument | Description |
columns | displays each column in a different colour (there are only 14 colours, so expect repeats if you have more columns) |
errors | cpu, mem and status have fields that report state in true/false/% fields. This argument shows true as green false as red and 0-74% green, 75-89% yellow and 90-100% red |
mix | displays using the columns colouring with state fields coloured using errors colouring |
none | removes all colouring |
custom | allows setting custom colours for columns, the custom argument is a “;” seperated list in the format lx,y more info in the custom colour section below |
custom colours
the custom colours string is a ; spearated list with the word custom prefixed, each element in the list takes the format lx.y where:
| l | can be one of the following:
missing (empty),
g (good),
w (warning),
b (bad) |
| x | is the modifier, known values are
1 bright
4 underlined
5 flashing |
| y | is the colour code, refer to the colour codes table below |
when there are more columns that specified colours the colours are repeated in order as many times as needed.
each column is a different colour
kubectl-ice status --color column
choosing the colour of each column (colours repeat if there are more columns than colours) in this case the colours are blue, magenta, cyan, blue, magenta, cyan, etc
kubectl-ice status --color "custom;0.94;0.95;0.96"
showing the columns in colour with cpu usage coloured as good (green), warning (yellow) and bad (red)
kubectl-ice cpu --color mix
memory output with custom colours for each column but warning is flashing yellow and bad is flashing red
kubectl-ice memory --colour "custom;0.33;0.34;0.35;0.36;0.90;0.93;0.94;g1.92;w5.33;b5.91"
finally if you want ice to show colour by default you can use one of the following in your profile depending on your needs
export ICE_COLOR=mix
export ICE_COLOR=columns
export ICE_COLOR="custom;0.33;0.34;0.35;0.36;0.90;0.93;0.94;g1.92;w5.33;b5.91"
Colour codes
Default 39 Black 30 Dark red 31 Dark green 32 Dark yellow 33 Dark blue 34 Dark magenta 35 Dark cyan 36 Light gray 37 Dark gray 90 Red 91 Green 92 Orange 93 Blue 94 Magenta 95 Cyan 96 White 97
Modifiers
brighter 1 underlined 4 flashing 5
The following commands are available for kubectl-ice
Capabilities
Lists the runtime priviliges and linux capabilities that have been set for each container in a kubernetes pod
Aliases: | capabilities, cap |
Usage: | kubectl-ice capabilities [flags] kubectl-ice capabilities [flags] podname |
Flags
--annotation string Show the selected annotation as a column
--color string Add some much needed colour to the table output. string can be one of: columns, custom, errors, mix and none (overrides env variable ICE_COLOUR)
--columns string list of column names to show in the table output, all other columns are hidden
-f, --filename string read pod information from this yaml file instead
-m, --match string Filters out results, comma seperated list of COLUMN OP VALUE, where OP can be one of ==,<,>,<=,>= and !=
-M, --match-only string Filters out results but only calculates up visible rows
--node-label string Show the selected node label as a column
--node-tree Displayes the tree with the nodes as the root
-o, --output string Output format, currently csv, list, json and yaml are supported
--pod-label string Show the selected pod label as a column
--select string Filters pods based on their spec field, comma seperated list of FIELD OP VALUE, where OP can be one of ==, = and !=
--show-namespace Show the namespace column
--show-node Show the node name column
-T, --show-type Show the container type column, where:
I=init container, C=container, E=ephemerial container, P=Pod, D=Deployment, R=ReplicaSet, A=DaemonSet, S=StatefulSet, N=Node
-t, --tree Display tree like view instead of the standard list
More information at: https://www.github.com/NimbleArchitect/kubectl-ice
Examples
# List container capabilities from pods
kubectl-ice capabilities
# List container capabilities info from pods output in JSON format
kubectl-ice capabilities -o json
# List container capabilities info from a single pod
kubectl-ice capabilities my-pod-4jh36
# List capabilities info for all containers named web-container searching all
# pods in the current namespace
kubectl-ice capabilities -c web-container
# List capabilities info for all containers called web-container searching all pods in current
# namespace sorted by container name in descending order (notice the ! charator)
kubectl-ice capabilities -c web-container --sort '!CONTAINER'
# List capabilities info for all containers called web-container searching all pods in current
# namespace sorted by pod name in ascending order
kubectl-ice capabilities -c web-container --sort PODNAME
# List container capabilities info from all pods where label app matches web
kubectl-ice capabilities -l app=web
# List container capabilities info from all pods where the pod label app is either web or mail
kubectl-ice capabilities -l "app in (web,mail)"
Restarts
Aliases: | restarts, restart |
Usage: | kubectl-ice restarts [flags] kubectl-ice restarts [flags] podname |
Flags
--annotation string Show the selected annotation as a column
--color string Add some much needed colour to the table output. string can be one of: columns, custom, errors, mix and none (overrides env variable ICE_COLOUR)
--columns string list of column names to show in the table output, all other columns are hidden
-f, --filename string read pod information from this yaml file instead
-m, --match string Filters out results, comma seperated list of COLUMN OP VALUE, where OP can be one of ==,<,>,<=,>= and !=
-M, --match-only string Filters out results but only calculates up visible rows
--node-label string Show the selected node label as a column
--node-tree Displayes the tree with the nodes as the root
--oddities show only the outlier rows that dont fall within the computed range
-o, --output string Output format, currently csv, list, json and yaml are supported
--pod-label string Show the selected pod label as a column
--select string Filters pods based on their spec field, comma seperated list of FIELD OP VALUE, where OP can be one of ==, = and !=
--show-namespace Show the namespace column
--show-node Show the node name column
-T, --show-type Show the container type column, where:
I=init container, C=container, E=ephemerial container, P=Pod, D=Deployment, R=ReplicaSet, A=DaemonSet, S=StatefulSet, N=Node
-t, --tree Display tree like view instead of the standard list
More information at: https://www.github.com/NimbleArchitect/kubectl-ice
Examples
# List individual container restart count from pods
kubectl-ice restarts
# List conttainers restart count from pods output in JSON format
kubectl-ice restarts -o json
# List restart count from all containers in a single pod
kubectl-ice restarts my-pod-4jh36
# List restart count of all containers named web-container searching all
# pods in the current namespace
kubectl-ice restarts -c web-container
# List restart count of containers called web-container searching all pods in current
# namespace sorted by container name in descending order (notice the ! charator)
kubectl-ice restarts -c web-container --sort '!CONTAINER'
# List restart count of containers called web-container searching all pods in current
# namespace sorted by pod name in ascending order
kubectl-ice restarts -c web-container --sort PODNAME
# List container restart count from all pods where label app equals web
kubectl-ice restarts -l app=web
# List restart count from all containers where the pod label app is either web or mail
kubectl-ice restarts -l "app in (web,mail)"
Security
Aliases: | security, sec |
Usage: | kubectl-ice security [flags] kubectl-ice security [flags] podname |
Flags
--annotation string Show the selected annotation as a column
--color string Add some much needed colour to the table output. string can be one of: columns, custom, errors, mix and none (overrides env variable ICE_COLOUR)
--columns string list of column names to show in the table output, all other columns are hidden
-f, --filename string read pod information from this yaml file instead
-m, --match string Filters out results, comma seperated list of COLUMN OP VALUE, where OP can be one of ==,<,>,<=,>= and !=
-M, --match-only string Filters out results but only calculates up visible rows
--node-label string Show the selected node label as a column
--node-tree Displayes the tree with the nodes as the root
-o, --output string Output format, currently csv, list, json and yaml are supported
--pod-label string Show the selected pod label as a column
--select string Filters pods based on their spec field, comma seperated list of FIELD OP VALUE, where OP can be one of ==, = and !=
--selinux show the SELinux context thats applied to the containers
--show-namespace Show the namespace column
--show-node Show the node name column
-T, --show-type Show the container type column, where:
I=init container, C=container, E=ephemerial container, P=Pod, D=Deployment, R=ReplicaSet, A=DaemonSet, S=StatefulSet, N=Node
-t, --tree Display tree like view instead of the standard list
More information at: https://www.github.com/NimbleArchitect/kubectl-ice
Examples
# List container security info from pods
kubectl-ice security
# List container security info from pods output in JSON format
kubectl-ice security -o json
# List container security info from a single pod
kubectl-ice security my-pod-4jh36
# List security info for all containers named web-container searching all
# pods in the current namespace
kubectl-ice security -c web-container
# List security info for all containers called web-container searching all pods in current
# namespace sorted by container name in descending order (notice the ! charator)
kubectl-ice security -c web-container --sort '!CONTAINER'
# List security info for all containers called web-container searching all pods in current
# namespace sorted by pod name in ascending order
kubectl-ice security -c web-container --sort PODNAME
# List container security info from all pods where label app matches web
kubectl-ice security -l app=web
# List container security info from all pods where the pod label app is either web or mail
kubectl-ice security -l "app in (web,mail)"
Status
Aliases: | status, st |
Usage: | kubectl-ice status [flags] kubectl-ice status [flags] podname |
Flags
--annotation string Show the selected annotation as a column
--color string Add some much needed colour to the table output. string can be one of: columns, custom, errors, mix and none (overrides env variable ICE_COLOUR)
--columns string list of column names to show in the table output, all other columns are hidden
-d, --details Display the timestamp instead of age along with the message column
-f, --filename string read pod information from this yaml file instead
--id Show running containers id
-m, --match string Filters out results, comma seperated list of COLUMN OP VALUE, where OP can be one of ==,<,>,<=,>= and !=
-M, --match-only string Filters out results but only calculates up visible rows
--node-label string Show the selected node label as a column
--node-tree Displayes the tree with the nodes as the root
--oddities show only the outlier rows that dont fall within the computed range
-o, --output string Output format, currently csv, list, json and yaml are supported
--pod-label string Show the selected pod label as a column
-p, --previous Show previous state
--select string Filters pods based on their spec field, comma seperated list of FIELD OP VALUE, where OP can be one of ==, = and !=
--show-namespace Show the namespace column
--show-node Show the node name column
-T, --show-type Show the container type column, where:
I=init container, C=container, E=ephemerial container, P=Pod, D=Deployment, R=ReplicaSet, A=DaemonSet, S=StatefulSet, N=Node
-t, --tree Display tree like view instead of the standard list
More information at: https://www.github.com/NimbleArchitect/kubectl-ice
Examples
# List individual container status from pods
kubectl-ice status
# List conttainers status from pods output in JSON format
kubectl-ice status -o json
# List status from all container in a single pod
kubectl-ice status my-pod-4jh36
# List previous container status from a single pod
kubectl-ice status -p my-pod-4jh36
# List status of all containers named web-container searching all
# pods in the current namespace
kubectl-ice status -c web-container
# List status of containers called web-container searching all pods in current
# namespace sorted by container name in descending order (notice the ! charator)
kubectl-ice status -c web-container --sort '!CONTAINER'
# List status of containers called web-container searching all pods in current
# namespace sorted by pod name in ascending order
kubectl-ice status -c web-container --sort PODNAME
# List container status from all pods where label app equals web
kubectl-ice status -l app=web
# List status from all containers where the pods label app is either web or mail
kubectl-ice status -l "app in (web,mail)"
Volumes
Aliases: | volumes, volume, vol |
Usage: | kubectl-ice volumes [flags] kubectl-ice volumes [flags] podname |
Flags
--annotation string Show the selected annotation as a column
--color string Add some much needed colour to the table output. string can be one of: columns, custom, errors, mix and none (overrides env variable ICE_COLOUR)
--columns string list of column names to show in the table output, all other columns are hidden
-d, --device show raw block device mappings within a container
-f, --filename string read pod information from this yaml file instead
-m, --match string Filters out results, comma seperated list of COLUMN OP VALUE, where OP can be one of ==,<,>,<=,>= and !=
-M, --match-only string Filters out results but only calculates up visible rows
--node-label string Show the selected node label as a column
--node-tree Displayes the tree with the nodes as the root
-o, --output string Output format, currently csv, list, json and yaml are supported
--pod-label string Show the selected pod label as a column
--select string Filters pods based on their spec field, comma seperated list of FIELD OP VALUE, where OP can be one of ==, = and !=
--show-namespace Show the namespace column
--show-node Show the node name column
-T, --show-type Show the container type column, where:
I=init container, C=container, E=ephemerial container, P=Pod, D=Deployment, R=ReplicaSet, A=DaemonSet, S=StatefulSet, N=Node
-t, --tree Display tree like view instead of the standard list
More information at: https://www.github.com/NimbleArchitect/kubectl-ice
Examples
# List volumes from containers inside pods from current namespace
kubectl-ice volumes
# List volumes from conttainers output in JSON format
kubectl-ice volumes -o json
# List all container volumes from a single pod
kubectl-ice volumes my-pod-4jh36
# List volumes from all containers named web-container searching all
# pods in the current namespace
kubectl-ice volumes -c web-container
# List volumes from container web-container searching all pods in current
# namespace sorted by volume name in descending order (notice the ! charator)
kubectl-ice volumes -c web-container --sort '!VOLUME'
# List volumes from container web-container searching all pods in current
# namespace sorted by volume name in ascending order
kubectl-ice volumes -c web-container --sort MOUNT-POINT
# List container volume info from all pods where label app equals web
kubectl-ice volumes -l app=web
# List volumes from all containers where the pod label app is web or mail
kubectl-ice volumes -l "app in (web,mail)"
Command
Aliases: | command, cmd, exec, args |
Usage: | kubectl-ice command [flags] kubectl-ice command [flags] podname |
Flags
--annotation string Show the selected annotation as a column
--color string Add some much needed colour to the table output. string can be one of: columns, custom, errors, mix and none (overrides env variable ICE_COLOUR)
--columns string list of column names to show in the table output, all other columns are hidden
-f, --filename string read pod information from this yaml file instead
-m, --match string Filters out results, comma seperated list of COLUMN OP VALUE, where OP can be one of ==,<,>,<=,>= and !=
-M, --match-only string Filters out results but only calculates up visible rows
--node-label string Show the selected node label as a column
--node-tree Displayes the tree with the nodes as the root
-o, --output string Output format, currently csv, list, json and yaml are supported
--pod-label string Show the selected pod label as a column
--select string Filters pods based on their spec field, comma seperated list of FIELD OP VALUE, where OP can be one of ==, = and !=
--show-namespace Show the namespace column
--show-node Show the node name column
-T, --show-type Show the container type column, where:
I=init container, C=container, E=ephemerial container, P=Pod, D=Deployment, R=ReplicaSet, A=DaemonSet, S=StatefulSet, N=Node
-t, --tree Display tree like view instead of the standard list
More information at: https://www.github.com/NimbleArchitect/kubectl-ice
Examples
# List containers command info from pods
kubectl-ice command
# List container command info from pods output in JSON format
kubectl-ice command -o json
# List container command info from a single pod
kubectl-ice command my-pod-4jh36
# List command info for all containers named web-container searching all
# pods in the current namespace
kubectl-ice command -c web-container
# List command info for all containers called web-container searching all pods in current
# namespace sorted by container name in descending order (notice the ! charator)
kubectl-ice command -c web-container --sort '!CONTAINER'
# List command info for all containers called web-container searching all pods in current
# namespace sorted by pod name in ascending order
kubectl-ice command -c web-container --sort PODNAME
# List container command info from all pods where label app matches web
kubectl-ice command -l app=web
# List container command info from all pods where the pod label app is either web or mail
kubectl-ice command -l "app in (web,mail)"
CPU
Aliases: | cpu |
Usage: | kubectl-ice cpu [flags] kubectl-ice cpu [flags] podname |
Flags
--annotation string Show the selected annotation as a column
--color string Add some much needed colour to the table output. string can be one of: columns, custom, errors, mix and none (overrides env variable ICE_COLOUR)
--columns string list of column names to show in the table output, all other columns are hidden
-f, --filename string read pod information from this yaml file instead
-i, --include-init include init container(s) in the output, by default init containers are hidden
-m, --match string Filters out results, comma seperated list of COLUMN OP VALUE, where OP can be one of ==,<,>,<=,>= and !=
-M, --match-only string Filters out results but only calculates up visible rows
--node-label string Show the selected node label as a column
--node-tree Displayes the tree with the nodes as the root
--oddities show only the outlier rows that dont fall within the computed range
-o, --output string Output format, currently csv, list, json and yaml are supported
--pod-label string Show the selected pod label as a column
-r, --raw show raw values
--select string Filters pods based on their spec field, comma seperated list of FIELD OP VALUE, where OP can be one of ==, = and !=
--show-namespace Show the namespace column
--show-node Show the node name column
-T, --show-type Show the container type column, where:
I=init container, C=container, E=ephemerial container, P=Pod, D=Deployment, R=ReplicaSet, A=DaemonSet, S=StatefulSet, N=Node
-t, --tree Display tree like view instead of the standard list
More information at: https://www.github.com/NimbleArchitect/kubectl-ice
Examples
# List containers cpu info from pods
kubectl-ice cpu
# List container cpu info from pods output in JSON format
kubectl-ice cpu -o json
# List container cpu info from a single pod
kubectl-ice cpu my-pod-4jh36
# List cpu info for all containers named web-container searching all
# pods in the current namespace
kubectl-ice cpu -c web-container
# List cpu info for all containers called web-container searching all pods in current
# namespace sorted by container name in descending order (notice the ! charator)
kubectl-ice cpu -c web-container --sort '!CONTAINER'
# List cpu info for all containers called web-container searching all pods in current
# namespace sorted by pod name in ascending order
kubectl-ice cpu -c web-container --sort PODNAME
# List container cpu info from all pods where label app matches web
kubectl-ice cpu -l app=web
# List container cpu info from all pods where the pod label app is either web or mail
kubectl-ice cpu -l "app in (web,mail)"
Environment
Aliases: | environment, env, vars |
Usage: | kubectl-ice environment [flags] kubectl-ice environment [flags] podname |
Flags
--annotation string Show the selected annotation as a column
--color string Add some much needed colour to the table output. string can be one of: columns, custom, errors, mix and none (overrides env variable ICE_COLOUR)
--columns string list of column names to show in the table output, all other columns are hidden
-f, --filename string read pod information from this yaml file instead
-m, --match string Filters out results, comma seperated list of COLUMN OP VALUE, where OP can be one of ==,<,>,<=,>= and !=
-M, --match-only string Filters out results but only calculates up visible rows
--node-label string Show the selected node label as a column
--node-tree Displayes the tree with the nodes as the root
-o, --output string Output format, currently csv, list, json and yaml are supported
--pod-label string Show the selected pod label as a column
--select string Filters pods based on their spec field, comma seperated list of FIELD OP VALUE, where OP can be one of ==, = and !=
--show-namespace Show the namespace column
--show-node Show the node name column
-T, --show-type Show the container type column, where:
I=init container, C=container, E=ephemerial container, P=Pod, D=Deployment, R=ReplicaSet, A=DaemonSet, S=StatefulSet, N=Node
--translate read the configmap show its values
-t, --tree Display tree like view instead of the standard list
More information at: https://www.github.com/NimbleArchitect/kubectl-ice
Examples
# List containers env info from pods
kubectl-ice env
# List container env info from pods output in JSON format
kubectl-ice env -o json
# List container env info from a single pod
kubectl-ice env my-pod-4jh36
# List env info for all containers named web-container searching all
# pods in the current namespace
kubectl-ice env -c web-container
# List env info for all containers called web-container searching all pods in current
# namespace sorted by container name in descending order (notice the ! charator)
kubectl-ice env -c web-container --sort '!CONTAINER'
# List env info for all containers called web-container searching all pods in current
# namespace sorted by pod name in ascending order
kubectl-ice env -c web-container --sort PODNAME
# List container env info from all pods where label app matches web
kubectl-ice env -l app=web
# List container env info from all pods where the pod label app is either web or mail
kubectl-ice env -l "app in (web,mail)"
Image
Aliases: | image, im |
Usage: | kubectl-ice image [flags] kubectl-ice image [flags] podname |
Flags
--annotation string Show the selected annotation as a column
--color string Add some much needed colour to the table output. string can be one of: columns, custom, errors, mix and none (overrides env variable ICE_COLOUR)
--columns string list of column names to show in the table output, all other columns are hidden
-f, --filename string read pod information from this yaml file instead
--id Show running containers id
-m, --match string Filters out results, comma seperated list of COLUMN OP VALUE, where OP can be one of ==,<,>,<=,>= and !=
-M, --match-only string Filters out results but only calculates up visible rows
--node-label string Show the selected node label as a column
--node-tree Displayes the tree with the nodes as the root
-o, --output string Output format, currently csv, list, json and yaml are supported
--pod-label string Show the selected pod label as a column
--select string Filters pods based on their spec field, comma seperated list of FIELD OP VALUE, where OP can be one of ==, = and !=
--show-namespace Show the namespace column
--show-node Show the node name column
-T, --show-type Show the container type column, where:
I=init container, C=container, E=ephemerial container, P=Pod, D=Deployment, R=ReplicaSet, A=DaemonSet, S=StatefulSet, N=Node
-t, --tree Display tree like view instead of the standard list
More information at: https://www.github.com/NimbleArchitect/kubectl-ice
Examples
# List containers image info from pods
kubectl-ice image
# List container image info from pods output in JSON format
kubectl-ice image -o json
# List container image info from a single pod
kubectl-ice image my-pod-4jh36
# List image info for all containers named web-container searching all
# pods in the current namespace
kubectl-ice image -c web-container
# List image info for all containers called web-container searching all pods in current
# namespace sorted by container name in descending order (notice the ! charator)
kubectl-ice image -c web-container --sort '!CONTAINER'
# List image info for all containers called web-container searching all pods in current
# namespace sorted by pod name in ascending order
kubectl-ice image -c web-container --sort PODNAME
# List container image info from all pods where label app matches web
kubectl-ice image -l app=web
# List container image info from all pods where the pod label app is either web or mail
kubectl-ice image -l "app in (web,mail)"
IP
Aliases: | ip |
Usage: | kubectl-ice ip [flags] kubectl-ice ip [flags] podname |
Flags
--annotation string Show the selected annotation as a column
--color string Add some much needed colour to the table output. string can be one of: columns, custom, errors, mix and none (overrides env variable ICE_COLOUR)
--columns string list of column names to show in the table output, all other columns are hidden
-f, --filename string read pod information from this yaml file instead
-m, --match string Filters out results, comma seperated list of COLUMN OP VALUE, where OP can be one of ==,<,>,<=,>= and !=
-M, --match-only string Filters out results but only calculates up visible rows
--node-label string Show the selected node label as a column
--node-tree Displayes the tree with the nodes as the root
-o, --output string Output format, currently csv, list, json and yaml are supported
--pod-label string Show the selected pod label as a column
--select string Filters pods based on their spec field, comma seperated list of FIELD OP VALUE, where OP can be one of ==, = and !=
--show-namespace Show the namespace column
--show-node Show the node name column
-T, --show-type Show the container type column, where:
I=init container, C=container, E=ephemerial container, P=Pod, D=Deployment, R=ReplicaSet, A=DaemonSet, S=StatefulSet, N=Node
-t, --tree Display tree like view instead of the standard list
More information at: https://www.github.com/NimbleArchitect/kubectl-ice
Examples
# List IP address of pods
kubectl-ice ip
# List IP address of pods output in JSON format
kubectl-ice ip -o json
# List IP address a single pod
kubectl-ice ip my-pod-4jh36
# List IP address of all pods where label app matches web
kubectl-ice ip -l app=web
# List IP address of all pods where the pod label app is either web or mail
kubectl-ice ip -l "app in (web,mail)"
Memory
Aliases: | memory, mem |
Usage: | kubectl-ice memory [flags] kubectl-ice memory [flags] podname |
Flags
--annotation string Show the selected annotation as a column
--color string Add some much needed colour to the table output. string can be one of: columns, custom, errors, mix and none (overrides env variable ICE_COLOUR)
--columns string list of column names to show in the table output, all other columns are hidden
-f, --filename string read pod information from this yaml file instead
-i, --include-init include init container(s) in the output, by default init containers are hidden
-m, --match string Filters out results, comma seperated list of COLUMN OP VALUE, where OP can be one of ==,<,>,<=,>= and !=
-M, --match-only string Filters out results but only calculates up visible rows
--node-label string Show the selected node label as a column
--node-tree Displayes the tree with the nodes as the root
--oddities show only the outlier rows that dont fall within the computed range
-o, --output string Output format, currently csv, list, json and yaml are supported
--pod-label string Show the selected pod label as a column
-r, --raw show raw values
--select string Filters pods based on their spec field, comma seperated list of FIELD OP VALUE, where OP can be one of ==, = and !=
--show-namespace Show the namespace column
--show-node Show the node name column
-T, --show-type Show the container type column, where:
I=init container, C=container, E=ephemerial container, P=Pod, D=Deployment, R=ReplicaSet, A=DaemonSet, S=StatefulSet, N=Node
--size string allows conversion to the selected size rather then the default megabyte output (default "Mi")
-t, --tree Display tree like view instead of the standard list
More information at: https://www.github.com/NimbleArchitect/kubectl-ice
Examples
# List containers memory info from pods
kubectl-ice memory
# List container memory info from pods output in JSON format
kubectl-ice memory -o json
# List container memory info from a single pod
kubectl-ice memory my-pod-4jh36
# List memory info for all containers named web-container searching all
# pods in the current namespace
kubectl-ice memory -c web-container
# List memory info for all containers called web-container searching all pods in current
# namespace sorted by container name in descending order (notice the ! charator)
kubectl-ice memory -c web-container --sort '!CONTAINER'
# List memory info for all containers called web-container searching all pods in current
# namespace sorted by pod name in ascending order
kubectl-ice memory -c web-container --sort PODNAME
# List container memory info from all pods where label app matches web
kubectl-ice memory -l app=web
# List container memory info from all pods where the pod label app is either web or mail
kubectl-ice memory -l "app in (web,mail)"
Ports
Aliases: | ports, port, po |
Usage: | kubectl-ice ports [flags] kubectl-ice ports [flags] podname |
Flags
--annotation string Show the selected annotation as a column
--color string Add some much needed colour to the table output. string can be one of: columns, custom, errors, mix and none (overrides env variable ICE_COLOUR)
--columns string list of column names to show in the table output, all other columns are hidden
-f, --filename string read pod information from this yaml file instead
-m, --match string Filters out results, comma seperated list of COLUMN OP VALUE, where OP can be one of ==,<,>,<=,>= and !=
-M, --match-only string Filters out results but only calculates up visible rows
--node-label string Show the selected node label as a column
--node-tree Displayes the tree with the nodes as the root
-o, --output string Output format, currently csv, list, json and yaml are supported
--pod-label string Show the selected pod label as a column
--select string Filters pods based on their spec field, comma seperated list of FIELD OP VALUE, where OP can be one of ==, = and !=
--show-namespace Show the namespace column
--show-node Show the node name column
-T, --show-type Show the container type column, where:
I=init container, C=container, E=ephemerial container, P=Pod, D=Deployment, R=ReplicaSet, A=DaemonSet, S=StatefulSet, N=Node
-t, --tree Display tree like view instead of the standard list
More information at: https://www.github.com/NimbleArchitect/kubectl-ice
Examples
# List containers port info from pods
kubectl-ice ports
# List container port info from pods output in JSON format
kubectl-ice ports -o json
# List container port info from a single pod
kubectl-ice ports my-pod-4jh36
# List port info for all containers named web-container searching all
# pods in the current namespace
kubectl-ice ports -c web-container
# List port info for all containers called web-container searching all pods in current
# namespace sorted by container name in descending order (notice the ! charator)
kubectl-ice ports -c web-container --sort '!CONTAINER'
# List port info for all containers called web-container searching all pods in current
# namespace sorted by pod name in ascending order
kubectl-ice ports -c web-container --sort PODNAME
# List container port info from all pods where label app matches web
kubectl-ice ports -l app=web
# List container port info from all pods where the pod label app is either web or mail
kubectl-ice ports -l "app in (web,mail)"
Probes
Aliases: | probes, probe |
Usage: | kubectl-ice probes [flags] kubectl-ice probes [flags] podname |
Flags
--annotation string Show the selected annotation as a column
--color string Add some much needed colour to the table output. string can be one of: columns, custom, errors, mix and none (overrides env variable ICE_COLOUR)
--columns string list of column names to show in the table output, all other columns are hidden
-f, --filename string read pod information from this yaml file instead
-m, --match string Filters out results, comma seperated list of COLUMN OP VALUE, where OP can be one of ==,<,>,<=,>= and !=
-M, --match-only string Filters out results but only calculates up visible rows
--node-label string Show the selected node label as a column
--node-tree Displayes the tree with the nodes as the root
-o, --output string Output format, currently csv, list, json and yaml are supported
--pod-label string Show the selected pod label as a column
--select string Filters pods based on their spec field, comma seperated list of FIELD OP VALUE, where OP can be one of ==, = and !=
--show-namespace Show the namespace column
--show-node Show the node name column
-T, --show-type Show the container type column, where:
I=init container, C=container, E=ephemerial container, P=Pod, D=Deployment, R=ReplicaSet, A=DaemonSet, S=StatefulSet, N=Node
-t, --tree Display tree like view instead of the standard list
More information at: https://www.github.com/NimbleArchitect/kubectl-ice
Examples
# List containers probe info from pods
kubectl-ice probes
# List container probe info from pods output in JSON format
kubectl-ice probes -o json
# List container probe info from a single pod
kubectl-ice probes my-pod-4jh36
# List probe info for all containers named web-container searching all
# pods in the current namespace
kubectl-ice probes -c web-container
# List probe info for all containers called web-container searching all pods in current
# namespace sorted by container name in descending order (notice the ! charator)
kubectl-ice probes -c web-container --sort '!CONTAINER'
# List probe info for all containers called web-container searching all pods in current
# namespace sorted by pod name in ascending order
kubectl-ice probes -c web-container --sort PODNAME
# List container probe info from all pods where label app matches web
kubectl-ice probes -l app=web
# List container probe info from all pods where the pod label app is either web or mail
kubectl-ice probes -l "app in (web,mail)"