https://github.com/rajamohan-rj/kdiff
๐ Kubernetes Resource Differ - Compare K8s resources between namespaces with colored diff output, kubectl neat integration, and multiple format support. Essential DevOps tool for environment comparison and debugging.
https://github.com/rajamohan-rj/kdiff
automation ci-cd devops-tools diff difference environment-comparison git golang k8s kubectl kubectl-plugins kuberentes mono-repo multi-platform yaml-diff
Last synced: 2 months ago
JSON representation
๐ Kubernetes Resource Differ - Compare K8s resources between namespaces with colored diff output, kubectl neat integration, and multiple format support. Essential DevOps tool for environment comparison and debugging.
- Host: GitHub
- URL: https://github.com/rajamohan-rj/kdiff
- Owner: rajamohan-rj
- License: mit
- Created: 2025-10-03T05:40:39.000Z (8 months ago)
- Default Branch: main
- Last Pushed: 2025-10-03T08:59:27.000Z (8 months ago)
- Last Synced: 2026-04-10T22:38:13.920Z (2 months ago)
- Topics: automation, ci-cd, devops-tools, diff, difference, environment-comparison, git, golang, k8s, kubectl, kubectl-plugins, kuberentes, mono-repo, multi-platform, yaml-diff
- Language: Go
- Homepage: https://github.com/rajamohan-rj/kdiff/releases
- Size: 21.5 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# kdiff - Kubernetes Resource Differ
A tool to compare Kubernetes resources between different namespaces, making it easy to spot differences across environments.
## Features
- ๐ Compare Kubernetes resources between any two namespaces
- ๐จ Colored diff output for better readability
- ๐งน Optional `kubectl neat` integration to clean output
- ๐ Multiple output formats (unified, context, side-by-side)
- ๐ง Support for all Kubernetes resource types
- ๐ Verbose logging for debugging
## Installation
### ๐ Quick Install (Recommended)
#### Unix/Linux/macOS
```bash
curl -sSL https://raw.githubusercontent.com/rajamohan-rj/kdiff/main/install.sh | bash
```
#### Windows (PowerShell)
```powershell
iwr -useb https://raw.githubusercontent.com/rajamohan-rj/kdiff/main/install.ps1 | iex
```
### ๐ฆ Package Managers
#### Using Go
```bash
go install github.com/rajamohan-rj/kdiff@latest
```
#### Using Homebrew (macOS/Linux)
```bash
# Add the tap (after setting up Homebrew tap)
brew tap rajamohan-rj/tap
brew install kdiff
```
### ๐ ๏ธ Advanced Installation
#### Install to custom directory
```bash
# Unix/Linux/macOS
curl -sSL https://raw.githubusercontent.com/rajamohan-rj/kdiff/main/install.sh | bash -s -- --dir ~/.local/bin
# Windows
iwr -useb https://raw.githubusercontent.com/rajamohan-rj/kdiff/main/install.ps1 | iex -InstallDir 'C:\tools'
```
#### Install specific version
```bash
# Unix/Linux/macOS
curl -sSL https://raw.githubusercontent.com/rajamohan-rj/kdiff/main/install.sh | bash -s -- --version v0.1.0
# Windows
iwr -useb https://raw.githubusercontent.com/rajamohan-rj/kdiff/main/install.ps1 | iex -Version 'v0.1.0'
```
### ๐ฅ Manual Download
Download the latest binary from [releases](https://github.com/rajamohan-rj/kdiff/releases) and extract.
## Usage
```bash
# Compare deployments between staging and production
kdiff staging my-app production my-app
# Compare services with verbose output
kdiff --verbose dev my-service prod my-service
# Compare without colored output
kdiff --no-color namespace1 deployment/app namespace2 deployment/app
# Use context diff format
kdiff --output context ns1 svc/api ns2 svc/api
# Compare with side-by-side format and skip kubectl neat
kdiff --output side-by-side --no-neat ns1 pod/web ns2 pod/web
```
## Options
- `--no-color` - Disable colored output
- `--no-neat` - Skip kubectl neat processing
- `--output` - Output format (unified, context, side-by-side)
- `--verbose` - Enable verbose logging
- `--version` - Show version information
## Prerequisites
- `kubectl` command-line tool
- `kubectl neat` plugin (optional, for cleaner YAML output)
- `colordiff` (optional, for colored output)
## How it works
1. Retrieves the specified resource from the first namespace using `kubectl get`
2. Retrieves the specified resource from the second namespace
3. Optionally processes the YAML through `kubectl neat` to remove cluster-specific metadata
4. Performs a diff between the two YAML files
5. Optionally colorizes the output using `colordiff`
## License
MIT License - see [LICENSE](LICENSE) file for details.