mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-27 05:27:21 +00:00
commit
7603ef443f
@ -6,7 +6,7 @@ We'll now cover some slightly more advanced topics in Kubernetes, related to app
|
|||||||
scaling.
|
scaling.
|
||||||
|
|
||||||
### Labels
|
### Labels
|
||||||
Having already learned about Pods and how to create them, ou may be struck by an urge to create many, many pods. Please do! But eventually you will need a system to organize these pods into groups. The system for achieving this in Kubernetes is Labels. Labels are key-value pairs that are attached to each API object in Kubernetes. Label selectors can be passed along with a RESTful ```list``` request to the apiserver to retrieve a list of objects which match that label selector. For example:
|
Having already learned about Pods and how to create them, you may be struck by an urge to create many, many pods. Please do! But eventually you will need a system to organize these pods into groups. The system for achieving this in Kubernetes is Labels. Labels are key-value pairs that are attached to each API object in Kubernetes. Label selectors can be passed along with a RESTful ```list``` request to the apiserver to retrieve a list of objects which match that label selector. For example:
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
cluster/kubecfg.sh -l name=nginx list pods
|
cluster/kubecfg.sh -l name=nginx list pods
|
||||||
|
Loading…
Reference in New Issue
Block a user