Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
Signed-off-by: h4ckm1n <97511408+h4ckm1n-dev@users.noreply.github.com>
  • Loading branch information
h4ckm1n-dev authored Jun 16, 2024
1 parent 7627bef commit 8d0bfcd
Showing 1 changed file with 35 additions and 34 deletions.
69 changes: 35 additions & 34 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,65 +2,66 @@

For the lazy, you can install my full config lazyvim with kube-utils-nvim installed [[template]](https://github.com/h4ckm1n-dev/h4ckm1n-lazyvim-template)

<!-- ALL-CONTRIBUTORS-BADGE:START - Do not remove or modify this section -->

[![All Contributors](https://img.shields.io/badge/all_contributors-2-orange.svg?style=flat-square)](#contributors-)

<!-- ALL-CONTRIBUTORS-BADGE:END -->
![All Contributors](https://img.shields.io/badge/all_contributors-2-orange.svg?style=flat-square)

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

### in both k9s mode ctl+c is remap to exit insert mode in k9s

![Capture d’écran du 2024-05-11 18-31-56](https://github.com/h4ckm1n-dev/kube-utils-nvim/assets/97511408/bbfe3a51-6117-413f-9d31-9f66517994c2)
![Capture d’écran du 2024-05-11 18-32-41](https://github.com/h4ckm1n-dev/kube-utils-nvim/assets/97511408/c6139ddf-e9af-4665-bd57-a829b236bac2)
![Capture d’écran du 2024-05-11 18-33-09](https://github.com/h4ckm1n-dev/kube-utils-nvim/assets/97511408/8c3cbaf8-d3c0-44a8-b487-4858e06b86f7)
![Capture d’écran du 2024-06-09 22-50-06](https://github.com/h4ckm1n-dev/kube-utils-nvim/assets/97511408/b5c1158e-5c93-41aa-b9ee-6fa5e2d0cb2b)
### Key Features:
- **K9s Integration**: Remap `ctl+c` in k9s mode to exit insert mode.
- **Helm Commands**: Directly deploy, update, or remove Helm charts from within Neovim.
- **Kubectl Commands**: Apply Kubernetes configurations directly from your buffer.
- **CRD Management**: Easily fetch and view Custom Resource Definitions.
- **Log Formatting**: Automatically format JSON Kubernetes logs for clarity.
- **Telescope Integration**: Use Telescope for enhanced navigation and selection within Kubernetes environments.

#### Screenshots
Here are some visual previews of the plugin in action:
- ![Screenshot 1](https://github.com/h4ckm1n-dev/kube-utils-nvim/assets/97511408/bbfe3a51-6117-413f-9d31-9f66517994c2)
- ![Screenshot 2](https://github.com/h4ckm1n-dev/kube-utils-nvim/assets/97511408/c6139ddf-e9af-4665-bd57-a829b236bac2)
- ![Screenshot 3](https://github.com/h4ckm1n-dev/kube-utils-nvim/assets/97511408/8c3cbaf8-d3c0-44a8-b487-4858e06b86f7)
- ![Screenshot 4](https://github.com/h4ckm1n-dev/kube-utils-nvim/assets/97511408/b5c1158e-5c93-41aa-b9ee-6fa5e2d0cb2b)

## Installation

Install the plugin using your preferred package manager (below is an example using lazy.nvim):
Install the plugin using your preferred Neovim package manager. Example for `lazy.nvim`:

```lua
-- ~/.config/nvim/lua/plugins/kube-utils.lua
return {
{
"h4ckm1n-dev/kube-utils-nvim",
dependencies = { "nvim-telescope/telescope.nvim" },
lazy = true, -- Enable lazy loading for this plugin
event = "VeryLazy", -- Load the plugin when Neovim starts
opts = {},
lazy = true,
event = "VeryLazy"
},
}
```

Additionaly you can create a witch-key mapping to use the commands (this is also the list of the feature) :

```lua
```
## Key Bindings
Use the following mappings to access Kubernetes features efficiently:
```
local helm_mappings = {
k = {
name = "Kubernetes",
d = { "<cmd>HelmDeployFromBuffer<CR>", "Helm Deploy Buffer to Context" },
r = { "<cmd>RemoveDeployment<CR>", "Helm Remove Deployment From Buffer" },
T = { "<cmd>HelmDryRun<CR>", "Helm DryRun Buffer" },
a = { "<cmd>KubectlApplyFromBuffer<CR>", "Kubectl Apply From Buffer" },
D = { "<cmd>DeleteNamespace<CR>", "Kubectl Delete Namespace" },
u = { "<cmd>HelmDependencyUpdateFromBuffer<CR>", "Helm Dependency Update" },
b = { "<cmd>HelmDependencyBuildFromBuffer<CR>", "Helm Dependency Build" },
t = { "<cmd>HelmTemplateFromBuffer<CR>", "Helm Template From Buffer" },
K = { "<cmd>OpenK9sSplit<CR>", "Split View K9s" },
d = { "<cmd>HelmDeployFromBuffer<CR>", "Deploy Helm Chart" },
r = { "<cmd>RemoveDeployment<CR>", "Remove Helm Deployment" },
T = { "<cmd>HelmDryRun<CR>", "Preview Helm Deployment" },
a = { "<cmd>KubectlApplyFromBuffer<CR>", "Apply Kubectl Configuration" },
D = { "<cmd>DeleteNamespace<CR>", "Delete Kubernetes Namespace" },
u = { "<cmd>HelmDependencyUpdateFromBuffer<CR>", "Update Helm Dependencies" },
b = { "<cmd>HelmDependencyBuildFromBuffer<CR>", "Build Helm Dependencies" },
t = { "<cmd>HelmTemplateFromBuffer<CR>", "Generate Helm Template" },
K = { "<cmd>OpenK9sSplit<CR>", "Open K9s in Split View" },
k = { "<cmd>OpenK9s<CR>", "Open K9s" },
l = { "<cmd>ToggleYamlHelm<CR>", "Toggle YAML/Helm" },
c = { "<cmd>SelectCRD<CR>", "Download CRD" },
C = { "<cmd>SelectSplitCRD<CR>", "Download CRD Split" },
jl = { "<cmd>JsonFormatLogs<CR>", "Format JSON" },
l = { "<cmd>ToggleYamlHelm<CR>", "Toggle Between YAML and Helm" },
c = { "<cmd>SelectCRD<CR>", "Select and Download CRD" },
C = { "<cmd>SelectSplitCRD<CR>", "Download CRD in Split View" },
jl = { "<cmd>JsonFormatLogs<CR>", "Format JSON Logs" },
},
}

-- Register the Helm keybindings with a specific prefix
wk.register(helm_mappings, { prefix = "<leader>" })
```

## Requirements

- Neovim 0.9.0 or higher
Expand Down

0 comments on commit 8d0bfcd

Please sign in to comment.