<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>K9s on Backend Engineering Strategy Tools</title><link>https://backend-engineering-strategy-tools.github.io/site/tags/k9s/</link><description>Recent content in K9s on Backend Engineering Strategy Tools</description><generator>Hugo -- gohugo.io</generator><language>en-us</language><lastBuildDate>Mon, 01 Jan 2024 00:00:00 +0000</lastBuildDate><atom:link href="https://backend-engineering-strategy-tools.github.io/site/tags/k9s/index.xml" rel="self" type="application/rss+xml"/><item><title>K9s &amp; Lens</title><link>https://backend-engineering-strategy-tools.github.io/site/public-notes/frameworks-tools/k9s/</link><pubDate>Mon, 01 Jan 2024 00:00:00 +0000</pubDate><guid>https://backend-engineering-strategy-tools.github.io/site/public-notes/frameworks-tools/k9s/</guid><description>&lt;p&gt;You run everything with &lt;code&gt;kubectl&lt;/code&gt;. Get pods, describe, logs, exec, delete, apply — fifty times a day across five namespaces. It works, but every command is a context switch: type, wait, read, type again. &lt;code&gt;-n namespace&lt;/code&gt; on every single invocation.&lt;/p&gt;
&lt;p&gt;So you use K9s. A terminal UI that shows your entire cluster in one view. Switch namespaces and clusters in a keystroke, tail logs in real time, exec into a pod without constructing the command — everything you reach for in &lt;code&gt;kubectl&lt;/code&gt;, but without the friction.&lt;/p&gt;
&lt;h2 id="k9s"&gt;K9s
&lt;/h2&gt;&lt;p&gt;K9s is a TUI (terminal UI) for Kubernetes. It stays in your terminal, updates live, and is keyboard-driven throughout.&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;brew install derailed/k9s/k9s
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;k9s &lt;span style="color:#75715e"&gt;# connect to current context&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;k9s --context prod &lt;span style="color:#75715e"&gt;# specific context&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;k9s -n monitoring &lt;span style="color:#75715e"&gt;# start in a specific namespace&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h3 id="navigation"&gt;Navigation
&lt;/h3&gt;&lt;table&gt;
 &lt;thead&gt;
 &lt;tr&gt;
 &lt;th&gt;Key&lt;/th&gt;
 &lt;th&gt;Action&lt;/th&gt;
 &lt;/tr&gt;
 &lt;/thead&gt;
 &lt;tbody&gt;
 &lt;tr&gt;
 &lt;td&gt;&lt;code&gt;:pod&lt;/code&gt;&lt;/td&gt;
 &lt;td&gt;Jump to pods view&lt;/td&gt;
 &lt;/tr&gt;
 &lt;tr&gt;
 &lt;td&gt;&lt;code&gt;:deploy&lt;/code&gt;&lt;/td&gt;
 &lt;td&gt;Deployments&lt;/td&gt;
 &lt;/tr&gt;
 &lt;tr&gt;
 &lt;td&gt;&lt;code&gt;:svc&lt;/code&gt;&lt;/td&gt;
 &lt;td&gt;Services&lt;/td&gt;
 &lt;/tr&gt;
 &lt;tr&gt;
 &lt;td&gt;&lt;code&gt;:ns&lt;/code&gt;&lt;/td&gt;
 &lt;td&gt;Switch namespace&lt;/td&gt;
 &lt;/tr&gt;
 &lt;tr&gt;
 &lt;td&gt;&lt;code&gt;/&lt;/code&gt;&lt;/td&gt;
 &lt;td&gt;Filter/search&lt;/td&gt;
 &lt;/tr&gt;
 &lt;tr&gt;
 &lt;td&gt;&lt;code&gt;l&lt;/code&gt;&lt;/td&gt;
 &lt;td&gt;Logs&lt;/td&gt;
 &lt;/tr&gt;
 &lt;tr&gt;
 &lt;td&gt;&lt;code&gt;e&lt;/code&gt;&lt;/td&gt;
 &lt;td&gt;Edit resource YAML&lt;/td&gt;
 &lt;/tr&gt;
 &lt;tr&gt;
 &lt;td&gt;&lt;code&gt;d&lt;/code&gt;&lt;/td&gt;
 &lt;td&gt;Describe&lt;/td&gt;
 &lt;/tr&gt;
 &lt;tr&gt;
 &lt;td&gt;&lt;code&gt;s&lt;/code&gt;&lt;/td&gt;
 &lt;td&gt;Shell into pod&lt;/td&gt;
 &lt;/tr&gt;
 &lt;tr&gt;
 &lt;td&gt;&lt;code&gt;ctrl-d&lt;/code&gt;&lt;/td&gt;
 &lt;td&gt;Delete&lt;/td&gt;
 &lt;/tr&gt;
 &lt;tr&gt;
 &lt;td&gt;&lt;code&gt;?&lt;/code&gt;&lt;/td&gt;
 &lt;td&gt;Help / full keybinding list&lt;/td&gt;
 &lt;/tr&gt;
 &lt;/tbody&gt;
&lt;/table&gt;
&lt;p&gt;Most resource types are reachable by typing &lt;code&gt;:&lt;/code&gt; followed by the resource name — &lt;code&gt;:configmap&lt;/code&gt;, &lt;code&gt;:secret&lt;/code&gt;, &lt;code&gt;:ingress&lt;/code&gt;, &lt;code&gt;:pvc&lt;/code&gt;, and so on.&lt;/p&gt;
&lt;h3 id="why-tui-over-gui"&gt;Why TUI over GUI
&lt;/h3&gt;&lt;p&gt;K9s lives in the terminal alongside your other tools. No window switching, works over SSH, starts instantly, and the keyboard-driven workflow is faster once it is in muscle memory. For day-to-day cluster work it is the right default.&lt;/p&gt;
&lt;h2 id="lens"&gt;Lens
&lt;/h2&gt;&lt;p&gt;Lens is a desktop GUI for Kubernetes — a full IDE-style interface with a visual cluster overview, resource browsing, metrics charts, log streaming, and terminal access built in.&lt;/p&gt;
&lt;p&gt;It is the better choice when you need to onboard someone who is not yet comfortable with the terminal, or when you want a visual overview to share with a non-technical stakeholder. For engineers doing operational work all day, K9s is faster.&lt;/p&gt;
&lt;p&gt;Worth noting: Lens has moved toward a commercial model (Lens Desktop Pro). &lt;strong&gt;&lt;a class="link" href="https://github.com/MuhammedKalkan/OpenLens" target="_blank" rel="noopener"
 &gt;OpenLens&lt;/a&gt;&lt;/strong&gt; is the open-source build of the same codebase, without the account requirement.&lt;/p&gt;
&lt;h2 id="kubectx--kubens"&gt;kubectx / kubens
&lt;/h2&gt;&lt;p&gt;If K9s is more than you need and you just want to stop typing &lt;code&gt;--context&lt;/code&gt; and &lt;code&gt;-n&lt;/code&gt; on every command, &lt;code&gt;kubectx&lt;/code&gt; and &lt;code&gt;kubens&lt;/code&gt; solve exactly that:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;kubectx &lt;span style="color:#75715e"&gt;# list contexts&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;kubectx prod &lt;span style="color:#75715e"&gt;# switch to prod context&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;kubectx - &lt;span style="color:#75715e"&gt;# switch back to previous context&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;kubens &lt;span style="color:#75715e"&gt;# list namespaces&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;kubens monitoring &lt;span style="color:#75715e"&gt;# switch default namespace&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;No TUI, no GUI — just fast context and namespace switching that persists for the rest of your terminal session. Install alongside K9s; they complement each other.&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;brew install kubectx
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h2 id="resources"&gt;Resources
&lt;/h2&gt;&lt;ul&gt;
&lt;li&gt;&lt;a class="link" href="https://k9scli.io/" target="_blank" rel="noopener"
 &gt;K9s documentation&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a class="link" href="https://github.com/derailed/k9s" target="_blank" rel="noopener"
 &gt;K9s GitHub&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a class="link" href="https://k8slens.dev/" target="_blank" rel="noopener"
 &gt;Lens&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a class="link" href="https://github.com/MuhammedKalkan/OpenLens" target="_blank" rel="noopener"
 &gt;OpenLens&lt;/a&gt; — open-source Lens build&lt;/li&gt;
&lt;li&gt;&lt;a class="link" href="https://github.com/ahmetb/kubectx" target="_blank" rel="noopener"
 &gt;kubectx/kubens&lt;/a&gt; — fast context and namespace switching&lt;/li&gt;
&lt;/ul&gt;</description></item></channel></rss>