Reference for all kube-diff configuration options.
| Flag |
Short |
Type |
Default |
Description |
--kubeconfig |
|
string |
$KUBECONFIG or ~/.kube/config |
Path to kubeconfig file |
--context |
|
string |
Current context |
Kubernetes context to use |
--namespace |
-n |
string |
(all) |
Filter by namespace |
--kind |
-k |
[]string |
(all) |
Filter by resource kind (comma-separated) |
--name |
-N |
[]string |
(all) |
Filter by resource name (comma-separated) |
--selector |
-l |
string |
(all) |
Filter by label selector (e.g., app=nginx,env=prod) |
--summary-only |
-s |
bool |
false |
Show summary only, no diff details |
--output |
-o |
string |
color |
Output format: color, plain, json, markdown, table |
--ignore-field |
|
[]string |
(none) |
Field paths to ignore in diff (dot notation, repeatable) |
--context-lines |
-C |
int |
3 |
Number of context lines in unified diff output |
--exit-code |
|
bool |
false |
Always exit 0 even when changes are detected |
--diff-strategy |
|
string |
live |
Comparison strategy: live (cluster state) or last-applied (annotation) |
| Flag |
Short |
Type |
Default |
Description |
--values |
-f |
[]string |
|
Values files for helm template |
--release |
-r |
string |
release |
Release name for helm template |
| Variable |
Description |
KUBECONFIG |
Path to kubeconfig file (overridden by --kubeconfig flag) |
When comparing resources, kube-diff automatically strips cluster-managed fields to produce clean diffs. These fields are removed from both local and cluster resources before comparison:
| Field |
Reason |
metadata.managedFields |
Server-side apply tracking |
metadata.resourceVersion |
Internal versioning |
metadata.uid |
Cluster-assigned unique ID |
metadata.creationTimestamp |
Object creation time |
metadata.generation |
Generation counter |
metadata.selfLink |
Deprecated API link |
| Annotation |
Reason |
kubectl.kubernetes.io/last-applied-configuration |
kubectl apply tracking |
deployment.kubernetes.io/revision |
Deployment rollout tracking |
| Field |
Reason |
status |
Runtime state, not part of desired spec |
Note: If all annotations are removed, the empty annotations map is also cleaned up.
kube-diff uses the Kubernetes dynamic client, so it supports all resource types including CRDs. Resource names are automatically pluralized:
| Kind |
Resource |
| Deployment |
deployments |
| Service |
services |
| ConfigMap |
configmaps |
| Secret |
secrets |
| Pod |
pods |
| Ingress |
ingresses |
| NetworkPolicy |
networkpolicies |
| StorageClass |
storageclasses |
| IngressClass |
ingressclasses |
| EndpointSlice |
endpointslices |
| ResourceQuota |
resourcequotas |
| PriorityClass |
priorityclasses |
| RuntimeClass |
runtimeclasses |
Bold entries use special pluralization rules. All other kinds follow the simple lowercase + s pattern.