Start here
A guide to Runtime Conditions Profiles.
Runtime Conditions lets developers declare what an app needs to run, such as an API, a database, or a cache, in a machine-readable format. Start with a complete example, then see how a profile is written, how to generate one from your code with the rc CLI, and how a platform turns it into running infrastructure.
The short version
Here is the whole idea in six steps, using the example below.
- 1First, your app needs something.Maybe your app calls an HTTP API and a Redis cache.
- 2With RC: you declare it in your code.A few lines using a package we provide. They do nothing when your app runs.
- 3A tool reads your code.A profiler for Go, Java, Python, or TypeScript. Your app is never started.
- 4Out comes a profile, automatically.A YAML file with names like
TODOS_API_URLandREDIS_URL, and no passwords. - 5The platform team reads it.Now they know what to provide, with no guessing.
- 6And it just works.In the example below, Redis is created, the API is checked, and both URLs reach your app.
Example first
apiVersion: runtimeconditions.io/v1alpha1
kind: RuntimeConditionsProfile
metadata:
name: request-logger-http
workload:
uri: github.com/runtimeconditions/rc-demos/apps/request-logger-http
version: v0.1.0
extensions:
- https://runtimeconditions.io/extensions/rc/common-integrations:v1alpha2
- https://runtimeconditions.io/extensions/rc/env-configuration:v1alpha2
conditions:
- name: todos-api
kind: api
interface:
type: http
spec:
format: openapi
uri: catalog://api/default/todos-api
version: 1.0.0
operations:
- method: GET
path: /todos/{id}
configuration:
env:
- property: baseUrl
name: TODOS_API_URL
- name: request-cache
kind: cache
interface:
type: key_value
engine: redis
configuration:
alternatives:
- env:
- property: url
name: REDIS_URL
- env:
- property: hostname
name: REDIS_HOST
- property: port
name: REDIS_PORT
The profile names the workload, declares the extensions needed to interpret its vocabulary, and lists runtime Conditions. It does not contain service URLs, Redis hostnames, credentials, or target-environment choices.
Why this exists
The knowledge about what an app needs usually lives in one person's head. Here is what changes when it is written down once.
| Without a profile | With a Runtime Conditions Profile | |
|---|---|---|
| Where the needs live | A developer's head, a Slack thread, an old wiki page | One YAML file, written from declarations in your code |
| A new developer joins | Someone explains it all again, from memory | They read the profile and know what the app needs |
| The answer was in a chat | It scrolled away months ago, if anyone can find it | It lives with the code, in the same repository |
| The app changes | Someone has to remember to update the wiki | The declaration changes in the same commit as the code |
| Who works it out | A platform engineer, by hand, piece by piece | Tools read it |
| When a mistake shows up | After release, in front of real users | When the profile is checked, with a clear reason |
| The next environment (test, then production) | Work it out again, a little differently each time | Every environment reads the same file |
Read in order
First half: what the profile is
Read chapters 1-5 to understand Conditions, profile shape, profiler output, extension vocabulary and packages, and the rc CLI.
Second half: how it gets used
Read chapters 6-8 to understand platform adapters, the working Kratix demo, and where each source file lives.