Environment Variables
Configure environment variables and link secrets to your services.
Environment variables let you pass configuration to your services without baking values into your Docker image.
Setting environment variables
- Go to your service's Environment Variables tab
- Click Add Variable
- Enter a key and value
- Save and redeploy
Changes to environment variables require a redeployment to take effect.
Linking secrets
Instead of entering a plain text value, you can reference a key from a secret:
- Add a new environment variable
- Choose Link from secret
- Select the secret and the specific key
- Save and redeploy
This is especially useful for database credentials. When you create a database, SMLL auto-generates a secret with connection details. You can link DATABASE_URL from that secret directly into your service.
Example
| Env var | Source | Secret key |
|---|---|---|
DATABASE_URL | my-db credentials | DATABASE_URL |
API_KEY | my-api-secret | API_KEY |
PORT | Plain value | — |
How it works
- Plain values are stored as a Kubernetes ConfigMap
- Secret references are mounted from Kubernetes Secrets using
secretKeyRef
Both are injected into your container at startup. Your application reads them like any other environment variable.
Best practices
- Use secrets for sensitive values (API keys, passwords, tokens)
- Use plain environment variables for non-sensitive configuration (ports, feature flags, log levels)
- Reference the auto-generated database secret instead of copying credentials manually