Skip to content
Reference

Variables

The rules a variable must follow, what a reference looks like, what each resource exposes, and which values are secret.

Environment variables explains how variables work. These are the rules.

Names and values

RuleValue
Name pattern[A-Za-z_][A-Za-z0-9_]*
Name lengthAt most 128 characters.
Value sizeAt most 32 KiB.
Reserved namesPORT, K_SERVICE, K_REVISION, K_CONFIGURATION. Set by the runtime; refused as a variable name on a service or an environment.
UniquenessOne value per name per service, and one per name per environment. A service's own value wins over the environment's.

Where a variable can be set

ScopeSet onRead byValues allowed
ServiceThe service's Variables tabThat serviceLiterals and references
EnvironmentThe environment's Variables tabEvery web service in the environmentLiterals only

References

Syntax${{ <resource>.<VARIABLE> }}, for example ${{ database.DATABASE_URL }}
TargetA resource in the same environment as the service. Never another environment, never the service itself.
ResolvedWhen Kuppit prepares a deployment, from the target's state at that moment. Never stored.
SecrecyFollows the referenced variable, whatever the referencing variable is named.

What each resource exposes

ResourceVariableSecret
PostgreSQLPGHOST
PGPORT
PGUSER
PGPASSWORDYes
PGDATABASE
DATABASE_URLYes
Web serviceNothing

The shape of each value is on reaching a database.

Secrets

MarkingPer variable, on creation or afterwards.
Reading backNever. The dashboard shows the name only.
ChangingEnter a complete replacement; saving overwrites the previous value for future deployments.
In logsThe service's secret values are redacted from every log line before it is shown.
Copied to a previewOnly when Give previews the production secrets is on for the project.
Copied to a named environmentOnly the ones ticked by name when the environment is created.

When a change takes effect

At the next deployment, never on the running one. The service shows Runtime configuration has changed until it is redeployed. A rollback restores the variables the earlier deployment ran with.

Was this page helpful?