Is there a different way than kubectl edit
to delete an annotation in Kubernetes?
I do not like the interactivity of kubectl edit
. I prefer something usable in a script.
show that, using kubectl, the operator can change the annotations on a single pod. In other words, API server UPDATE requests for pods can contain changes to the annotations field.
You can use Kubernetes annotations to attach arbitrary non-identifying metadata to objects. Clients such as tools and libraries can retrieve this metadata.
Use minus -
sign at the end of the annotation in kubectl annotate
.
Example:
kubectl annotate service shopping-cart prometheus.io/scrape-
Removes annotation prometheus.io/scrape
from shopping-cart
service.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With