Skip to content
Weik.ioDocs
2026.2
Try Weik.io

Variables and secrets

Weik.io 2026.2

Set the values that differ between environments as variables and secrets, which routes use as Camel properties and each deployment gets at its next start. Product page · Video

Watch: Where the values live, 4:37

The video moves a value into a variable and an API key into a secret, and shows what reaches the running integration.

On this page

Put a value in a variable or a secret when it differs between environments or may change without a new version. A route uses both as ordinary Camel properties, such as {{erp-url}} and {{erp-api-key}}, so the same version runs in devtest and production with each environment’s values.

Defaults and environment values#

A variable without an environment is the default, and one with an environment overrides it there:

finance/variables/erp-url.yaml
apiVersion: weik.io/v1
kind: variable
metadata: { name: erp-url, project: finance }
spec: { value: https://erp-test.example.internal }
finance/production/variables/erp-url.yaml
apiVersion: weik.io/v1
kind: variable
metadata: { name: erp-url, project: finance, environment: production }
spec: { value: https://erp.example.internal }

Each value is a separate document, because permissions are given per document. A developer allowed to edit devtest’s values never sees production’s.

Terminal
$ weikio apply -f ./finance/variables/ -f ./finance/production/variables/ --env production
You see
Target: https://hub.example, project finance (from finance/project.yaml), environment production (--env)
variable finance/erp-url unchanged
variable production/finance/erp-url updated
variable production/finance/page-size created
2 deployments take the new value at their next start: production/finance/erp-invoice-export (running), production/finance/nightly-payroll (stopped)
  restart the running one now with:   weikio restart finance/erp-invoice-export --env production

Secrets#

A secret has the same shape as a variable, but you set its value with the CLI so it never sits in Git. On a terminal the command asks for the value without showing what you type:

Terminal
$ weikio secret set finance/erp-api-key --env devtest
You see
Target: https://hub.example, project finance (argument), environment devtest (--env)
Value:
secret finance/erp-api-key set for devtest (revision 4192)
1 deployment takes the new value at its next start:
  devtest   finance/erp-invoice-export   (started)

To restart it now, run:
  weikio secret set finance/erp-api-key --env devtest --restart

In a pipeline, pass the value on standard input:

Terminal
$ printf '%s' "$ERP_PROD_KEY" | weikio secret set finance/erp-api-key --env production

--from-file sets a value from a file, and --as-file stores a whole file, such as a certificate, up to 128 KiB.

Weik.io encrypts every secret with AES-256-GCM, under a master key that is kept in a file on each backend host and never in the message server or in a backup. An integration gets its secrets in a properties file that only the agent’s user can read, not on a command line.

/settings/projects/finance/variables
The variables of the finance project with the ERP address of devtest and production, the archive bucket and the supplier folder, and the secret erp-api-key set in both environmentsThe variables of the finance project with the ERP address of devtest and production, the archive bucket and the supplier folder, and the secret erp-api-key set in both environmentsThe variables of the finance project with the ERP address of devtest and production, the archive bucket and the supplier folder, and the secret erp-api-key set in both environmentsThe variables of the finance project with the ERP address of devtest and production, the archive bucket and the supplier folder, and the secret erp-api-key set in both environments
A project's variables and secrets have a default and a value for each environment. For a secret, you see where it's set but not its value.

Revealing a secret needs a separate permission. The audit log records every reveal.

When an environment has reveals switched off, a platform administrator is refused too:

Terminal
$ weikio secret reveal finance/erp-api-key --env production
You see
error: Secret reveals aren't allowed in production.
       Ask a platform admin to run:
         weikio env set production --allow-secret-reveal=true

A deploy that needs a secret with no value in the environment fails before anything starts, and the error gives the command that sets the secret.

Which value wins#

When the same name has several values, the most specific one wins:

This value Wins over
A value set for the integration The project’s value
A secret A variable
An environment’s value The default

A key defined in the integration’s application.properties belongs to the integration. A project value doesn’t replace it, but a value set for that integration or a deployment override does. To see what a deployment gets and where each value comes from, add --resolved:

Terminal
$ weikio get variables --env production --resolved --integration erp-invoice-export
You see
NAME          VALUE                            SOURCE
erp-url       https://erp.example.internal     variable:production
page-size     10                               deployment-override
erp-api-key   ********                         secret:production

A value for one integration#

One integration can use ConnectionString for PostgreSQL while another uses it for MongoDB. Set each one’s value with --integration, and neither gets the other’s:

Terminal
$ weikio secret set finance/ConnectionString --integration orders-postgres --env production

Names follow Camel’s spelling, so {{erp.url}} and {{AWS_ACCESS_KEY}} work. {{name:default}} and {{?name}} work as they do in Camel. When Weik.io has no value for the name, the first gets the default after the colon and the second gets nothing.

A changed value and restarts#

A changed variable or secret reaches each deployment that uses it at its next start. Weik.io restarts nothing by itself, because one shared value can feed many integrations, and an edit must not restart them all across production in the middle of a transfer. The command lists the deployments the value reaches:

Terminal
$ weikio variable set finance/page-size 200
You see
Target: https://hub.example, project finance (argument), default environment (no --env)
variable finance/page-size updated (revision 4195)
2 deployments take the new value at their next start:
  devtest      finance/erp-invoice-export   (started)
  production   finance/erp-invoice-export   (started)

To restart them now, run:
  weikio variable set finance/page-size 200 --restart

--restart restarts them for you, and asks first when one of them runs in production:

Terminal
$ weikio variable set finance/page-size 200 --restart
You see
Target: https://hub.example, project finance (argument), default environment (no --env)
Deployments that will restart:
  devtest      finance/erp-invoice-export
  production   finance/erp-invoice-export
'production' is a production environment.
Continue? [y/N] y
variable finance/page-size updated (revision 4196)
deployment devtest/finance/erp-invoice-export restarted
deployment production/finance/erp-invoice-export restarted

In the admin UI, the integration’s Variables and secrets section lists the names its routes use and marks each one that still needs a value.

Sign in to the live demo

Sign in with the shared viewer account, which can open every screen of the example projects and can't change anything.

E-mail
viewer@demo.weik.io
Password
try-weikio-live-demo
Open the live demo