Zudoku
Guides

Skipper

This example uses Skipper, an HTTP router and reverse proxy for service composition

To run this example, follow these steps:

  1. Install the kraft CLI tool and a container runtime engine, e.g. Docker.

  2. Clone the examples repository and cd into the examples/skipper/ directory:

TerminalCode
git clone https://github.com/kraftcloud/examples cd 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:

TerminalCode
# Set Unikraft Cloud access token export UKC_TOKEN=token # Set metro to Frankfurt, DE export UKC_METRO=fra0

When done, invoke the following command to deploy this application on Unikraft Cloud:

TerminalCode
kraft cloud deploy -p 443:9090 .

The output shows the instance URL and other details:

TerminalCode
[โ—] 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.

TerminalCode
curl https://aged-sea-o7d3c42s.fra0.kraft.host
Code
Hello, world from Skipper on Unikraft!

At any point in time, you can list information about the instance:

TerminalCode
kraft cloud instance list
Code
NAME FQDN STATE CREATED AT IMAGE MEMORY ARGS BOOT TIME skipper-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:

TerminalCode
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:

TerminalCode
kraft cloud --help

Or visit the CLI Reference.

Last modified on