Contexts for Key/Value Usage
This site defines ontology keys that can be used in various Kubernetes contexts. Here’s a quick reference to help you understand where and how these keys can be applied:
Context Comparison
Section titled “Context Comparison”| Context | Target Objects | Max Value Length | Allowed Characters | Best For |
|---|---|---|---|---|
| Annotations | All Kubernetes Resources | Unlimited (subject to etcd object limit) | Any UTF-8 string, JSON, or YAML | URLs, timestamps, descriptions, structured configs |
| Labels | All Kubernetes Resources | 63 characters | Alphanumeric, -, _, . |
Selectors, grouping, filtering, routing |
| Taints | Nodes | 63 characters (value) | Alphanumeric, -, _, . |
Node isolation, scheduling constraints |
| Resource Claims | Dynamic Resource Allocation | Driver-dependent | Driver-dependent | Hardware attributes, GPU/FPGA allocations |
Choosing the Right Context
Section titled “Choosing the Right Context”- Use Labels when you need Kubernetes controllers, services, or CLI selectors (
kubectl get pods -l ...) to query or group resources. - Use Annotations when you need to store metadata for human operators, CI/CD tools, or external auditing platforms that do not require label selectors.
- Use Taints when you want to repel pods from nodes unless they have matching tolerations (e.g. dedicated hardware or maintenance).
Always ensure your key values match the syntax requirements for the context you’re using.