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, for example Docker.

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

Code(bash)
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. This guide uses fra (Frankfurt, ๐Ÿ‡ฉ๐Ÿ‡ช):

Code(bash)
# Set Unikraft Cloud access token export UKC_TOKEN=token # Set metro to Frankfurt, DE export UKC_METRO=fra

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

Code(bash)
kraft cloud deploy -p 443:9090 .

The output shows the instance address and other details:

Code(ansi)
[โ—] Deployed successfully! โ”‚ โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ name: skipper-mx4ai โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ uuid: 34e3d740-c2b0-4644-b7e1-647350f688dc โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ state: running โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ url: https://aged-sea-o7d3c42s.fra.unikraft.app โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ 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 address is https://aged-sea-o7d3c42s.fra.unikraft.app. They're different for each run.

Use curl to query the Unikraft Cloud instance of Skipper.

Code(bash)
curl https://aged-sea-o7d3c42s.fra.unikraft.app
Code(text)
Hello, world from Skipper on Unikraft!

You can list information about the instance by running:

Code(bash)
kraft cloud instance list
Code(text)
NAME FQDN STATE CREATED AT IMAGE MEMORY ARGS BOOT TIME skipper-mx4ai aged-sea-o7d3c42s.fra.unikraft.app running 1 minute ago skipper@sha256:5483eaf... 128 MiB /usr/bin/skipper -address :9090 -routes-f... 43709us

When done, you can remove the instance:

Code(bash)
kraft cloud instance remove skipper-mx4ai

Customize your app

To customize Skipper you can change the example.eskip configuration file.

Learn more

Use the --help option for detailed information on using Unikraft Cloud:

Code(bash)
kraft cloud --help

Or visit the CLI Reference.

Last modified on