0

I'm trying to modify a k8s object's metadata?

When I do kubectl edit .... on that object and make changes and save it, it's saying edited.

But when I do kubectl describe on that object, it's still showing old values in metadata.

Underoos
  • 4,708
  • 8
  • 42
  • 85
  • In typical use I'd edit the YAML file you've checked in to source control, and `kubectl apply` that. Some things you should be able to change (`labels:`), but others define the object itself (`name:`) and can't be updated. – David Maze Aug 11 '21 at 12:05
  • Is there a way to modify the object that's already created without actually modifying the yaml file and applying. – Underoos Aug 11 '21 at 12:52
  • The problem with `kubectl edit` is that the next time you do a normal deployment, the `helm upgrade` or `kubectl apply` will overwrite your manual changes, and if your pod is acting funny, "we made some changes by hand in the cluster" isn't really a good description. – David Maze Aug 11 '21 at 15:15
  • 1
    What are you actually trying to change that's not getting reflected? Can you provide a [mcve]? – David Maze Aug 11 '21 at 15:15

0 Answers0