Variable Interpolation
furyctl
allows to specify interpolated strings inside a furyctl.yaml
configuration file.
Path interpolation
Intended for fields where you should specify a path to a folder or a file (e.g.: spec.kubernetes.ssh.keyPath
). It will be replaced by the absolute path as computed from the current working directory.
Format: "{path://<relative-path>}"
Example:
...
spec:
kubernetes:
ssh:
keyPath: "{path://./ssh-key}"
...
Assuming you are running furyctl
from /home/user/projects/test
, the "{path://./ssh-key}"
string will be replaced with /home/user/projects/test/ssh-key
.
Be mindful about newlines at the end of the interpolated files: they will be part of the interpolation and can cause issues.
This is especially true for random strings generated with the commandline. For example, if your command uses echo
to print a string, use echo -n
to avoid printing a newline.
File interpolation
Replaces the interpolation string with the contents of a specified file. Useful for fields where you could have a file in your local filesystem that holds the required data, for example spec.distribution.modules.ingress.nginx.tls.secret.cert
. To locate the file, furyctl
will first convert the specified path to an absolute one (if needed).
Format: "{file://<path-to-file>}"
Example:
...
spec:
distribution:
modules:
ingress:
nginx:
tls:
secret:
cert: "{file://relative/path/to/ssl.crt}"
key: "{file://relative/path/to/ssl.key}"
ca: "{file://relative/path/to/ssl.ca}"
...
Assuming you are running furyctl
from /home/user/projects/test
, the cert
, key
and ca
values will be replaced with /home/user/projects/test/relative/path/to/ssl.{crt|key|ca}
.
Environment interpolation
Replaces the interpolation string with the value of the specified environment variable. Useful to specify secrets that you may not want to store inside plaintext files.
Format: "{env://<env-variable-name>}"
Example:
...
spec:
distribution:
modules:
auth:
pomerium:
secrets:
COOKIE_SECRET: "{env://POMERIUM_COOKIE_SECRET}"
IDP_CLIENT_SECRET: "{env://POMERIUM_IDP_CLIENT_SECRET}"
SHARED_SECRET: "{env://POMERIUM_IDP_CLIENT_SECRET}"
SIGNING_KEY: "{env://POMERIUM_IDP_CLIENT_SECRET}"
...
The strings in the above example will be replaced with the value of the specified environment variables.