This guide shows you how to use Memcached, an in-memory key-value store for small chunks of arbitrary data (strings, objects) from results of database calls, API calls, or page rendering.
To run it, follow these steps:
Install the kraft CLI tool and a container runtime engine, e.g. Docker.
Clone the examples repository and cd into the examples/memcached/ directory:
When done, invoke the following command to deploy this application on KraftCloud:
The output shows the instance URL and other details:
In this case, the instance name is memcached-arkv7 and the service group is weathered-smoke-hehsdinv.
They are different for each run.
To test the deployment, first forward the port with the kraft cloud tunnel command. Be sure to use the service group returned by the kraft cloud deploy command:
Now, on a separate console, run the following commands to test that it works (you should see output when incrementing):
To exit telnet run:
To disconnect, simply kill the tunnel command with ctrl-C
At any point in time, you can list information about the instance:
When done, you can remove the instance:
Customize your Application
To customize the application, update the files in the repository, listed below:
Kraftfile: the KraftCloud specification, including command-line arguments
Dockerfile: In case you need to add files to your instanceβs rootfs