From: Eshel Yaron Date: Wed, 31 Jul 2024 13:30:20 +0000 (+0200) Subject: New post about Kubed integration with kubectl command line X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=3bbbac269443e0a4e9681dd6d7fceee936cc480a;p=esy-publish.git New post about Kubed integration with kubectl command line --- diff --git a/source/assets/kubed-1.png b/source/assets/kubed-1.png new file mode 100644 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 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 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 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 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 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 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 index 0000000..e19e386 --- /dev/null +++ b/source/posts/2024-07-31-crafting-kubectl-commands-in-style-with-kubed.org @@ -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:
@@Created on [{{{date}}}], last updated [{{{modification-time(%Y-%m-%d, t)}}}]@@html:
@@ + +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 diff --git a/source/style.css b/source/style.css index a24fc4b..31e947f 100644 --- a/source/style.css +++ b/source/style.css @@ -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;