Source VS Deployed
Table of Contents
The showcase demonstrates an upgrade of agones
| Kubediff | Kubectl diff |
|---|---|
| Notice that kubediff has removed the hated managedFields |
Used to sanity check and understand what has changed between environments.
This cli tool written in Rust is a wrapper around kubectl diff and is supposed to diff one or multiple projects instead of single files against any environment you want, be it docker-desktop, dev, prod.
It takes a glob pattern to one or more projects and beautifies the output so you can get an understanding on what differences there are.
Ever asked yourself, what is deployed on my cluster? Or,
We will loop over the projects files and run kubectl build, then pipe the output into kubectl diff and then process the output of that to make it pretty.
No external dependencies required - all tools are bundled with the binary.
Download and extract the binary.
KUBEDIFF_VERSION=0.1.7 && \
KUBEDIFF_OS=x86_64-unknown-linux-gnu && \
wget "https://github.com/Ramilito/kubediff/releases/download/${KUBEDIFF_VERSION}/kubediff_${KUBEDIFF_VERSION}_${KUBEDIFF_OS}.tar.gz" && \
mkdir -p $HOME/.kube/kubediff && tar zxpf kubediff_${KUBEDIFF_VERSION}_${KUBEDIFF_OS}.tar.gz -C $HOME/.kube/kubediffAdd it to your PATH in .zshrc/.bashrc.
export PATH="$PATH:/home/$USER/.kube/kubediff"Se the available commands by running kubediff -h
Regular usage would be to list your projects in the config.yaml file located at the install directory
Few projects, will use the kustomization file located at that path:
configs:
include:
- "~/projectone/serviceone/k8s"
- "~/projecttwo/servicetwo/k8s"Many projects (monorepo), will use glob pattern to find all services:
configs:
include:
- "~/monorepo/Services/**/k8s"Many environments, will suffix the variable to end of the paths in config.yaml, example below will look in "~/monorepo/Services/**/k8s/dev"
kubediff -e devYou can also bypass the config by passing either -path or -inplace argument:
kubediff -p ~/path-to-dir-or-file
kubediff -i No open issues yet, or sync has not completed.