Run a one-time batch task with retries.

Section: Jobs and CronJobs

Basic Job YAML

yaml
yaml
apiVersion: batch/v1
kind: Job
metadata:
  name: db-migration
spec:
  backoffLimit: 3
  template:
    spec:
      restartPolicy: Never
      containers:
        - name: migrate
          image: ghcr.io/example/api:1.0.0
          command: ["./bin/migrate"]

Learn the surrounding workflow

Compare similar commands or jump into common fixes when this command is part of a bigger troubleshooting path.

Related commands

Same sheet · prioritizing Jobs and CronJobs
Basic CronJob YAML
Schedule recurring batch work.
OpenIn sheetyamlsame section
Run CronJob template on demand
Instantiate a Job from a CronJob definition.
OpenIn sheetbashsame section
Basic StatefulSet YAML
Run stateful replicas with stable ordinals.
Basic DaemonSet YAML
Deploy a log collector or node agent everywhere.
HorizontalPodAutoscaler YAML
Scale Deployment based on CPU utilization.
Set rolling update partition
Control StatefulSet ordinal rollout.