<p>Let's suppose I've got following manifests like deployment, services and ingress. All it works fine in default namespace. Although I want to throw resources to another namespace created with manifest.yaml. I thought if I wrote <strong>kubectl appy -f $DIR</strong> it would work as expected: objects would be moved to another namespace. But nothing changed.</p>
<p>To sum up, how can force moving objects to another namespace?</p>

Igor Samarskiy
<p>You can either edit all the deployment yamls to add <code>namespace</code> or you can run <code>kubectl apply -f $DIR -n namespacename</code>. This command will deploy all the yamls to namespace <code>namespacename</code></p>
<p>Edit:</p>
<p>The thing to understand here is you can not move resources from one namespace to another namespace just by changing the namespace in the yaml. If you do that It will just create another copy of the same resource in another namespace. Delete from previous namespace and recreate in new namespace is the right approach.</p>
