Skip to main content
A connection tells Inframan that one service depends on something else: another service, a PostgreSQL or Redis add-on, or a Storage bucket. You choose the environment variable’s name, and Inframan fills in its value every time it deploys. Use a connection, never a hard-coded value in env, for any address inside the platform. Addresses change between releases, and passwords rotate. Connections keep up with both.
inframan.yaml

What you can connect to

A service slug always names the application as well as the service, because two applications can each have a service called api. The target must be a web service.

Versions stay in step

Every release deploys each service as a new version. When web connects to api in the same application, web receives the address of the api version that shipped in the same release, not whichever version happens to be getting traffic. This matters when you split traffic between revisions. A user’s request may land on the old or the new revision at the edge, but once it’s inside, every call between your services stays within that revision. Version 41 of web never calls version 42 of api by accident. The URL has no port, because it points at port 80 of the version’s internal service. If your code needs a host and port, parse them from the URL.

Connections set the deploy order

A service is deployed after everything it connects to. In the example above, api is deployed before web, and the add-ons are ready before api. Two services that connect to each other are refused, because neither could be deployed first. To fix a cycle, split out the side that’s called back into its own service, built from the same image if that’s simpler.

Passwords stay out of your spec

The value of an add-on connection is read from a Kubernetes Secret when the pod starts. It’s never written into the workload’s spec, so someone who can read your deployment can’t read your database password from it. If you set a plain variable with the same name as a connection, the connection wins and the plain variable is dropped.

Add a connection in the console

On a service’s Environment tab, add a connection and pick its target from the services and add-ons on the infrastructure. Like other environment edits, it’s proposed as a pull request to inframan.yaml.