In this case, the instance name is ferretdb-rdj6z; 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:memcached-arkv7:27017
Then, on a separate console, you can use the mongosh client to connect to the server using the postgres username and the unikraft password configured above:
Current Mongosh Log ID: 660ad7329a710d16355bedf4Connecting to: mongodb://<credentials>@127.0.0.1/?authMechanism=PLAIN&directConnection=true&serverSelectionTimeoutMS=2000&appName=mongosh+2.1.1Using MongoDB: 7.0.42Using Mongosh: 2.1.1mongosh 2.2.2 is available for download: https://www.mongodb.com/try/download/shellFor mongosh info see: https://docs.mongodb.com/mongodb-shell/------ The server generated these startup warnings when booting 2024-04-01T15:48:02.365Z: Powered by FerretDB v1.21.0 and PostgreSQL 16.2 on x86_64-pc-linux-musl, compiled by gcc. 2024-04-01T15:48:02.365Z: Please star us on GitHub: https://github.com/FerretDB/FerretDB. 2024-04-01T15:48:02.365Z: The telemetry state is undecided. 2024-04-01T15:48:02.365Z: Read more about FerretDB telemetry and how to opt out at https://beacon.ferretdb.com.------test>
To disconnect, simply 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, ie, when a Postgre 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 PostgreSQL and FerretDB instances:
Code
kraft cloud instance list
Code
NAME FQDN STATE CREATED AT IMAGE MEMORY ARGS BOOT TIMEferretdb-rdj6z restless-resonance-jcc4ulc3.fra0.kraft.host running 11 minutes ago ferretdb@sha256:27c59539fa3b6b7... 512 MiB /usr/bin/ferretdb 37.11 mspostgres running 14 minutes ago postgres@sha256:c1f1100176be97f... 1.0 GiB wrapper.sh docker-entrypoint.sh postgres 593.15 ms
When done, you can remove the FerretDB and the Postgres instances:
There are several ways in which you can customize your deployment.
An obvious one is to use a different database password when starting PostgreSQL.
For that you use a different POSTGRES_PASSWORD environment variable when starting the PosgreSQL instance.
Another one is to use volumes with PostgreSQL for persistence.
For that, you would first create a volume: