Article
· Nov 28, 2023 2m read

k9s - Manage Your IrisClusters In Style

K9s is a terminal-based UI (aka kubectl clown suit), to manage Kubernetes clusters that drastically simplifies navigating, observing, and managing your applications in K8s, including Custom Resources like the InterSystems Kubernetes Operator (IKO) and ArgoCD Applications. If you are about to take your CKD, CKA, or CKS, leave k9s well enough alone for awhile as the abstraction to kubectl will become the standard for navigating the cluster and you will undoubtedly become estranged to the extended flags of kubectl and bomb the exam.

 

Plugins
Dead simple and very flexible, here is a dead simple one that will restart IRIS in a POD.  Drop this guy in ~/.config/k9s/plugin.yml and while in the context of a container, the shortcut will be available.  This one exposes  <i> Restart Iris

 

plugin:
 get-all:
   shortCut: i
   confirm: true
   description: Restart IRIS
   scopes:
   - container
   command: sh
   background: false
   args:
   - -c
   - "kubectl exec -n $NAMESPACE $POD -- iris stop IRIS quietly restart"


Navigation
Command mode is entered with 

To see a full list of possible commands you can navigate use the :aliases

Here are the commands for some other Kubernetes resources:

  • :ns — Namespaces
  • :deploy — Deployments
  • :IrisClusters — IrisClusters
  • :svc — Services

Search
You can dig across resources to find things by label, name or other attributes by entering  /here you can see a constrain on string "1972" in the ":services" resource view.

 
Port Forwards
Especially useful are port forwards, which are the main administration interface I use for Spark, the ever-so-beautiful argo ui and webgateway sidecars.

Pulse
The heads up display of the resources in your cluster... and short cuts to the resources in view.

XRAY
Xray is a quick way to get a tree level view of the resources, 
:xray statefulsets will give you something like this:

Skins
You have been enjoying on your scroll here the incredible "isc iris iko" skin, which you can snag as a gist and drop it in ~/.config/k9s 

For you frost fans, it basically just implements:

# -----------------------------------------------------------------------------
# InterSystems IRIS Skin
# Uses Frosty Colors:
# #333695, Primary
# #00a19c, Secondary
# -----------------------------------------------------------------------------

Helm Support
I use this a lot to validate charts outside of GitOps and values.yml drift across Chart versions.

 
These examples just scratch the surface...

For a superb write up and quick start, check out: https://blog.palark.com/k9s-the-powerful-terminal-ui-for-kubernetes/

Discussion (1)1
Log in or sign up to continue