Git Product home page Git Product logo

k8srolediff's Introduction

k8srolediff User Guide

Author / Maintainer: torblerone

TO BE REFACTORED SOON

Introduction

The Java tool k8srolediff extracts differences between two Kubernetes (k8s) roles by given their YAML files. This is useful if you e.g. want to look at the logical differences between an old existing Role and a new Role you just wrote. Using the tool as described below (Section Usage), it outputs the diff in a formatted table on the console.

k8srolediff is a console program. It is inspired by other diff tools. But since others don't show the logical differences between Kubernetes Roles when compared, this little tool might be your helper.

Usage

You can compile the resources with Maven or just use the given JAR that lies inside this repo.

Start k8srolediff with the following command: java -jar k8srolediff.jar [oldRole.yaml] [newRole.yaml]

Note that the two YAML files have to be present in the same directory as the tool itself. Otherwise you will have to give the absolute path of the Role file. You may also parse the YAML to stdin using your kubectl like kubectl get rolebindings.[...].

After extracting the differences, the tool outputs a table in following format:

apiGroup resource verbs1 verbs2 diff
'*' configmaps 2 0 [- get, - list]
'*' deployments 5 0 [- get, - list, - patch, - update, - watch]

What happens is that the tool matches every apiGroup with every resource and checks the Roles for any matching rules. If a Role contains the '*' apiGroup, it has access to all resources that are inside that specific rule. Therefore, the Role has access to the resource in every possible apiGroup.

k8srolediff's People

Contributors

todu0001 avatar torblerone avatar uncloudvernichter avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.