<p>One way I could think of is to set an environment which value is the namespace of the Pod when defining the Pod.<br>
Getting the namespace dynamically without requiring changes for Pod will be 
better because it lessens the burden of constructing a Pod.  </p>

<p>So is there a way to get current namespace in a Pod?</p>

<p>Try the file:</p>

<pre><code>/var/run/secrets/kubernetes.io/serviceaccount/namespace
</code></pre>
