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.
$ 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
Source Resource | Target Resources |
---|---|
Service | Pod (and all higher level constructs such as Deployments |
CiliumNetworkPolicy | Pod (and all higher level constructs such as Deployments |
kubectl
must be installed in$PATH
.
Install yarn, then
yarn
to install dependencies, then run
yarn test -h
to execute the CLI.
yarn build
to build all binaries.