> ## Documentation Index
> Fetch the complete documentation index at: https://docs.ahmadraza.in/llms.txt
> Use this file to discover all available pages before exploring further.

# K9s

# 🚀 K9s Practical Guide – From Installation to Usage

K9s is a **terminal-based UI** for managing Kubernetes clusters. It provides a more intuitive and interactive way to explore resources, view logs, and execute commands compared to raw `kubectl`.

***

## 1. 🔧 Installation

### Linux / macOS

```bash theme={null}
# Install via curl
curl -sS https://webinstall.dev/k9s | bash

# Or via brew (macOS/Linux with Homebrew)
brew install derailed/k9s/k9s
```

### Windows

```powershell theme={null}
choco install k9s
```

> ✅ After installation, verify:

```bash theme={null}
k9s version
```

***

## 2. ⚙️ Setup

* K9s uses your **existing kubeconfig** (usually `~/.kube/config`).
* Ensure you can access your cluster:

```bash theme={null}
kubectl get nodes
```

* Then simply run:

```bash theme={null}
k9s
```

K9s will auto-detect the current context and namespace.

***

## 3. 🧭 Navigation

```bash theme={null}
* **Arrow keys / j k** → Move through resources
* **Enter** → Drill down into resource details
* **:q** → Quit current view
* **:ns <namespace>** → Switch namespace
* **:ctx <context>** → Switch cluster context
* **/search** → Filter resources
* **d** → Describe resource (like `kubectl describe`)
* **l** → View logs of a pod
* **s** → Shell into a pod (exec)
* **Shift+0** → Show all namespaces
```

***

## 4. 📑 Common Workflows

### 🔍 View Pods

```bash theme={null}
k9s
# Navigate to Pods → press Enter
```

### 📜 View Pod Logs

* Select pod → press `l`
* For specific container → press `0-9` to switch

### 🐚 Exec into Pod

* Select pod → press `s`
* Opens interactive shell inside container

### 📦 Manage Deployments

* Navigate to **Deployments**
* Press `d` to describe
* Press `e` to edit (opens YAML in editor)

***

## 5. 🎨 Customization

* Config stored in:

  ```
  ~/.k9s/config.yml
  ```
* You can set:

  * **Theme** (skins)
  * **Default namespace**
  * **Keybindings**

Example config snippet:

```yaml theme={null}
k9s:
  refreshRate: 2
  ui:
    skin: onedark
  namespace:
    active: default
```

***

## 6. 📌 Tips & Shortcuts

* `:` → Command mode
* `?` → Show help & shortcuts
* `Shift+g` → Jump to bottom of list
* `Ctrl+a` → View all resources
* `Shift+c` → Switch cluster context

***

## 7. ✅ Summary

K9s makes Kubernetes management **faster and more intuitive**:

* No need to remember complex `kubectl` commands
* Easy navigation through pods, deployments, logs
* Supports exec, editing, scaling, and context switching
* Customizable interface for personal workflow

***

🔥 With K9s, you’ll save tons of time navigating and debugging your Kubernetes clusters.
