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
.
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.