Skip to content

πŸš€ Neovim Kubernetes Plugin : This Neovim plugin provides seamless integration with Kubernetes and Helm, allowing you to deploy and manage Kubernetes resources directly from your editor.

Notifications You must be signed in to change notification settings

h4ckm1n-dev/kube-utils-nvim

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Neovim Kubernetes Plugin

For the lazy, you can install my full config lazyvim with kube-utils-nvim installed [template]

All Contributors

This Neovim plugin provides seamless integration with Kubernetes and Helm, allowing you to deploy and manage Kubernetes resources directly from your editor.

Features

  • Kubernetes Context and Namespace Management: Easily switch between different Kubernetes contexts and namespaces.
  • CRD Viewer: View Custom Resource Definitions directly in Neovim.
  • Helm Integration: Manage Helm charts, update dependencies, and deploy directly from Neovim.
  • Log Viewer and Formatting: Transform Kubernetes log files into a more readable JSON format.
  • Telescope Integration: Utilize Telescope for picking Kubernetes contexts, namespaces, and viewing Helm releases.
  • LSP Integration: Toggle YAML and Helm LSP settings based on the context within Neovim.
  • K9s Integration: Open k9s from nvim

Screenshots

Here are some visual previews of the plugin in action

Telescope NS selector :

  • Screenshot 1 K9S module:
  • Screenshot 2 K9S in a vertical split view :
  • Screenshot 3 Get CRD function :
  • Screenshot 4 Get Log and FormatJson :
  • image

Capture Video Preview

Installation

Install the plugin using your preferred Neovim package manager. Example for lazy.nvim:

-- ~/.config/nvim/lua/plugins/kube-utils.lua
return {
  {
    "h4ckm1n-dev/kube-utils-nvim",
    dependencies = { "nvim-telescope/telescope.nvim" },
    lazy = true,
    event = "VeryLazy"
  },
}

Key Bindings

Use the following mappings to access Kubernetes features efficiently:

local kube_utils_mappings = {
  { "<leader>k", group = "Kubernetes" }, -- Main title for all Kubernetes related commands
  -- Helm Commands
  { "<leader>kh", group = "Helm" },
  { "<leader>khT", "<cmd>HelmDryRun<CR>", desc = "Helm DryRun Buffer" },
  { "<leader>khb", "<cmd>HelmDependencyBuildFromBuffer<CR>", desc = "Helm Dependency Build" },
  { "<leader>khd", "<cmd>HelmDeployFromBuffer<CR>", desc = "Helm Deploy Buffer to Context" },
  { "<leader>khr", "<cmd>RemoveDeployment<CR>", desc = "Helm Remove Deployment From Buffer" },
  { "<leader>kht", "<cmd>HelmTemplateFromBuffer<CR>", desc = "Helm Template From Buffer" },
  { "<leader>khu", "<cmd>HelmDependencyUpdateFromBuffer<CR>", desc = "Helm Dependency Update" },
  -- Kubectl Commands
  { "<leader>kk", group = "Kubectl" },
  { "<leader>kkC", "<cmd>SelectSplitCRD<CR>", desc = "Download CRD Split" },
  { "<leader>kkD", "<cmd>DeleteNamespace<CR>", desc = "Kubectl Delete Namespace" },
  { "<leader>kkK", "<cmd>OpenK9s<CR>", desc = "Open K9s" },
  { "<leader>kka", "<cmd>KubectlApplyFromBuffer<CR>", desc = "Kubectl Apply From Buffer" },
  { "<leader>kkc", "<cmd>SelectCRD<CR>", desc = "Download CRD" },
  { "<leader>kkk", "<cmd>OpenK9sSplit<CR>", desc = "Split View K9s" },
  { "<leader>kkl", "<cmd>ToggleYamlHelm<CR>", desc = "Toggle YAML/Helm" },
  -- Logs Commands
  { "<leader>kl", group = "Logs" },
  { "<leader>klf", "<cmd>JsonFormatLogs<CR>", desc = "Format JSON" },
  { "<leader>klv", "<cmd>ViewPodLogs<CR>", desc = "View Pod Logs" },

-- Register the Kube Utils keybindings
require('which-key').add(kube_utils_mappings)

Requirements

  • Neovim 0.9.0 or higher
  • Helm
  • kubectl
  • k9s

Configuration

No additional configuration is required. Simply install the plugin and start using the commands.

License

This plugin is licensed under the MIT License. See the LICENSE file for details., also feel free to submit a PR

Contributors ✨

h4ckm1n
h4ckm1n

πŸ’»
ohdearaugustin
ohdearaugustin

πŸ’»

This project follows the all-contributors specification. Contributions of any kind welcome!

About

πŸš€ Neovim Kubernetes Plugin : This Neovim plugin provides seamless integration with Kubernetes and Helm, allowing you to deploy and manage Kubernetes resources directly from your editor.

Topics

Resources

Stars

Watchers

Forks

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •  

Languages