You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The discussion about "managing labels effectively" and "updating labels"
are currently difficult to find. They are supposed to be part of the labels
concept page. This PR moves this two sections there and adjusts the links
where they were pointed at.
<!--TODO: make a task out of this for canary deployment, ref #42786-->
179
+
244
180
Another scenario where multiple labels are needed is to distinguish deployments of different
245
181
releases or configurations of the same component. It is common practice to deploy a *canary* of a
246
182
new application release (specified via image tag in the pod template) side by side with the
@@ -296,42 +232,6 @@ the canary one.
296
232
For a more concrete example, check the
297
233
[tutorial of deploying Ghost](https://github.com/kelseyhightower/talks/tree/master/kubecon-eu-2016/demo#deploy-a-canary).
298
234
299
-
## Updating labels
300
-
301
-
Sometimes existing pods and other resources need to be relabeled before creating new resources.
302
-
This can be done with `kubectl label`.
303
-
For example, if you want to label all your nginx pods as frontend tier, run:
304
-
305
-
```shell
306
-
kubectl label pods -l app=nginx tier=fe
307
-
```
308
-
309
-
```none
310
-
pod/my-nginx-2035384211-j5fhi labeled
311
-
pod/my-nginx-2035384211-u2c7e labeled
312
-
pod/my-nginx-2035384211-u3t6x labeled
313
-
```
314
-
315
-
This first filters all pods with the label "app=nginx", and then labels them with the "tier=fe".
316
-
To see the pods you labeled, run:
317
-
318
-
```shell
319
-
kubectl get pods -l app=nginx -L tier
320
-
```
321
-
322
-
```none
323
-
NAME READY STATUS RESTARTS AGE TIER
324
-
my-nginx-2035384211-j5fhi 1/1 Running 0 23m fe
325
-
my-nginx-2035384211-u2c7e 1/1 Running 0 23m fe
326
-
my-nginx-2035384211-u3t6x 1/1 Running 0 23m fe
327
-
```
328
-
329
-
This outputs all "app=nginx" pods, with an additional label column of pods' tier (specified with
330
-
`-L`or `--label-columns`).
331
-
332
-
For more information, please see [labels](/docs/concepts/overview/working-with-objects/labels/)
333
-
and [kubectl label](/docs/reference/generated/kubectl/kubectl-commands/#label).
334
-
335
235
## Updating annotations
336
236
337
237
Sometimes you would want to attach annotations to resources. Annotations are arbitrary
Copy file name to clipboardExpand all lines: content/en/docs/tutorials/stateless-application/guestbook.md
+2-1
Original file line number
Diff line number
Diff line change
@@ -419,4 +419,5 @@ labels to delete multiple resources with one command.
419
419
* Complete the [Kubernetes Basics](/docs/tutorials/kubernetes-basics/) Interactive Tutorials
420
420
* Use Kubernetes to create a blog using [Persistent Volumes for MySQL and Wordpress](/docs/tutorials/stateful-application/mysql-wordpress-persistent-volume/#visit-your-new-wordpress-blog)
421
421
* Read more about [connecting applications with services](/docs/tutorials/services/connect-applications-service/)
422
-
* Read more about [Managing Resources](/docs/concepts/cluster-administration/manage-deployment/#using-labels-effectively)
422
+
* Read more about [using labels effectively](/docs/concepts/overview/working-with-objects/labels/#using-labels-effectively)
0 commit comments