Where the values live
Camel 4 · 4:37
Variables and secrets give an integration its values per environment, kept out of its files, and a new value takes effect at the next start. A project value doesn't override a key the file itself defines.
This part of the video couldn't be loaded.
What it covers
- A variable that doesn't reach the integration while its file defines the key
- Setting a secret from standard input, kept sealed in Weik.io and never printed
- Version 0.1.4 reading the variable, and a header from the secret
- A changed value waiting for the next start, applied with
weikio restart - A listing of what a deployment receives and where each value comes from
- Variables and secrets on the integration's and the project's pages in the admin UI
Commands in this video
Terminal
$ weikio variable set sandbox/message 'hello from devtest' --env devtest
$ printf '%s' "$KEY" | weikio secret set sandbox/erp-api-key --env devtest
$ weikio run ./hello
$ weikio variable set sandbox/message 'hello again' --env devtest
$ weikio restart sandbox/hello
$ weikio get variables --env devtest --resolved --integration helloTranscript
- 0:02An integration reads values as it runs: here a greeting, later an API key.
- 0:09This video shows where those values live and what reaches a running copy.
- 0:17The hello folder on your machine holds the integration sandbox/hello:
- 0:23a route file, a properties file, and a manifest.
- 0:27Your Weik.io installation keeps the published versions,
- 0:30each built once and then never changed.
- 0:33The latest is 0.1.3.
- 0:36The deployment runs in devtest, on agent dev.
- 0:40The integration runs as its own Java process, started from its deployment.
- 0:45The devtest deployment runs version 0.1.3.
- 0:50The route fires every few seconds and logs a greeting,
- 0:53whose text comes from the folder's application.properties.
- 0:59In the route file, the body is a placeholder: the name message in braces.
- 1:07The Weik.io CLI writes the greeting as the project's value for message in devtest,
- 1:13in your Weik.io installation.
- 1:15The terminal answers that the value won't reach the deployed hello.
- 1:19The project keeps the value in Weik.io as a variable.
- 1:22The deployed hello defines message in its application.properties,
- 1:27so that key stays the integration's.
- 1:32The API key goes in as a secret.
- 1:35printf feeds the key to weikio secret set sandbox/erp-api-key in devtest,
- 1:44so the key never appears in the command line.
- 1:46The CLI never echoes the value back.
- 1:49Weik.io keeps a secret's value sealed,
- 1:52then delivers it only at the start of the deployments allowed to receive it.
- 1:59The message line in application.properties is emptied.
- 2:04The route gains a step that sets a header from a placeholder naming erp-api-key,
- 2:10and the value fills in when the integration runs.
- 2:14weikio run on the hello folder uploads, builds, deploys, and follows the log.
- 2:20Control-C stops the following, not the integration.
- 2:26The build is 0.1.4, and the deployment follows latest.
- 2:31The agent stops the old process and starts a new one.
- 2:35The route takes message from the project, the header from the sealed key.
- 2:42The command sets message again, and the CLI lists the deployments it reaches.
- 2:47Nothing running is touched: the new value waits for the next start,
- 2:51because one shared value can feed many integrations.
- 2:55The reply also shows how to restart now.
- 2:58weikio restart sandbox/hello asks nothing,
- 3:04because devtest isn't a production environment.
- 3:09The restarted process resolves its names again,
- 3:13and the log under the agent changes with them.
- 3:18weikio get variables for devtest, resolved,
- 3:22prints what the deployment receives at a start.
- 3:25Each row gives the value's name and its level.
- 3:28A secret's value stays masked and the variable's value is shown.
- 3:37The same view continues in the admin UI, on the integration's page.
- 3:41Each row carries a tag naming its level, here the project's devtest value.
- 3:47The secret's row says the value is set and shows nothing.
- 3:51Reveal needs the environment's permission:
- 3:54devtest grants it, production ships without.
- 3:57The project's page keeps both values one level up,
- 4:01as the project's variables and secrets.
- 4:07Three places decide what the running integration works with.
- 4:11The folder keeps the route and its properties file.
- 4:14Weik.io keeps the values: the variable, and the secret under its lock.
- 4:19A value arrives at a start.
- 4:22Each start resolves the route's names against the levels,
- 4:25and that is what the integration runs on.
Next in this track
Camel 5 · 3:59 Connecting to another system Watched