Skip to main content

Manage DNS and Ingress

Codiac simplifies the process of setting up DNS and ingress to your assets. To access your assets using an external domain name, all you need to do is:

  1. Add ingress when you create your cluster.
  2. Add a Codiac host map.
  3. Update your domain name's DNS records.
tip

For a tutorial walkthrough of this process, see Codiac Quickstart Guide Part 2.

Add a Codiac host map

Step 1: Decide how to scope your domain.

Before you add the new host map, decide what scope you want to use for your domain name. You can scope a domain name to your enterprise, environment, or cabinet.

If you are not sure, cabinet is a good place to start. Scoping your domain to a cabinet will be sufficient for most uses, and follows the best practice of "least privilege."

tip

Codiac Scopes: (tenant [enterprise {environment (cabinet)}])

  • A tenant contains enterprise(s).
  • An enterprise contains environment(s).
  • An environment contains cabinet(s).
  • A cabinet contains asset(s).

Step 2: Decide your host naming strategy.

"Host mapping" is how Codiac builds the URL you use to access your asset. Codiac's strategy-based host mapping offers many options for accessing your asset.

If you are not sure, we recommend starting with svc.cab.domain. This form of host map is:

  • svc: The service name you set in response to "Host name on the inbound domain url" when you ran codiac asset create in Quickstart 2: quickstart.
  • cab: The cabinet with your asset.
  • domain: Your domain name.

For example, let's say you have the following scenario:

  • You set quickstart as the service name ("Host name on the inbound domain url") when you created the cluster.
  • Your asset is in the test-cabinet cabinet.
  • Your domain name is example.com

If you choose svc.cab.domain as the host naming strategy, your URL to access this asset is: https://quickstart.test-cabinet.example.com.

tip

Note that Codiac automatically handles SSL for you. All URLs for Codiac assets start with HTTPS.

Step 3: Add the host map

  1. Use codiac host map to assign DNS routing to your asset:
codiac host map
  1. For Domain: enter your domain name.
  2. For Scope: choose the scope you decided on in Step 1.
  3. Select the cabinet you want to scope to the domain name.
  4. For Host naming strategy: choose the hist naming strategy you decided on in Step 2.
  5. For Continue? (y/N), answer Y.

Step 4: Find your new DNS info

  1. Use codiac host view to get your assigned IP address:
codiac host view
  1. The output of this command ends with the DNS information you need to update your name servers:
dnsRequired:
example.com:
- recordType: A
host: "*"
destinationIp: 172.202.238.6
- recordType: A
host: "@"
destinationIp: 172.202.238.6

Step 5: Update your domain's DNS

Using the destinationIP you found in Step 4, update the DNS for your domain name to add or edit:

  • An A record with host name * and the destinationIp address.
  • An A record with host name @ and the destinationIp address.
tip

The process for updating your DNS varies depending on your domain registrar or name server hosting provider. If you need help with this step, contact their support.

Step 6: Verify DNS

  1. Open a browser window and go to the URL built by your host naming strategy.

For example, let's say you have the following scenario:

  • You set quickstart as the service name ("Host name on the inbound domain url") when you created the cluster.
  • Your asset is in the test-cabinet cabinet.
  • Your domain name is example.com

If you choose svc.cab.domain as the host naming strategy, your URL to access this asset is: https://quickstart.test-cabinet.example.com.

info

The URL to access your asset always starts with https://. We use TLS configured using the industry-standard HTTP-01 challenge methodology. This lets us create a self-signed SSL certificate for all Codiac ingress routes.

  1. Your asset's default landing page appears.

View host maps

  1. Use codiac host view to view all of your existing host maps.
codiac host view

The output of this command includes information about all existing host maps, including the DNS, scope (enterprise, environment, and cabinet), cluster name, and more.

Delete a host map

  1. Use codiac host delete to delete a host map.

    1. Highlight the domain name mapping you want to delete.
    2. Enter Y to delete the mapping.