mirror of
https://github.com/ivuorinen/cheatsheet-tldr.git
synced 2026-02-23 13:51:44 +00:00
Update cheatsheets
This commit is contained in:
29
tldr/kubectl-annotate
Normal file
29
tldr/kubectl-annotate
Normal file
@@ -0,0 +1,29 @@
|
||||
---
|
||||
syntax: markdown
|
||||
tags: [tldr, common]
|
||||
source: https://github.com/tldr-pages/tldr.git
|
||||
---
|
||||
# kubectl annotate
|
||||
|
||||
> Annotates Kubernetes resources.
|
||||
> More information: <https://kubernetes.io/docs/reference/kubectl/generated/kubectl_annotate>.
|
||||
|
||||
- Annotate a pod:
|
||||
|
||||
`kubectl annotate {{[po|pods]}} {{pod_name}} {{key}}={{value}}`
|
||||
|
||||
- Update a pod annotation by overwriting the existing value:
|
||||
|
||||
`kubectl annotate {{[po|pods]}} {{pod_name}} {{key}}={{value}} --overwrite`
|
||||
|
||||
- Annotate all pods in a namespace with a specific label selector:
|
||||
|
||||
`kubectl annotate {{[po|pods]}} {{key}}={{value}} {{[-l|--selector]}} {{label_key}}={{label_value}}`
|
||||
|
||||
- List all annotations a pod has:
|
||||
|
||||
`kubectl annotate {{[po|pods]}} {{pod_name}} --list`
|
||||
|
||||
- Remove the annotation from a pod:
|
||||
|
||||
`kubectl annotate {{[po|pods]}} {{pod_name}} {{key}}-`
|
||||
Reference in New Issue
Block a user