title: Kubernetes - How ingress routing works
body: <p>I saw some example where the Kubernetes cluster is installed with ingress controller and then the ingress class is added with annotations and host as below.</p>
  
  <pre><code>apiVersion: extensions/v1beta1
  kind: Ingress
  metadata:
   annotations:
      kubernetes.io/ingress.class: nginx
  
  spec:
   rules:
     - host: testsvc.k8s.privatecloud.com
       http:
  </code></pre>
  
  <p>I am not sure which service is installed and which IP is configured with the DNS <strong>"k8s.privatecloud.com"</strong> so as to route requests?
  How the DNS routing <strong>"k8s.privatecloud.com"</strong> routes requests to Kubernetes cluster? How the ingress to kubernetes bridging works?</p>
  
  <p>Also, There could be many services configured with the hosts rule like,</p>
  
  <pre><code>testsvc.k8s.privatecloud.com
  testsvc1.k8s.privatecloud.com
  testsvc2.k8s.privatecloud.com
  </code></pre>
  
  <p>How the subdomain routing works here when we hit the service testsvc.k8s.privatecloud.com or testsvc1.k8s.privatecloud.com ...</p>
  
  <p>Thanks</p>