Kubernetes Label Selector Builder
Interactively construct equality-based and set-based Kubernetes label selectors for CLI filtering (`kubectl get -l`) and YAML manifest selectors (`matchLabels` / `matchExpressions`).
Ready
Selector Reference Guidelines
1. Equality-Based Operators
Allows filtering by key-value pairs using operators like =, == (equality) or != (inequality).
2. Set-Based Operators
Supports filtering across sets of values using in, notin, and key existence checks like exists / doesnotexist.
How to use Kubernetes Label Selector Builder
- Enter or paste the values requested in the input fields.
- Choose any options provided, then run an action button if the tool requires one.
- Review the result and copy or adjust it as needed.
Kubernetes Label Selector Builder features
- Available tool controls: Add Equality, Add Set Rule.
- Input and option fields: Target Resource Command:, Equality Selectors:, Set-Based Selectors:.
Using Kubernetes Label Selector Builder in a development workflow
Start with one example whose expected result you can verify by hand; it makes errors in the input easier to spot.
Check the input before running the tool
- Change one input at a time so you can tell which option affects the result.
- Pay attention to these page fields: Target Resource Command:, Equality Selectors:, Set-Based Selectors:. Confirm which fields are inputs, options, or output areas before processing.
- The page exposes these relevant actions: Add Equality, Add Set Rule. Choose only the action that matches the result you need.
- Keep the original input and compare it with the output before copying the result into another workflow.
Keep the original available for comparison
Validate manifests against the target Docker or Kubernetes version and cluster policy. Review exposed ports, resource limits, permissions, and secret handling before deployment.
Frequently Asked Questions (FAQ)
matchLabels is a map of {key,value} pairs equivalent to equality-based equality. matchExpressions is a list of more advanced set-based requirement selectors.
Yes, comma-separated selector strings can mix equality and set-based constraints together, e.g.,
environment=production,tier in (frontend,backend).
Yes. Label keys and values must follow DNS-1123 label naming rules, consisting of alphanumeric characters, hyphens, underscores, or dots.