Skip to main content
Konduktor automatically provides a rich set of environment variables in your containers that give you access to job metadata, networking information, and system configuration. These variables are automatically set when your container starts and can be accessed using standard shell syntax.

Setting Environment Variables

Environment variables in Konduktor can come from multiple sources, depending on how your workload and configuration are defined. When the same variable name is defined in more than one place, Konduktor applies a priority order to decide which value takes precedence.

Priority Order

If the same variable appears in multiple places, the highest priority source wins. Priorities from highest to lowest: While the global priority is CLI > task.yaml > env secret > config.yaml > system, note that any exports (ex. export FOO=bar) done inside your run: script happens at runtime and will override the effective value for all subsequent commands in that script. So basically runtime > everything.

Examples

CLI

task.yaml

Env Secret

config.yaml

Accessing Environment Variables

Environment variables can be accessed in several ways:

Shell Scripts

Task.yaml:

Python

Task.yaml:

pythonfile.py:

Node.js

Task.yaml:

jsfile.js:

Core Konduktor Environment Variables

These variables are always available in every Konduktor container:

Job Information

Networking Information

System Configuration

Conditional Environment Variables

These variables are only set when specific features are enabled:

Tailscale (when tailscale.secret_name is configured)

SSH (when ssh.enable is true)

Git SSH (when git-ssh secret exists)

Default Secrets (when default secrets exist)

Practical Examples

Example: WANDB Integration

Example: Checkpoint Resumption With Cloud Storage

When Konduktor restarts a job (via the Kubernetes Job controller), it launches a fresh pod. All local files are wiped, including anything in /tmp, /root, or the working directory. To recover from a failure, you must save checkpoints to a persistent cloud store. Learn more about using environment variables like RESTART_ATTEMPT and JOB_COMPLETION_INDEX for checkpoint resumption here.

Troubleshooting

If an environment variable is not set as expected:
  1. Check if the feature is enabled (e.g., SSH, Tailscale)
  2. Verify the variable name spelling
  3. Check the Konduktor logs for any errors
  4. Ensure you’re running the latest version of Konduktor