Tyk
This example uses Tyk, an API gateway and management platform.
Tyk is used together with Redis to store API tokens and OAuth clients.
To run this example, follow these steps:
-
Install the
kraftCLI tool and a container runtime engine, for example Docker. -
Clone the
examplesrepository andcdinto theexamples/tyk/directory:
Code(bash)
Make sure to log into KraftCloud by setting your token and a metro close to you.
This guide uses fra (Frankfurt, 🇩🇪):
Code(bash)
When done, invoke the following command to deploy this app on KraftCloud:
Code(bash)
The output shows the Compose output:
Code(text)
To list information about the instances, use:
Code(bash)
Code(text)
The Tyk and Redis instances are named tyk-tyk and tyk-redis (as defined in the compose.yaml file).
Only the Tyk instance is available as a public service.
Its address is https://funky-pond-45usfkxx.fra.unikraft.app.
It's different for each run.
Use curl to query the Tyk instance on KraftCloud on the available address:
Code(bash)
Code(text)
When done, you can bring down the instances:
Code(bash)
Customize your app
To customize the Tyk app, you can update:
Kraftfile: the KraftCloud specificationDockerfile/rootfs/: the Tyk filesystem (in this case the configuration file/etc/tyk.conf)compose.yaml: the Compose specification
It's unlikely you will have to update the Kraftfile specification.
Update the contents of the rootfs/etc/tyk.conf file for a different configuration.
You can also update the Dockerfile in order to extend the Tyk filesystem with extra data files or configuration files.
The compose.yaml file can be update to assign different names, ports, network names or other Compose-specific configurations.
Learn more
Use the --help option for detailed information on using KraftCloud:
Code(bash)
Or visit the CLI Reference.