Create a Kubernetes Pod in another namespace

  1. Use --namespace switch:
    kubectl create -f pod-definition.yml --namespace=dev
  2. Move namespace definition to the Pod definition file:
    ...
    metadata:
      name: nginx-pod
      namespace: dev
    ...