K9s tooling

K9s tooling

2022, Dec 28    

K9s is a terminal-based tool for managing and monitoring Kubernetes clusters. It provides a visually rich interface for interacting with your cluster and its resources, including pods, nodes, and deployments.

To use K9s, you will need to have a Kubernetes cluster set up and have the kubectl command-line tool installed on your machine. You can then install K9s using the following command:


curl -SL https://github.com/derailed/k9s/releases/latest/download/k9s_Linux_x86_64.tar.gz | tar -xzv

Once K9s is installed, you can start it by running the k9s command in your terminal. This will open the K9s interface, which is divided into several panes:

The left pane shows a list of all the resources in your cluster, organized by type (e.g. pods, nodes, deployments). The top right pane shows details about the selected resource, such as its status, labels, and events. The bottom right pane shows the logs for the selected resource. To navigate the K9s interface, you can use the following key shortcuts:

  • g Go to a specific resource or view (e.g. g p for pods, g d for deployments).
  • s Search for a specific resource or label.
  • Space Select the next resource in the list.
  • Shift + Space Select the previous resource in the list.
  • Enter Open the selected resource in a new terminal window.
  • Ctrl + c Close the selected resource.
  • q Quit K9s and return to the terminal.
  • k Kill the selected resource.
  • y Yank (copy) the selected resource to the clipboard.
  • p Paste (create) the yanked resource.
  • e Edit the selected resource.
  • r Restart the selected resource.
  • h Toggle the visibility of the help screen.
  • l Toggle the visibility of the logs pane.
  • w Toggle the visibility of the top right pane.
  • t Toggle between different views in the top right pane (e.g. resource details, events, config).
  • o Open the selected resource in a browser.
  • f Follow the logs for the selected resource.
  • b Toggle the visibility of the bottom right pane.
  • i Show resource info in the top right pane.
  • u Update the selected resource.
  • x Execute a command in the selected resource.

There are many other key shortcuts available in K9s, and you can see a full list by pressing ? in the K9s interface.