mirror of https://github.com/k3s-io/k3s
parent
91efe51770
commit
95aca622f5
|
@ -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