Kubit logoKubit

Manage environment variables

Kubchi provides two ways to reuse values: Kubit Variables and Variable Groups. They solve different problems:

ToolUseHow a Pack consumes it
Kubit VariableStore one value for use in a Pack template, such as a domain, image name, or log levelReference the key as {{ vars.KEY }} in Pack configuration
Variable GroupStore several environment variables with the names expected by an application, such as DB_HOST and DB_PORTPass the group's Secret to a chart setting that accepts a Secret or environment variables

Creating a variable or group does not add anything to a container by itself. A Pack value must reference a Kubit Variable. For a Variable Group, the chart must define a Secret or envFrom input, and Pack configuration must pass the group's Secret to that input.

The panel displays the values of Kubit Variables and Variable Group members. Store passwords, tokens, and other sensitive data in Vault.

Prerequisites

The project must be connected to an active cluster. Creating or changing variables also requires permission to edit Kubchi resources in the project. If you can open the page but cannot use an Add, Edit, or Delete action, ask an organization administrator to check your role.

Before creating a variable, identify the chart input or Pack configuration field that will consume it. The name and value type must match what the chart expects.

Kubit Variables

A Kubit Variable is a key-value pair defined for a project. When Kubchi processes Pack configuration, these values are available alongside variables defined by the Pack. Several Packs can therefore reference the same value.

For example, store a domain once as APP_DOMAIN and use it in more than one Pack:

spec:
  values:
    ingress:
      host: '{{ vars.APP_DOMAIN }}'

APP_DOMAIN is the Kubit Variable name. It does not have to match an environment variable inside the application. Each Pack's configuration determines where the value is used.

Create a Kubit Variable

  1. From the Kubchi sidebar, select Environment Variables, then Kubit Variables.
  2. Select the Add button.
  3. Enter an English Key. It must start with a letter and can contain letters, numbers, and underscores, for example LOG_LEVEL.
  4. Enter the value required by the Pack in Value.
  5. Select Save.

Each key must be unique in the project. If it already exists, edit the existing row instead of creating another one.

Use a Kubit Variable in a Pack

In Pack configuration, find the field that should receive the value. When the configuration editor accepts a template expression, enter {{ vars.KEY }} and replace KEY with the variable you created.

Defining a key on the Kubit Variables page does not add an input to the chart. The expression must be used in a Pack value. See Pack variables for the Pack template structure.

When the same key exists at several levels, the project value overrides the organization value, and the organization value overrides the value inside the Pack. To avoid ambiguity, define a shared key only at the level that should control it.

Edit or delete a Kubit Variable

Open the row's three-dot menu and select Edit or Delete. The key cannot be changed during editing; only the value can be updated.

Before accepting a change, Kubchi validates dependent Packs with the new value. Saving fails when the value does not match the chart's expected structure or deleting the key leaves an unresolved expression.

Changing a value does not redeploy running Pack resources. Check the effect of the change, then redeploy each consuming Pack from its own page to apply the new output.

Variable Groups

A Variable Group is a named collection of key-value pairs. Kubchi makes a managed Secret available to the project for each group. You can pass that Secret to a Secret or environment-variable input defined by the chart.

For example, app-settings can contain these non-sensitive values:

KeyExample value
APP_MODEproduction
LOG_LEVELinfo
FEATURE_X_ENABLEDtrue

Group keys use the names expected by the application. Unlike a Kubit Variable, changing APP_MODE to another name requires explicit mapping support from the chart.

Create a Variable Group

  1. From the Kubchi sidebar, select Environment Variables, then Variable Groups.
  2. Select New variable group.
  3. Enter a short group name, such as app-settings. Use lowercase English letters, numbers, and hyphens, and do not start or end the name with a hyphen.
  4. Enter a Key and Value for each variable.
  5. Use Add variable to add more rows when needed.
  6. Select Confirm and create variable group.

Keys must be unique within a group. The group name must also be unique among the groups available to the project. A group created from this form is Private and available only to the current project. The current panel does not provide an Organizational option when creating a group.

Use a Variable Group in a Pack

After creation, the group's Secret is available to the project, but it is not attached to a container automatically. The chart must define a Secret, envFrom, or environment-variable input in its templates and values. In Pack configuration, pass the group's Secret to that input.

The field name depends on the chart, and some charts do not provide this type of input. A chart may also request the Secret name and each key separately instead of accepting the entire Secret. Follow that chart's documentation and configuration fields.

View and change group members

On Variable Groups, select the group name to open Group Variables. You can search the members and use the Add button to create another variable. To edit or delete a member, open its three-dot menu.

The group table also shows the number of variables and the Access Level. An Organizational group that already exists in the organization may appear in the list. You can consume it in the current project, but only the owner project can add, edit, or delete its members.

Changing group members does not redeploy a Pack's configuration or workloads. Review consuming Packs after the change and redeploy them when the new values must be applied.

Choose a variable type

  • Use a Kubit Variable when one value belongs in the configuration template of one or more Packs.
  • Use a Variable Group when an application receives several named environment variables from a Secret.
  • Store sensitive values in Vault, even when the interface technically allows them in a variable or group.
  • Keep a value in the Pack itself when only that Pack uses it and no other page needs to control it.

Common problems

A variable expression is undefined

Compare the key in {{ vars.KEY }} with the Kubit Variables table. Key names are case-sensitive. Also check that the expression is in a field that the Pack processes as a template.

A variable change is rejected

The new value makes a dependent Pack invalid, or deleting the key leaves an unresolved reference. Read the error, find every Pack that uses the key, and save a compatible value.

A group is missing from chart configuration

First check that the group belongs to the project or is available as an Organizational group. Then confirm that the chart field accepts a Secret. Reload Pack configuration if the group was created recently.

A new value is not applied to the application

Saving a variable or changing group members does not redeploy existing containers. Confirm that the Pack references the correct key or group, redeploy the Pack, then inspect Workloads and Pack events.

Environment Variables | Documentations | Kubit