Skip to main content

Add a Kubectl job

A Kubectl Job runs a single kubectl operation against a Kubernetes cluster from within a Pipeline — deploy manifests, inspect resources, view logs, or run other cluster operations — with a full audit trail and no need to run kubectl manually from your own machine.

Prerequisites

Add a Kubectl job

Add job menu — Kubectl

  1. In the Pipeline Editor, click Add Job (or Add Parallel Job) on the Stage you want to run the operation from.
  2. Under Operations, select Kubectl.

The Edit Job panel opens.

Configure the operation

Edit Job panel — Kubectl, Apply operation

  1. Enter the Job name.
  2. Select the OperationApply, Create, Delete, Expose, Get, Logs, Rollout, Run, Set, Top, or Exec. See Kubectl job reference for what each one does.
  3. Select the target Environment. Namespace and Kubectl Version fill in automatically and can't be edited.
tip

To reference the image built by an earlier Build and push Job, use {{BUILD_REPOSITORY}} and {{BUILD_TAG}} in the manifest or Arguments — the Kubectl Job substitutes the actual values at run time.

If Operation is Apply

  1. Under Manifest Source, choose Git repository or Inline YAML.

For a Git repository:

  1. Select a Git account connection, or click Add Git connections to create one.
  2. Enter the Branch (defaults to main).
  3. Enter the Manifest file or directory — a single YAML file, or a directory applied recursively.

For Inline YAML:

  1. Paste the manifest content directly into the YAML Manifest field.

  2. Optionally add extra Arguments — additional flags for the apply command.

tip

Before applying for real, the Pipeline always runs kubectl apply --dry-run=server first. The actual apply only runs if the dry-run passes, and both steps are recorded in the run's audit log along with the Git commit SHA.

If Operation is anything other than Apply

Edit Job panel — Kubectl, Get operation

  1. Enter the Arguments for the selected operation — this field is required for every operation except Apply.
warning

Don't include -n or --namespace in Arguments. The Namespace is always taken from the Environment field above.

Add an approval before a risky operation (optional)

For Delete or Exec, consider adding an Approval Job immediately before the Kubectl Job in the same Stage — the Pipeline pauses until the configured Approver decides. See Add an approval gate.

Save the job

  1. Click Save changes.
  2. Click Save Pipeline to persist the change.
warning

Save changes only saves the Job within the current editing session — you still need to click Save Pipeline to persist it.

The Kubectl Job runs the next time its Stage executes, alongside the Pipeline's other Jobs.

Next steps