<p>I'm sharing the same cluster for 2 <em>namespaces</em>: <strong>staging</strong> and <strong>production</strong>. The only differences among the two namespaces are:</p>

<ol>
<li>Volumes mounted to certain pods (separate persistence between <strong>staging</strong> and <strong>production</strong>, obviously!)</li>
<li>A couple of web-URLs for relative addressing</li>
<li>A couple of IPs to databases used for sophisticated persistence</li>
</ol>

<p>I have managed to address <em>(2)</em> and <em>(3)</em> as follows, so as to maintain a single <em>YAML</em> file for all <em>ReplicationControllers</em>:</p>

<ul>
<li>Use <em>ConfigMaps</em> local to a namespace to define any configuration that is passed via environment variables into the pods</li>
<li>Use <em>Services</em> with <em>Endpoints</em> to handle a DNS entry pointing to different internal IPs</li>
</ul>

<p>However, I'm unable to find a satisfactory way to have  a reference for a <em><strong>gcePersistentDisk</strong></em>'s <em><strong>pdName</strong></em> - I can't seem to use a <em>ConfigMap</em>, hence a little stumped. What would be the appropriate way to go about this? The best alternative seems to be to maintain 2 separate <em>YAML</em> files with different strings, but this has a code-smell as it is violating <em>DRY</em>.</p>

<p>Also, any constructive commentary on the rest of my setup as mentioned above is highly appreciated :-)</p>

<p>You could probably create one <a href="http://kubernetes.io/docs/user-guide/persistent-volumes/#persistentvolumeclaims" rel="nofollow noreferrer" title="PersistentVolumeClaim">PersistentVolumeClaim</a> in each namespace. Take a look at <a href="https://stackoverflow.com/questions/34282704/can-a-pvc-be-bound-to-a-specific-pv/">Can a PVC be bound to a specific PV?</a> on how to "pre-bind" PersistentVolumes to PersistentVolumeClaims.</p>

<p>Might not be an ideal solution but it probably works 'till PVCs support label selectors.</p>
