Skip to main content

Context Variables

This page introduces the concept of Context Variables, which allows Furiko users to parameterize their jobs based on certain variables.



A variable looks like ${}. This context variable uses the context job, with the variable name name.

Users who are familiar with Rundeck may find this concept familiar, as it was inspired by the corresponding feature in Rundeck:


Context variables can be used inside the Job/JobConfig's task template, like so:

Example TaskTemplate
- name: job-container
- echo
- "Job Name: ${}"

For pod, only the following fields support context variable substitution:

  • .spec.containers.*.image
  • .spec.containers.*.command.*
  • .spec.containers.*.args.*
  • .spec.containers.*.env.*.value
  • .spec.initContainers.*.image
  • .spec.initContainers.*.command.*
  • .spec.initContainers.*.args.*
  • .spec.initContainers.*.env.*.value

Variables will be substituted as a string as-is in the fields that they are defined in. If using in the command or args fields, you may need to escape them with double quotes (e.g. "${}").


Each context corresponds to a stage in the Job's lifecycle when certain variables are made available. The following is a list of all contexts and available variables.


Variables are evaluated when creating a Job from a JobConfig, such as during cron scheduling or ad-hoc starts of a Job.

jobconfig.nameName of the JobConfig that created the
jobconfig.namespaceNamespace of the JobConfig that created the Job.furiko
jobconfig.uidUID of the JobConfig that created the Job.4247b21e-713f-46db-b8f5-39917893577e
jobconfig.cron_scheduleCron expression that was used to schedule the Job.H/15 * * * *
jobconfig.cron_timezoneCron timezone that was used to schedule the Job.Asia/Singapore


Variables are evaluated when creating a task for a Job. This takes place after the Job is started.

job.nameName of the Job that created the
job.namespaceNamespace of the Job that created the task.furiko
job.typeType of Job, e.g. Adhoc, Scheduled.Adhoc


Variables are evaluated when creating a task.

task.nameName of the
task.namespaceNamespace of the task.furiko
task.retry_indexThe retry index of the task, starts from 1.1

Additionally, the following variables are included when a parallel job is created:

task.index_numIf withCount is used, the task index number (from 0...N-1).2
task.index_keyIf withKeys is used, the task index key (as a string).item-3
task.index_matrix.<key>If withMatrix is used, the value of the corresponding key in the matrix for this task index.value-1


The option context is a special context that allows for user-defined inputs to parameterize the Job.

For more information, see Job Options.


Variables are evaluated based on their context, but substitution is only performed only when creating the task object (i.e. when creating the PodSpec). Because of this, the Job exposes a substitutions field which captures all evaluated substitutions so far before finally evaluating it at the end.

Users may also override certain context variables by manually specifying it in the substitutions field when creating the Job. They will take precedence over all other variables that are evaluated (context variables and option variables).

For example, given the following configuration below:

Example: Custom Substitutions
kind: Job
generateName: dummy-sample-
configName: jobconfig-sample
option.username: "mary" "dummy-sample"
optionValues: |-
username: "bob"
expiry: "168h"
  1. option.username will be evaluated to mary (substitutions takes precedence)
  2. option.expiry will be evaluated to 168h (from optionValues)
  3. will be evaluated to dummy-sample (substitutions takes precedence)
  4. jobconfig.namespace will be evaluated to default (from the jobconfig context)