# kk **Repository Path**: nbcx/kk ## Basic Information - **Project Name**: kk - **Description**: kk is a CLI tool to manage kubernetes pods (info, restart, shell) by name. - **Primary Language**: Unknown - **License**: Apache-2.0 - **Default Branch**: main - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2025-12-16 - **Last Updated**: 2026-01-26 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # kk - Kubernetes Pod Manager `kk` is a simple yet powerful CLI tool designed to streamline Kubernetes pod management. It allows you to quickly find, view logs, restart, and shell into pods using fuzzy name matching across *all* namespaces. ## Features - **Fuzzy Matching**: Find pods by partial name search. - **Global Search**: Searches for pods across all namespaces by default. - **Interactive Selection**: Automatically prompts for selection if multiple pods match your query. - **Container Selection**: Interactive prompt to select a container if a pod has multiple containers (for logs and shell). - **Rich Command Set**: - View pod info (status, IP, node, start time). - Stream logs with advanced filtering (`grep`/`filter`). - "Live" view shortcut for monitoring logs. - Restart pods. - Shell into pods. ## Installation You can build and install `kk` from source. Ensure you have Go installed (1.18+ recommended). ```bash git clone cd kk go install . ``` Or build a binary: ```bash go build -o kk . # Move 'kk' to a directory in your PATH mv kk /usr/local/bin/ ``` ## Usage The general syntax is: ```bash kk [command] [pod_name_pattern] [flags] ``` If no command is specified, `kk` defaults to showing pod information. ### Global Flags - `--kubeconfig`: Path to your kubeconfig file (defaults to `~/.kube/config`). ### Commands #### 1. Pod Information (Default) Search for a pod and display its details (Name, Namespace, Status, IP, Node, Start Time). ```bash kk my-app # Matches 'my-app-db', 'my-app-web', etc. ``` #### 2. View Logs (`logs`) View logs for a pod. Supports tailing, following, and filtering. ```bash # Basic log view kk logs my-app # Follow logs (stream) kk logs -f my-app # Tail last 500 lines kk logs --tail=500 my-app # Filter logs by keyword (client-side grep) kk logs --grep="error" my-app ``` #### 3. Live Logs (`live`) A shortcut command for `logs -f --tail=100`. Great for quickly checking recent activity. ```bash kk live my-app # Equivalent to: kk logs -f --tail=100 my-app ``` #### 4. Restart Pod (`restart`) Restart a pod by deleting it (Kubernetes will recreate it if it's managed by a deployment/replica set). ```bash kk restart my-app ``` #### 5. Shell (`shell`) Open an interactive shell (`sh`) inside a pod's container. ```bash kk shell my-app ``` #### 6. View/Edit ConfigMaps (`configmap`) List ConfigMaps associated with a pod (via volumes or env vars) and edit them. ```bash kk configmap my-app # or kk cm my-app ``` #### 7. List Namespaces (`namespaces` / `ns`) List all namespaces in the cluster. ```bash kk namespaces # or kk ns ```