<p>i am trying to pass a configuration file(which is located on master) on nginx container at the time of replication controller creation through kubernetes..  ex. as we are using ADD command in Dockerfile...</p>

<p>There isn't a way to dynamically add file to a pod specification when instantiating it in Kubernetes.</p>

<p>Here are a couple of alternatives (that may solve your problem):</p>

<ol>
<li><p>Build the configuration file into your container (using the docker ADD command). This has the advantage that it works in the way which you are already familiar but the disadvantage that you can no longer parameterize your container without rebuilding it.</p></li>
<li><p>Use environment variables instead of a configuration file. This may require some refactoring of your code (or creating a side-car container to turn environment variables into the configuration file that your application expects).</p></li>
<li><p>Put the configuration file into a <a href="http://kubernetes.io/docs/user-guide/volumes/" rel="noreferrer">volume</a>. Mount this volume into your pod and read the configuration file from the volume. </p></li>
<li><p>Use a <a href="http://kubernetes.io/docs/user-guide/secrets/" rel="noreferrer">secret</a>. This isn't the intended use for secrets, but secrets manifest themselves as files inside your container, so you can base64 encode your configuration file, store it as a secret in the apiserver, and then point your application to the location of the secret file that is created inside your pod. </p></li>
</ol>
