DocsWorkspace Management

Workspace Management

Your workspace maintains its state based on the following factors:

  1. Environment variables (envvars) and their values
  2. Mounted config files and their contents
  3. Installed packages
  4. The environment workspace is connected to

Environment Variables (Envvars)

You can load environment variables from the configs and secrets of the Kloudlite environment using the following commands:

Load envvar from config

kl add config

Load envvar from secret

kl add secret

Load envvar from integrated resource

kl add res

These commands will prompt you to choose the config, secret, or resource and keys to be loaded, adding references to the kl.yml file. You can use these commands both inside and outside the development container.

To update the environment variables you can also modify the kl.yml file and run kl box reload

Config Files

You can create config files from the configs and secrets of the Kloudlite environment using the following command:

Load config/secret into config file

kl add config-mount <file-path>

This command will prompt you to choose the config and keys to be mounted, adding references and the mount filepath to the kl.yml file. You can use this command both inside and outside the development container.

You can also modify the kl.yml file and run kl box reload

Packages

Add dependent packages with the following command, which will download the necessary Nix packages and update the PATH variable:

kl pkg add <packagename>

This command will prompt you to choose the package and version to be installed, adding the package reference to the kl.yml file. You can use this command only from inside the development container.

To install packages you can also modify the kl.yml file and run kl box reload

Kloudlite Environment

Switch between environments using the following command:

kl use env

This command will prompt you to choose the environment and update env-vars, config mounts, and network settings accordingly. Note that this command will not change the kl.yml file. It can only be used from inside the development container.

State Reload

You can make changes to kl.yml file and update the state using the following command.

kl box reload

Restart on State Change

When there is a change in the environment, your shell prompt will indicate that you need to restart the container to ensure all processes are in the same state. Use the following command to restart the container:

kl box restart

Connection Status

To check the connection status. Use the following command:

kl status

If this command is executed on host system it will show details of current active account, cluster status and cluster's connection status.

When executed inside the development container, it will also show the connection status of workspace container.

Sometimes when there is disruption in network connection, the workspace container or cluster may lose connection with wireguard mesh. In such cases, you can use the following command to reconnect:

kl connect
Last updated on