Where the values live
Camel 4 · 3:56
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 key that the integration's own file defines isn't overridden.
What it covers
- A variable that doesn't reach the integration while its file defines the key
- Setting a secret from standard input, stored encrypted and never printed
- Version 0.1.4 reading the variable, and an Authorization header from the secret
- A changed value waiting for the next start, applied with
weikio restart - One 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:02hello has run since video one, and everything it reads sits in its files.
- 0:07This video moves those values out, and sets a secret without printing it.
- 0:15hello runs in devtest, on the agent dev, and logs a line every three seconds.
- 0:20The failing step of video three is gone;
- 0:23its version stays, because a version is never changed.
- 0:27The message the route logs sits in application.properties, inside the folder.
- 0:32Changing it means editing the file and publishing a new version.
- 0:39One rule decides the keys the installation owns.
- 0:42A key the file defines belongs to the integration;
- 0:46the installation's value reaches only a key the file does not define.
- 0:52The message is first set as a variable, while the file still defines it.
- 0:57The output answers on a note line: the value does not reach the integration.
- 1:02The file wins, and the log line is unchanged.
- 1:06The value is stored, waiting for a version that does not define the key.
- 1:13A secret is set the same way, for the same environment.
- 1:17Its value reaches the command on standard input, and the terminal never shows it.
- 1:22The hub stores it encrypted, and no listing ever prints it back.
- 1:26It is set before any version reads it, so the next start finds it.
- 1:33The edit takes message= out of application.properties.
- 1:38One line joins the route: an Authorization header that reads the secret.
- 1:43The header is never logged; video five sends it.
- 1:46run publishes and deploys in one command,
- 1:49and version 0.1.4 takes both values at its start.
- 1:56The log line now reads the variable's value.
- 2:00A variable and a secret reach the route the same way, as a placeholder of the name.
- 2:10A new value for the variable changes nothing yet.
- 2:13The output lists hello as the deployment that takes the value at its next start.
- 2:18No JVM, the Java process an integration runs in, was restarted:
- 2:24one shared value could restart many integrations at once.
- 2:28weikio restart stops hello and starts it again.
- 2:34The log line now reads the new value.
- 2:41One command lists everything a deployment receives, and where each value comes from.
- 2:46The message resolves to the variable; the secret shows only a masked cell.
- 2:52The admin UI shows the same values, per environment.
- 3:00The admin UI's own variables and secrets section shows the same two values.
- 3:05The integration's page shows what it resolves, with the level each value comes from.
- 3:11The secret shows as set, with a Reveal button beside it; the value is never shown.
- 3:18The project's page holds the project's shared values, one column per environment.
- 3:27Here is the whole picture.
- 3:29The file keeps the keys it defines; the installation owns the rest.
- 3:34The variable and the secret wait in the hub, per environment.
- 3:37Every start of the JVM resolves them, with the file last.
- 3:42Video five connects hello to another system, and sends the header.
Next in this track
Camel 5 · 3:59 Connecting to another system Watched