title: Staging and Production on Kubernetes
body: <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>