Domains
In this guide we will show you how to deploy an app on Unikraft Cloud (UKC) and
link it to a domain name you own (e.g., mydomain.com
).
Configuring your External DNS Provider
Before we can launch an app, you need to ensure that you have configured things correctly with your DNS provider. There are two cases here:
-
For a subdomain you own such as docs.mydomain.com, a CNAME is enough. In this case, you can just add a
CNAME
record with your sub-domain (docs
) as the host and point the record to UKC's metro e.g.,fra0.kraft.host
. -
For an apex domain (e.g., mydomain.com), add an ALIAS, ANAME, or flattened CNAME record. Depending on your provider, leave the host field empty or enter @. Point the record to UKC's metro e.g.,
fra0.kraft.host
. If your DNS provider does not support ALIAS, ANAME, or flattened CNAME records, add an A record and point the record to the IP address of UKC's metro
You can find information about the UKC metros available to you, as well as their
IP addresses, via the cmd kraft cloud metro ls
.
You can have multiple domains for the same service. In addition, UKC supports wildcarded domains. Please refer to the certificates API) for more info.
Launching your App
Let's assume we want to use NGINX as our app:
Make sure to log into Unikraft Cloud by setting your token and a
metro close to you. We use fra0
(Frankfurt, 🇩🇪) in this
guide:
With this in place, we'll use the kraft cloud deploy
command to create an
instance of the web server and to link it to a custom name; the latter is done
through the -d
flag:
The resulting output of the deploy
command should be similar to:
In case you're curious, when issuing the -d
flag Unikraft Cloud will request a
new certificate from Let's Encrypt.
It can take a few seconds before the certificate is issued.
If there are misconfigurations or DNS changes that your external DNS provider has not propagated yet, this can take much longer.
You can check the validation status of the certificate with kraft cloud cert get
(more on this command below).
Also note that the UKC controller will retry the operation at these intervals: [1,5,10,30] minutes, and then [1,6,12,24] hours (and then fail).
You're all set! You can test your deployment with curl
:
Code