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:
- Add ingress when you create your cluster.
- Add a Codiac host map.
- Update your domain name's DNS records.
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."
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.
Note that Codiac automatically handles SSL for you. All URLs for Codiac assets start with HTTPS.
Step 3: Add the host map
- Use
codiac host map
to assign DNS routing to your asset:
codiac host map
- For Domain: enter your domain name.
- For Scope: choose the scope you decided on in Step 1.
- Select the cabinet you want to scope to the domain name.
- For Host naming strategy: choose the hist naming strategy you decided on in Step 2.
- For Continue? (y/N), answer
Y
.
Step 4: Find your new DNS info
- Use
codiac host view
to get your assigned IP address:
codiac host view
- The output of this command ends with the DNS information you need to update your name servers:
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.
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
- 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.
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.
- Your asset's default landing page appears.
View host maps
- 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
-
Use
codiac host delete
to delete a host map.- Highlight the domain name mapping you want to delete.
- Enter Y to delete the mapping.