NOVA CLI reference 0.5.0 GitHub
  1. nova
  2. nova instance

nova instance env

Prints shell commands that point this shell to an instance

Synopsis

Prints shell commands that set NOVA_INSTANCE and, where available, KUBECONFIG for an instance (default: the targeted one). Evaluate them to point the current shell, and everything started from it (nova, kubectl, helm, k9s), to that instance without changing the selection of other sessions.

For host instances the kubeconfig is fetched over ssh if needed (see 'nova instance kubeconfig'); cloud instances have no kubeconfig, so only NOVA_INSTANCE is set. --unset prints the commands that undo it.

The syntax matches the shell that runs the command (detected from the parent process, then $SHELL); --shell overrides it.

nova instance env [name] [flags]

Examples

# bash / zsh
$ eval "$(nova instance env lab)"
$ eval "$(nova instance env --unset)"

# fish
$ nova instance env lab | source

# PowerShell
PS> nova instance env lab | Invoke-Expression

Options

  -h, --help                help for env
      --kubeconfig string   Use this kubeconfig file ('-' for stdin) instead of fetching it over ssh; a copy is stored for the instance.
      --no-sudo             Read the kubeconfig without sudo (e.g. when connecting as root).
      --refresh             Fetch the kubeconfig of a host instance again.
      --setup-ssh-key       Before fetching, install your SSH public key and (unless --no-sudo) a passwordless sudo rule for k3s on the host. Needs the SSH and one sudo password once.
      --shell string        Shell syntax: sh (bash, zsh), fish or powershell. Detected from the calling shell if empty.
      --ssh-port int        SSH port. If 0, your ssh config or the default applies.
      --ssh-user string     SSH user for fetching the kubeconfig of a host instance (remembered for the instance). If empty, the remembered user, your ssh config or the current user applies.
      --unset               Print the commands that unset NOVA_INSTANCE and KUBECONFIG.

Options inherited from parent commands

      --debug                      Write diagnostic output to stderr: HTTP requests and responses, external commands, the resolved instance. Known secrets are redacted, but bodies (app environments, kubeconfigs) can still contain some: don't share the output unreviewed (env: NOVA_DEBUG=1)
      --env string                 (Wandelbots internal) Portal environment for this invocation: prod, stg or dev (default: the environment of the cloud instance, else of the last 'nova login'; env: NOVA_ENV)
      --insecure-skip-tls-verify   If true, the server's certificate will not be checked for validity (disables TLS verification for all requests)
      --instance string            Name of the instance to work against for this invocation (overrides the selected instance; env: NOVA_INSTANCE)

SEE ALSO

  • nova instance - Manage the NOVA instances the CLI works against