Date: 24-Apr-2020
How to Enable Live M...
In today's computing landscape...
Kubernetes announced a new release in March with new GA features. I will be introducing one of them: kubectl diff. Diff command is a feature of kubernetes since v1.13. It is stable with k8s new version (v1.18).
Diff command helps you detect differences between the current live object and the new feature object. This command focuses on changes made on the object. If you want to use this feature, you have to enable its flag by running kube-apiserver --feature-gates DryRun=true on the API-server, prior to 1.13. This feature is enabled by default since 1.13.
Usage of the diff command:
You can use the diff command to check differences in a file or files in a directory:
kubectl diff -f deployment.yaml
kubectl diff -k ./dir/
If you want to select your diff command, you can use this environment variable: KUBECTL_EXTERNAL_DIFF. By default, the diff command available in your path will be run with -u (unified) and -N (treat new files as empty) options.
export KUBECTL_EXTERNAL_DIFF=meld kubectl diff -k ./dir/
I changed the number of replicas in deployment for the case above, and you can see the output of the diff command for differences.
Kubernetes continues to improve day by day. I’m sure that the diff feature will be improved to using more kubectl flags. We are waiting excitedly for new kubernetes features and versions.
Infrastructure and Platform Developer at kloia
In today's computing landscape...
The software development lands...
Welcome to the 6th part of the...
Kubernetes is a container mana...
By design, securely connecting...