abrochard / kubel

Emacs extension for controlling Kubernetes with limited permissions
GNU General Public License v3.0
259 stars 41 forks source link
emacs kubernetes

MELPA abrochard

kubel

Emacs extension for controlling Kubernetes with limited permissions.

screenshot

You can watch how kubel started or read about it.

Features

We now support managing pretty much any resource!

Installation

Get it from Melpa, or copy and load the kubel.el file.

If you want to have the evil compatibility package, get it from Melpa as well or load the kubel-evil.el file.

Setup

(require 'kubel)
(kubel-vterm-setup) ; If you wish to have vterm as an option when using exec

Or if one uses use-package

(use-package kubel
  :after (vterm)
  :config (kubel-vterm-setup))

Usage

To list the pods in your current context and namespace, call

M-x kubel

To set said namespace and context, respectively call

M-x kubel-set-namespace
M-x kubel-set-context

Note that context will autocomplete but not necessarily namespaces depending on your permissions and cluster setup. See the customize section on how to tune kubel-use-namespace-list.

To switch to showing a different resource, use the R command or

M-x kubel-set-resource

This will let you select a resource and re-display the kubel buffer.

To programmatically open a session for a specific context/namespace/resource, call kubel-open from elisp

(kubel-open "<context>" "<namespace>" "<OPTIONAL resource>")

Each kubel buffer will automatically be renamed using the following template:

*kubel session: |<context>|<namespace>|<resource>|*

Shortcuts

On the kubel screen, place your cursor on a resource

enter => get resource details
C-u enter => describe resource
h => help popup
? => help popup
! => quick run shell-command
E => quick edit any resource
g => refresh
k => delete popup
r => see the rollout history for resource
p => port forward pod
l => log popup
e => exec popup
j => jab deployment to force rolling update
S => scale resource replicas
C => set context
n => set namespace
R => set resource
K => set kubectl config file
F => set output format
f => set a substring filter for resource name
M-n => jump to the next highlighted resource
M-p => jump to previous highlighted resource
m => mark item
u => unmark item
M => mark all items
U => unmark all items
c => copy popup
$ => show process buffer
s => show only resources with specified label value

Editing a resource

After describing a resource in YAML format, you can edit the buffer and hit C-c C-c to apply your changes.

For example, if you want to edit a deployment, you can switch the resource with R and select "Deployments", then press return with the cursor on the row you wish to edit, edit the buffer, and hit C-c C-c to apply.

Alternatively, you can hit E to then select the resource type and the resource name of what you want to edit.

Customize

Releases

See the CHANGELOG.md for the list of changes and maybe upcoming features.