Last reviewed: 2026-07-28

Configuring your app with environment variables

We recommend passing configuration to your app as environment variables, defined in the env block of your values.yaml.

Table of contents

Plain values

The simplest form is a literal name/value pair:

env:
  - name: ASPNETCORE_ENVIRONMENT
    value: "Staging"
  - name: ASPNETCORE_HTTP_PORTS
    value: "8080"
  - name: MyDependencyService__apiBasePath
    value: "http://mydependency-service.my-namespace.svc.cluster.local:8080"

Nested configuration keys (as used by ASP.NET Core’s IConfiguration, for example) are expressed with a double underscore, as in MyDependencyService__apiBasePath above.

Larger configuration blocks

For configuration that doesn’t fit naturally as individual environment variables — a whole appsettings.json overlay, a logging config file, and the like — use configMaps instead and mount the result as a file:

configMaps:
  - name: myapp-config
    data:
      appsettings.override.json: |
        {
          "Logging": {
            "LogLevel": {
              "Default": "Information"
            }
          }
        }

volumes:
  - name: config-volume
    configMap:
      name: myapp-config

volumeMounts:
  - name: config-volume
    mountPath: /app/config

Where to go next

If you’re unsure which approach fits your case, ask on Slack — the IDP team is happy to help.