Get DNS

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. A TLS certificate is represented by a Resource of type tls-cert. 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.

  1. From the Application overview, select the name of the Application you’d like to get the DNS for.
  2. Under Active deployment, select the most recent and then choose View Workload.
  3. The route specified for each DNS of the Workload is specified under Ingres.

If the desired output is YAML, you can get the DNS name of a Workload by running the following command with yq:

humctl get active-resources --org ${HUMANITEC_ORG} --app ${APP_ID} --env ${ENV_ID} -o yaml | yq -r '.[] | select(.metadata.type == "dns") | .status.resource.host'

If the desired output is JSON, you can get the DNS name of a Workload by running the following command with jq:

humctl get active-resources --org ${HUMANITEC_ORG} --app ${APP_ID} --env ${ENV_ID} -o json | jq -r '.[] | select(.metadata.type == "dns") | .status.resource.host'

Where the following environment variables are set:

Variable Example Description
HUMANITEC_ORG my-org The name of your Humanitec Organization.
APP_ID my-app The ID of your Humanitec Application.
ENV_ID my-env The ID of your Humanitec Environment.

The output will be similar to the following:

randomappname.newapp.io

For more information about implement Ingress in your Score file, see Implement ports and volumes.

Top