Guides
Box to box
Boxes find each other as <name>.kvbox; kvbox vm link lets one reach a port of another.
Boxes are closed to each other by default. To let an app box use a database box, link them:
kvbox new db --near api # on the same host as api
kvbox vm link api db --port 5432 # api may reach db's port 5432Inside api, the database is db.kvbox:5432:
kvbox exec api -- psql -h db.kvbox -U postgresNames
Every box resolves <name>.kvbox to the box of that name with the same owner, on the same host. An org's box of another slug is <name>.<slug>.kvbox, and resolves only once it is linked to you. A name is not access: without a link the connection is refused.
Names work in boxes made from base image v0.11.0 or later.
Links
kvbox vm link api db --port 5432 # one port per link; link again for another
kvbox vm links # every link: from, box, port
kvbox vm links db --json # [{from, box, port}]
kvbox vm unlink api db --port 5432 -y # open connections close too- A link is one way:
apireachesdb,dbdoes not reachapi. TCP only. - Nothing is published. The internet and other boxes still can't reach
db. dbseesapi's own address, so database access rules can name it.- The two boxes must be on the same host. If they aren't,
linksays so; make the new box with--near. - On a self-hosted server, a box made with
--localand a box made through a control plane can't be linked. - With
--org acme, the box being reached isacme's:kvbox vm link api db --org acme --port 5432. - A box other boxes link to never hibernates on its own: a connection would not wake it.
- Removing either box removes its links.