]> git.eshelyaron.com Git - esy-publish.git/commitdiff
New post about Kubed integration with kubectl command line
authorEshel Yaron <me@eshelyaron.com>
Wed, 31 Jul 2024 13:30:20 +0000 (15:30 +0200)
committerEshel Yaron <me@eshelyaron.com>
Wed, 31 Jul 2024 13:34:15 +0000 (15:34 +0200)
source/assets/kubed-1.png [new file with mode: 0644]
source/assets/kubed-2.png [new file with mode: 0644]
source/assets/kubed-3.png [new file with mode: 0644]
source/assets/kubed-4.png [new file with mode: 0644]
source/assets/kubed-5.png [new file with mode: 0644]
source/assets/kubed-docker.png [new file with mode: 0644]
source/assets/kubed-helm.png [new file with mode: 0644]
source/posts/2024-07-31-crafting-kubectl-commands-in-style-with-kubed.org [new file with mode: 0644]
source/style.css

diff --git a/source/assets/kubed-1.png b/source/assets/kubed-1.png
new file mode 100644 (file)
index 0000000..38ffcd5
Binary files /dev/null and b/source/assets/kubed-1.png differ
diff --git a/source/assets/kubed-2.png b/source/assets/kubed-2.png
new file mode 100644 (file)
index 0000000..90573f9
Binary files /dev/null and b/source/assets/kubed-2.png differ
diff --git a/source/assets/kubed-3.png b/source/assets/kubed-3.png
new file mode 100644 (file)
index 0000000..580e9f0
Binary files /dev/null and b/source/assets/kubed-3.png differ
diff --git a/source/assets/kubed-4.png b/source/assets/kubed-4.png
new file mode 100644 (file)
index 0000000..f850a79
Binary files /dev/null and b/source/assets/kubed-4.png differ
diff --git a/source/assets/kubed-5.png b/source/assets/kubed-5.png
new file mode 100644 (file)
index 0000000..ed22c0c
Binary files /dev/null and b/source/assets/kubed-5.png differ
diff --git a/source/assets/kubed-docker.png b/source/assets/kubed-docker.png
new file mode 100644 (file)
index 0000000..de0e266
Binary files /dev/null and b/source/assets/kubed-docker.png differ
diff --git a/source/assets/kubed-helm.png b/source/assets/kubed-helm.png
new file mode 100644 (file)
index 0000000..3c28d8e
Binary files /dev/null and b/source/assets/kubed-helm.png differ
diff --git a/source/posts/2024-07-31-crafting-kubectl-commands-in-style-with-kubed.org b/source/posts/2024-07-31-crafting-kubectl-commands-in-style-with-kubed.org
new file mode 100644 (file)
index 0000000..e19e386
--- /dev/null
@@ -0,0 +1,75 @@
+#+TITLE:       Composing Kubectl Commands in Style with Kubed
+#+SUBTITLE:    Tight integration with the command line in my new Emacs package for Kubernetes
+#+DESCRIPTION: A post by Eshel Yaron about tight integration with the command line Kubed, a new Emacs package for Kubernetes
+#+KEYWORDS:    emacs,kubed,kubernetes
+#+DATE:        2024-07-31
+
+@@html:<div class="metadata">@@Created on [{{{date}}}], last updated [{{{modification-time(%Y-%m-%d, t)}}}]@@html:</div>@@
+
+Last week I [[https://lists.gnu.org/archive/html/emacs-devel/2024-07/msg01175.html][announced]] my new Emacs interface for Kubernetes, /Kubed/,
+on the Emacs development mailing list.  So far working on Kubed has
+been a lot of fun, and in this post I want to highlight a feature that
+I find especially delightful.
+
+First I should mention that Kubed uses ~kubectl~ to interact with
+Kubernetes.  This is similar to how Magit uses the ~git~ program to
+interact with, well, Git.  One of the design goals for Kubed is to
+provide the full power of ~kubectl~: if you can do it with ~kubectl~
+you can do it with Kubed, too.  For many common operations, Kubed
+provides a much nicer experience than what you would get by running
+~kubectl~ in a terminal, but ~kubectl~ is abundant with subcommands
+and flags and options, and for some use cases the versatility of the
+command line is irreplaceable.
+
+So rather than hiding the ~kubectl~ command line deep under the hood,
+Kubed embraces and enhances it.
+
+[[file:../assets/kubed-1.png]]
+
+The command ~kubed-kubectl-command~ lets you invoke a quick ~kubectl~
+command line whenever you need it.  Emacs minibuffer completion is
+hooked directly to the hidden ~kubectl~ subcommand ~__complete~ which
+gives you the same completions you get in the shell.  In fact, this
+~__complete~ subcommand is not unique to ~kubectl~, it's an artifact
+of the Golang CLI framework that ~kubectl~ uses, [[https://github.com/spf13/cobra/blob/main/completions.go][Cobra]].  This
+framework is very widespread in the Go ecosystem, and since Kubed's
+command line completion uses Cobra's shell-agnostic completion
+interface, it Just Works with any Cobra program!
+
+# [[file:../assets/kubed-2.png]]
+
+[[file:../assets/kubed-docker.png]]
+
+[[file:../assets/kubed-helm.png]]
+
+You can summon ~kubed-kubectl-command~ from the menu-bar "Kubernetes"
+menu (enable ~kubed-menu-bar-mode~ to see that menu first), and if you
+have the prefix keymap ~kubed-prefix-map~ bound to e.g. ~C-c k~, then
+you can also invoke ~kubed-kubectl-command~ by typing ~C-c k !~.
+
+#+attr_html: :height 250px
+[[file:../assets/kubed-3.png]]
+
+But the real magic happens when you call this command from one of the
+Kubed /transient menus/.  These keyboard-driven menus let you compose
+complex Kubernetes operations with an intuitive interface, and all
+Kubed transient menus bind the ~!~ key to ~kubed-kubectl-command~.
+When you invoke ~kubed-kubectl-command~ from a transient menu, it
+automatically populates your initial command line according to the
+transient menu you came from and the options you've set there.
+
+[[file:../assets/kubed-4.png]]
+
+[[file:../assets/kubed-5.png]]
+
+That's pretty cool, I think.  In particular it means that you can
+always start by exploring the Kubed transient menus, and if the exact
+operation you want to carry out doesn't have a dedicated Kubed
+command, then you can hit ~!~ to seamlessly drop to the right
+~kubectl~ command line.
+
+That's it for now!  If you feel like giving Kubed go, you can grab it
+from [[https://git.sr.ht/~eshel/kubed][here]], or clone it one of the following mirrors:
+
+- https://github.com/eshelyaron/kubed.git
+- git://git.eshelyaron.com/kubed.git
index a24fc4be1412d2cd0d1d40e0df2a84803b12acc4..31e947ff130c639c9bf814a5bba64704a653f292 100644 (file)
@@ -8,6 +8,10 @@ body {
     font-family: "Helvetica Neue", sans-serif;
 }
 
+img {
+    max-width: 100%;
+}
+
 a:link.note-link, a:visited.note-link {
     text-decoration-style: dotted;
     color: #ffffff;