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.

  1. 1
    First, your app needs something.Maybe your app calls an HTTP API and a Redis cache.
  2. 2
    With RC: you declare it in your code.A few lines using a package we provide. They do nothing when your app runs.
  3. 3
    A tool reads your code.A profiler for Go, Java, Python, or TypeScript. Your app is never started.
  4. 4
    Out comes a profile, automatically.A YAML file with names like TODOS_API_URL and REDIS_URL, and no passwords.
  5. 5
    The platform team reads it.Now they know what to provide, with no guessing.
  6. 6
    And it just works.In the example below, Redis is created, the API is checked, and both URLs reach your app.

Example first

A complete profile document Where this comes from
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 profileWith a Runtime Conditions Profile
Where the needs liveA developer's head, a Slack thread, an old wiki pageOne YAML file, written from declarations in your code
A new developer joinsSomeone explains it all again, from memoryThey read the profile and know what the app needs
The answer was in a chatIt scrolled away months ago, if anyone can find itIt lives with the code, in the same repository
The app changesSomeone has to remember to update the wikiThe declaration changes in the same commit as the code
Who works it outA platform engineer, by hand, piece by pieceTools read it
When a mistake shows upAfter release, in front of real usersWhen the profile is checked, with a clear reason
The next environment (test, then production)Work it out again, a little differently each timeEvery 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.