Giter VIP home page Giter VIP logo

k8s-1abel's Introduction

k8s-1abel - Kubernetes YAML/JSON survival kit

The tool that helps you survive painful YAML days.

Kubernetes uses label selectors to create references between different resources such as services referring to pods or deployments. All references are loosely coupled using label names. Typos can lead to stale references between resources and can be very hard to find.

k8s-1abel ("k8s-label") validates all LabelSelector in Kubernetes resources such as Services, and automatically points out label references that cannot be associated with a target pod or target deployment.

Example - Validate all service references

screenshot

Installation & Usage

$ kubectl apply -f https://raw.githubusercontent.com/cilium/k8s-1abel/master/k8s-1abel.yaml
$ kubectl exec -it -n k8s-1abel k8s-1abel bash
$ k8s-1abel services
✘ default/amazing:{"isGlobal":false,"matchLabels":{"1abel":"amazing"}} does not select anything
  "1abel":"amazing" not found. Did you mean "label":"amazing"? "1label":"amazing"
ℹ Run with -v to see the list of services/pods

Supported Kubernetes Resources

Source Resource Target Resources
Service Pod (and all higher level constructs such as Deployments
CiliumNetworkPolicy Pod (and all higher level constructs such as Deployments

Requirements

  • kubectl must be installed in $PATH.

Build & Development Requirements

Install yarn, then

yarn

to install dependencies, then run

yarn test -h

to execute the CLI.

yarn build

to build all binaries.

k8s-1abel's People

Contributors

jrajahalme avatar tgraf avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

Forkers

jrajahalme

k8s-1abel's Issues

Error: stdout maxBuffer exceeded

I tried ./k8s-1abel services in a cluster with 924 k8s Services, looks like I hit a default buffer threshold?

Stack Trace

./k8s-1abel services
{ Error: stdout maxBuffer exceeded
    at Socket.onChildStdout (child_process.js:328:14)
    at emitOne (events.js:116:13)
    at Socket.emit (events.js:211:7)
    at addChunk (_stream_readable.js:263:12)
    at readableAddChunk (_stream_readable.js:246:13)
    at Socket.Readable.push (_stream_readable.js:208:10)
    at Pipe.onread (net.js:594:20) cmd: 'kubectl get services --all-namespaces -o=json' }

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.