Access a service from external network

The expected behaviour is:

  • I create an apache container with a website (let us say workload name “myweb” and container name myweb_randomhash )
  • a corresoinding service gets created named “myweb”
  • I need to allow the service to be accessible on port 80 from hostname “myweb.somedomain.com
  • port 80 needs to be usable by any other “someoneweb” service deployed in the cluster
    How can I have the cluster configured so that from internet the hostname is reachable?
    I’m not on any commercial cloud environment, but on an on premise infrastruture so no control on cloud loadbalacer or similar feature, but could install any other piece of software needed to to the job.
    Can KubeDNS be of any help?

Check out the docs on the Ingress

https://rancher.com/docs/rancher/v2.x/en/k8s-in-rancher/load-balancers-and-ingress/ingress/

Also, if you want to auto update dns on your dns provider, check out catalog app - external-dns.