title: Access service on subdomain in Kubernetes
body: <p>I have following setup:<br></p>
  
  <ul>
  <li><strong>Private OpenStack Cloud</strong> - o&#x332;n&#x332;l&#x332;y&#x332; Web UI (Horizon) is accessible
  <br>(API is restricted but maybe I could get access)</li>
  <li>I have used <strong>CoreOS</strong> with a setup of one <em>master</em> and <em>three nodes</em></li>
  <li>Resources are standardized (as default of OpenStack)</li>
  <li>I followed the getting-started guide for CoreOS (i.e. I'm using the default YAMLs for cloud-config provided) on <a href="https://github.com/kubernetes/kubernetes/tree/master/docs/getting-started-guides" rel="nofollow">GitHub</a></li>
  </ul>
  
  <p>As I read extensions such like Web UI (kube-ui) can be added as Add-On - which I have added (only kube-ui).</p>
  
  <p>Now if I run a test such like simple-nginx I get following output:</p>
  
  <p>creating pods:</p>
  
  <pre><code>$ kubectl run my-nginx --image=nginx --replicas=2 --port=80
  </code></pre>
  
  <p>creating service:</p>
  
  <pre><code>$ kubectl expose rc my-nginx --port=80 --type=LoadBalancer          
  NAME       LABELS         SELECTOR       IP(S)     PORT(S)
  my-nginx   run=my-nginx   run=my-nginx             80/TCP
  </code></pre>
  
  <p>get service info:</p>
  
  <pre><code>$ kubectl describe service my-nginx                                                                                                
  Name:           my-nginx
  Namespace:      default
  Labels:         run=my-nginx
  Selector:       run=my-nginx
  Type:           LoadBalancer
  IP:             10.100.161.90
  Port:           &lt;unnamed&gt;   80/TCP
  NodePort:       &lt;unnamed&gt;   31170/TCP
  Endpoints:      10.244.19.2:80,10.244.44.3:80
  Session Affinity:   None
  No events.
  </code></pre>
  
  <p><em>I can access my service from every(!) external IP of the nodes.</em></p>
  
  <p>My question now is as follows:</p>
  
  <p><em>How can access any started service ether with a subdomain and therefore how can I set this configuration (for example I have domain.com as example) or could it be printed out on which node-IP I have to access my service (although I have only two replicas(?!))?</em></p>
  
  <p>To describe my thoughts more understandable I mean following:</p>
  
  <ul>
  <li>given domain: <strong>domain.com</strong> (pointing to master)</li>
  <li>start service <strong>simple-nginx</strong></li>
  <li>service can be accessed with <strong>simple-nginx.domain.com</strong></li>
  </ul>