<p>I am running the command</p>

<pre><code>kubectl create -f mypod.yaml --namespace=mynamespace
</code></pre>

<p>as I need to specify the environment variables through a configMap I created and specified in the mypod.yaml file. Kubernetes returns</p>

<blockquote>
  <p>pod/mypod created</p>
</blockquote>

<p>but <code>kubectl get pods</code> doesn't show it in my list of pods and I can't access it by name as if it does not exist. However, if I try to create it again, it says that the pod is already created.</p>

<p>What may cause this, and how would I diagnose the problem?</p>

zcleghern
<p>By default, <code>kubectl</code> commands operate in the <code>default</code> namespace.  But you created your pod in the <code>mynamespace</code> namespace.</p>

<p>Try one of the following:</p>

<pre><code>kubectl get pods -n mynamespace
kubectl get pods --all-namespaces
</code></pre>
