Error when modifying namespace for nginx ingress

2/14/2018

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

-- Anil Kumar P
kubernetes
kubernetes-ingress

1 Answer

2/14/2018

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

-- manojlds
Source: StackOverflow