In this case, the instance name is mongodb-6tiuu; it's different for each run.
To test the deployment, first forward the port with the kraft cloud tunnel command:
Code
kraft cloud tunnel 27017:mongodb-6tiuu:27017
Then, on a separate console, you can use the mongosh client to connect to the server:
Code
mongosh mongodb://localhost
You should see output similar to:
Code
Current Mongosh Log ID: 65d75b96310f70e63565e0f1Connecting to: mongodb://localhost/?directConnection=true&serverSelectionTimeoutMS=2000&appName=mongosh+2.1.5(node:79750) [DEP0040] DeprecationWarning: The `punycode` module is deprecated. Please use a userland alternative instead.(Use `node --trace-deprecation ...` to show where the warning was created)Using MongoDB: 6.0.13Using Mongosh: 2.1.5For mongosh info see: https://docs.mongodb.com/mongodb-shell/To help improve our products, anonymous usage data is collected and sent to MongoDB periodically (https://www.mongodb.com/legal/privacy-policy).You can opt-out by running the disableTelemetry() command.test>
To disconnect, kill the tunnel command with Ctrl+c.
We use kraft cloud tunnel only when a service doesn't support TLS and is not HTTP-based (we use TLS/SNI to determine the correct instance to send traffic to).
Also note that tunnel command is not needed when connecting via an instance's private IP/FQDN, i.e., when a MongoDB instance is used as a backend to another instance that acts as a frontend and which does support TLS.
At any point in time, you can list information about the instance:
Code
kraft cloud instance list
Code
NAME FQDN STATE CREATED AT IMAGE MEMORY ARGS BOOT TIMEmongodb-6tiuu bold-brook-khkwv7of.fra0.kraft... running 20 minutes ago mongodb@sha256:e6ff5153f106e2... 1.0 GiB /usr/bin/mongod --bind_ip_all... 82410us
When done, you can remove the instance:
Code
kraft cloud instance remove mongodb-6tiuu
Customize your Application
To customize the application, update the files in the repository, listed below:
Kraftfile: the Unikraft Cloud specification, including command-line arguments
Dockerfile: In case you need to add files to your instance's rootfs
Learn More
Use the --help option for detailed information on using Unikraft Cloud: