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.
$ 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
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.