DNS names provide a standard way to make services accessible on the public internet. In Kubernetes applications, DNS names are most often used with Ingress objects to map incoming requests to an external Load Balancer to workloads running inside the cluster.
In Humanitec, a DNS name is represented as a Resource of type dns. The DNS name for the resource might be known ahead of time (a static resource) or generated when it is first used (dynamic).
By default, Humanitec will automatically generate dynamic DNS name under the .newapp.io domain along with a valid SSL certificate. However, it is possible to configure different DNS names that will get picked up in different environments.
A Dynamic Resource Definition can be used to define how new DNS names should be generated. In most cases, this involves creating a subdomain to an existing domain. Humanitec provides 2 drivers which can be used to dynamically generate DNS names as required on existing domains:
This driver assumes that a wildcard record exists in the appropriate zone file resolving all DNS requests on any subdomain to be directed to the cluster Load Balancer. The driver will generate new unique subdomains and requires a static wildcard TLS certificate.
By definition, this driver can only be used for environments in a single cluster.
As each workload that needs to be exposed requires a different DNS name the resource matching criteria used must exactly match the relevant workload. Note, due to a limitation in the UI it is not yet possible to define resource level matching criteria via the UI. It has to be done via the API.
Here is an example of the API call to create a Static Resource Definition where a workload called frontend-service in the production environment of the topic-share app will be exposed with the DNS name app.topicshare.com: