Skip to content

jrajahalme/k8s-1abel

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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 losely coupled using label names. Typos can lead to stale references between resources and are 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

$ curl -sLO releases.cilium.io/k8s-1abel/k8s-1abel-darwin-x86_64
$ mv k8s-1abel-darwin-x86_64 k8s-1abel && chmod +x k8s-1abel
$ ./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.

About

Kubernetes YAML/JSON survival kit

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • TypeScript 95.4%
  • JavaScript 4.6%