Environment variables
This page summarizes all environment variables that are used by Nyl.
General
NYL_ARGS
– Additional command-line arguments to append to the Nyl invocation. Use with care, as options accepted by a parent command are not accepted in a subcommand, and these arguments are only ever append to the argument list.NYL_LOG_LEVEL
– The log level to use if--log-level
is not specified. Defaults toinfo
. Used by:nyl
.NYL_PROFILE
– The name of the profile to use as defined in the closestnyl-profiles.yaml
ornyl-project.yaml
configuration file. Used by:nyl profile
,nyl template
,nyl tun
.NYL_SECRETS
– The name of the secrets provider to use as defined in the closestnyl-secrets.yaml
ornyl-project.yaml
configuration file. Used by:nyl secrets
,nyl template
.NYL_STATE_DIR
– The directory where Nyl stores its state, such as current profile data, which may include fetched Kubeconfig file. Defaults to.nyl
relative to thenyl-project.yaml
or the current working directory. Used by:nyl profile
,nyl template
,nyl tun
.NYL_CACHE_DIR
– The directory where Nyl stores its cache, such as downloaded Helm charts and cloned repositories. Defaults tocache/
relative to theNYL_STATE_DIR
. Used bynyl template
.NYL_TEMPLATE_JOBS
– The maximum number of jobs to use for parallel evaluation of Nyl inline resources when runningnyl template
. If not set, and not specified with the-j, --jobs
option, an adequate number of jobs will be selected automatically.
Build-environment variables
The following variables are supported for they are provided by [ArgoCD as Build Environment Variables]1.
KUBE_VERSION
– The version of the Kubernetes cluster. If this is not set, Nyl will try to query the Kubernetes API server to determine the version. When used as an ArgoCD plugin, this variable is usually available 1. Used by:nyl template
.KUBE_API_VERSIONS
– A comma-separated list of all available API versions in the cluster. If this is not set, Nyl will try to query the Kubernetes API server to determine the versions. When used as an ArgoCD plugin, this variable is usually available 1. Used by:nyl template
.
Plugin variables
ArgoCD permits passing environment variables to CustomManagementPlugins. These get prefixed with
ARGOCD_ENV
to ensure that only specifically supported variables can be set. The following such variables are supported by Nyl:
ARGOCD_ENV_NYL_PROFILE
– Same asNYL_PROFILE
, only that the profile's connection details will be ignored. This should be used to pass the profile name to the Nyl plugin, as there is no way for it to automatically understand what profile to use if thedefault
profile does not apply. This variable is only recognized by thenyl template
command. TheNYL_PROFILE
variable takes precedence.ARGOCD_ENV_NYL_ARGS
– Same asNYL_ARGS
, but is taken into account after.ARGOCD_ENV_NYL_CMP_TEMPLATE_INPUT
— This variable is only recognized bynyl template
when the only positional argument it receives is.
(i.e. the current working directory). The variable should be a comma-separated list of filenames that should be treated as if the files were passed as arguments tonyl template
instead. This is used for the Nyl ArgoCD plugin to allow specifying exactly which files should be templated as part of an ArgoCD application.
Daemon mode
NYL_DAEMON_LOG_STDERR
– If set to1
, the daemon in client mode will forward stderr output of the template operation to the CMP plugin's stderr output. This may be useful for debugging purposes, but the same output can also be inspected in the daemon container's logs. This is disabled by default to not show the stderr output in the error message in the ArgoCD Web UI when the plugin fails.NYL_DAEMON_SOCK
– This variable is only used by the ArgoCD CMPplugin.yaml
. If set, it tells the plugin to use thenyl-daemon
in client mode instead of runningnyl template
directly and connect to the Nyl daemon using a Unix socket as specified in the variable value.
Other
NYL_PYROSCOPE_URL
– The Pyroscope server URL to use for profiling, optionally with basic auth credentials in the formathttp://username:password@host:port
. The application name may be specified with?application_name=name
and the tenant ID with?tenant_id=id
. The application name and tenant ID are optional. The name defaults tonyl
, while the tenant ID defaults to no value. Any additional parameters are used as tags.NYL_PYROSCOPE_APPLICATION_NAME
– If set, it takes priority over the?application_name
specified in theNYL_PYROSCOPE_URL
.NYL_PYROSCOPE_TENANT_ID
– If set, it takes priority over the?tenant_id
specified in theNYL_PYROSCOPE_URL
.