kube-watch-diff

command module
v0.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 3, 2021 License: Apache-2.0 Imports: 24 Imported by: 0

README

____    __    ____  ___   .___________.  ______  __    __                 _______   __   _______  _______ 
\   \  /  \  /   / /   \  |           | /      ||  |  |  |      ___      |       \ |  | |   ____||   ____|
 \   \/    \/   / /  ^  \ |---|  |----||  |---/ |  |__|  |     ( _ )     |  .--.  ||  | |  |__   |  |__   
  \            / /  /_\  \    |  |     |  |     |   __   |     / _ \/\   |  |  |  ||  | |   __|  |   __|  
   \    /\    / /  _____  \   |  |     |  \----.|  |  |  |    | (_>  <   |  '--'  ||  | |  |     |  |
    \__/  \__/ /__/     \__\  |__|      \______||__|  |__|     \___/\/   |_______/ |__| |__|     |__|

Notes

A kubectl plugin for watching resources and generating diffs.

If you want to watch multiple objects, and some of them are namespace-scoped, then they must be in the same namespace.

Prerequisite

This tool need diff utility for files comparison, so make sure diffutils has already been installed.

GNU Diffutils: https://www.gnu.org/software/diffutils/

If you want a colorful output, you can install colordiff wrapper for diff tool.

Colordiff: https://www.colordiff.org/

Install

  1. You can download the latest release version from:

    https://github.com/leopoldxx/kube-watch-diff/releases

Usage

You could use it like the examples below(install as kubectl plugin):

# watch a namespace scoped resource(use without kubectl)
kubectl-watch pod pod1
# watch a clusters scoped resource 
kubectl watch node node1
# watch multiple resources in a same namespace
kubectl watch nodes/node1  pods/pod1 pods/pod2
# watch multiple resources using a label selector
kubectl watch pods -l far=bar
kubectl watch deployment,rs -l far=bar
# watch all pods on the same node
kubectl watch pods --field-selector spec.nodeName=192.168.1.1
# watch 'all' category resource using label selector
kubectl watch all -l far=bar -n test-ns
# watch all masters
kubectl watch node -l node-role.kubernetes.io/master=""
# watch all nodes, and record the diffs into a file
kubectl-watch nodes --all 2>/dev/null | tee nodes.diff

Documentation

Overview

Copyright © 2020 leopoldxx

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL