Dolphin
Dolphin

Reputation: 38601

how to change kubernetes pod namespace

I am created a pod in default namespace in kubernetes,but now I want to move pod to dabai-fat namespace I current created.I am trying to modify the yaml file but it give error:

the namespace of the object (dabai-fat) does not match the namespace on the request (default)

what should I do to make it work,should I delete the old pod and created a new pod?

Upvotes: 0

Views: 3832

Answers (1)

Shashank V
Shashank V

Reputation: 11183

Yes, you should delete the old pod and recreate the new pod in the desired namespace.

You cannot move kubernetes resources between namespaces. Combination of name and namespace identifies a resource uniquely. So you cannot move the resource to a different namespace as another resource might already be present in the other namespace with same name.

Upvotes: 6

Related Questions