Deploy a Skipper Proxy
This example uses Skipper
, an HTTP router and reverse proxy for service composition
To run this example, follow these steps:
-
Install the
kraft
CLI tool and a container runtime engine, e.g. Docker. -
Clone the
examples
repository andcd
into theexamples/skipper/
directory:
git clone https://github.com/kraftcloud/examplescd examples/skipper/
Make sure to log into Unikraft Cloud by setting your token and a metro close to you.
We use fra0
(Frankfurt, 🇩🇪) in this guide:
# Set Unikraft Cloud access tokenexport UKC_TOKEN=token# Set metro to Frankfurt, DEexport UKC_METRO=fra0
When done, invoke the following command to deploy this application on Unikraft Cloud:
kraft cloud deploy -p 443:9090 .
The output shows the instance URL and other details:
[●] Deployed successfully! │ ├────────── name: skipper-mx4ai ├────────── uuid: 34e3d740-c2b0-4644-b7e1-647350f688dc ├───────── state: running ├─────────── url: https://aged-sea-o7d3c42s.fra0.kraft.host ├───────── image: skipper@sha256:5483eaf3612cca2116ceaab9be42557686324f1d30337ae15d0495eef63d0386 ├───── boot time: 43.71 ms ├──────── memory: 128 MiB ├─────── service: aged-sea-o7d3c42s ├── private fqdn: skipper-mx4ai.internal ├──── private ip: 172.16.6.4 └────────── args: /usr/bin/skipper -address :9090 -routes-file /etc/skipper/example.eskip
In this case, the instance name is skipper-mx4ai
and the URL is https://aged-sea-o7d3c42s.fra0.kraft.host
.
They are different for each run.
Use curl
to query the Unikraft Cloud instance of Skipper.
curl https://aged-sea-o7d3c42s.fra0.kraft.host
Hello, world from Skipper on Unikraft!
At any point in time, you can list information about the instance:
kraft cloud instance list
NAME FQDN STATE CREATED AT IMAGE MEMORY ARGS BOOT TIMEskipper-mx4ai aged-sea-o7d3c42s.fra0.kraft.host running 1 minute ago skipper@sha256:5483eaf... 128 MiB /usr/bin/skipper -address :9090 -routes-f... 43709us
When done, you can remove the instance:
kraft cloud instance remove skipper-mx4ai
Customize your Application
To customize Skipper you can modify the example.eskip
configuration file.
Learn More
Use the --help
option for detailed information on using Unikraft Cloud:
kraft cloud --help
Or visit the CLI Reference.