Use a config in your workload ΒΆ

This how-to guide shows you how to reference and use a config in your workload.

A config can be made available as environment variables or files, or both.

Prerequisites ΒΆ

  • You're part of a Nais team
  • You have previously created a config for your team
  • A Github repository where the Nais team has access
  • The repository contains a valid workload manifest (nais.yaml)

Expose config as environment variables ΒΆ

  1. Add a reference to the config in the workload's nais.yaml manifest.

    For a config named my-config, the manifest should contain these additional lines:

    nais.yaml
  2. Commit and push the changes to version control, and deploy your workload as usual.

  3. Each key-value pair is now available in your workload's runtime as an environment variable.

    For example, for a key named SOME_KEY:

    shell

Mount config as files ΒΆ

  1. Add a reference to the config in the workload's nais.yaml manifest.

    For a config named my-config, the manifest should contain these additional lines:

    nais.yaml
  2. Commit and push the changes to version control, and deploy your workload as usual.

  3. Each key-value pair is now available as a file at the specified mount path, e.g:

    shell

    For example, a key named some-key will be available as a file at the following path:

    shell