Anil Kumar P
Anil Kumar P

Reputation: 571

Error when modifying namespace for nginx ingress

I was trying to modify my ingress as my ingress controller and ingress service are runnign in nginx-ingress name space.

I tried to to use: kubectl edit ing lhingress where ingress name is lhingress. It opens up an editor but whne i try to modify and then save it. i get below error.

error: the namespace from the provided object "nginx-ingress" does not match the namespace "default". You must pass '--namespace=nginx-ingress' to perform this operation.

Could you please suggest me how to point this ingress to different namespace

Upvotes: 1

Views: 1097

Answers (1)

manojlds
manojlds

Reputation: 301147

You cannot change namespace of existing object. You need to create a new resource in the other namespace and delete the old one.

Upvotes: 2

Related Questions