---
title: How to Deploy Volcano as an AWS Batch Alternative
url: https://docs.vultr.com/how-to-deploy-volcano-as-an-aws-batch-alternative
description: Deploy Volcano on Kubernetes as an AWS Batch alternative with weighted queues, gang scheduling, retry policies, Prometheus monitoring, and a migration path.
publish_date: 2026-12-02T16:05:41.530637Z
last_updated: 2026-12-02T17:49:14.591953Z
author: Abhi Jindal
header_image: https://assets.vultrdevrel.com/docs-main-doc-assets-1/2693/7ec2a073-2298-4196-9ac7-0d59808b51ae.png
---

> Index of every Vultr Docs page in markdown: https://docs.vultr.com/llms.txt

[AWS Batch](https://aws.amazon.com/batch/) is a managed batch computing service from Amazon Web Services (AWS). It runs containerized jobs from job definitions, orders the work you submit through job queues, and scales the compute environments behind those queues according to demand. That removes the need to operate a scheduler or manage the compute fleet, but it also ties job definitions, queue configuration, and permissions to AWS.

[Volcano](https://volcano.sh/) is a Cloud Native Computing Foundation (CNCF) incubating project that adds batch scheduling to Kubernetes, including gang scheduling, queue-based fair sharing, and job lifecycle management. The default Kubernetes scheduler places pods individually and cannot guarantee that all pods in a job start together, which makes it a poor fit for distributed training, simulation sweeps, and other batch work. Unlike AWS Batch, Volcano does not provision compute. It schedules work onto a cluster you already operate, and you typically pair it with an autoscaler such as Karpenter or Cluster Autoscaler. That difference shapes both the migration and the cost model.

This article explains how to deploy Volcano as an alternative to AWS Batch. It covers the Volcano installation with Helm, weighted queues with capability limits, gang-scheduled and multi-task jobs, retry and failure policies, monitoring with Prometheus and Grafana, and migration from AWS Batch.

## Understanding Volcano Architecture

Volcano installs three components into the cluster. The scheduler places any pod that names it, the controller manager turns Volcano's custom resources into pods, and an admission webhook validates those resources when you create them. Three of its custom resource definitions (CRDs) carry most of the work: `Queue` holds the sharing policy, `Job` describes the work, and `PodGroup` represents a set of pods that the scheduler places as a unit.

The following table maps AWS Batch features to their closest Volcano equivalents. Some features match directly, but others differ in scope or behavior, so read the description column before you migrate.

| AWS Batch | Volcano Equivalent | Description |
| --- | --- | --- |
| Job queue (`priority`) | `Queue` with `priority` | Orders queues that compete for the same resources. |
| Fair-share scheduling policy | `Queue` with `weight` | Divides cluster capacity between queues in proportion to their weights. |
| No direct equivalent | `Queue` with `capability` and `guarantee` | Caps the resources a queue can use with `capability`, and reserves a minimum for it with `guarantee`. |
| Compute environment | Kubernetes node pool, such as a managed node group or Karpenter `NodePool` | Supplies the nodes that jobs run on. Volcano schedules onto existing nodes and does not provision new ones. |
| Job definition | `Job` task template (`tasks[].template`) | Defines the container image, command, and resource requests for each task. Volcano has no registered, versioned template, so you manage revisions with Helm or Kustomize. |
| Array job (`arrayProperties`) | `Job` task with multiple `replicas` | Runs the same container several times, and the `env` plugin gives each replica an index through `VC_TASK_INDEX`. Replicas share one job lifecycle, so set failure policies deliberately. |
| Multi-node parallel job (`nodeProperties`) | Gang scheduling with `minAvailable` | Starts a group of pods together or not at all, and the `svc` plugin gives each pod the hostnames of the others. |
| Retry strategy (`attempts`, `evaluateOnExit`) | `maxRetry` with lifecycle `policies` | Caps the number of restarts and maps pod events, such as a failure or an eviction, to actions such as restarting the job. |
| Job role (`jobRoleArn`) | ServiceAccount associated with an IAM role through EKS Pod Identity or IAM Roles for Service Accounts (IRSA) | Grants the job's pods permissions to call AWS APIs. EKS Pod Identity works only on Amazon EKS clusters, and IRSA on other clusters requires an OIDC issuer registered in IAM. |
| EventBridge job state change events | `Job` status phases, Kubernetes events, and Prometheus metrics | Report job transitions and queue allocation for alerting and dashboards. |

## Prerequisites

Before you begin:

* Deploy a [Kubernetes cluster](https://docs.vultr.com/products/compute/kubernetes/provisioning) with at least three worker nodes of 4 vCPUs and 8 GB of memory each.
* [Install and configure kubectl](https://docs.vultr.com/how-to-install-and-use-kubectl-to-manage-a-vke-cluster) to access the cluster.
* Install [Helm 3](https://helm.sh/docs/intro/install/) on the machine that runs the commands.

## Install Volcano

Volcano publishes a Helm chart that installs the scheduler, the controller manager, and the admission webhook in a single namespace and registers the Volcano CRDs.

1. Add the Volcano chart repository.

    ```console
    $ helm repo add volcano-sh https://volcano-sh.github.io/helm-charts
    ```

1. Refresh the repository index.

    ```console
    $ helm repo update
    ```

1. Install the chart into a new namespace.

    ```console
    $ helm install volcano volcano-sh/volcano -n volcano-system --create-namespace --version 1.15.3
    ```

    Check the [official Volcano Helm chart](https://artifacthub.io/packages/helm/volcano-sh/volcano) page for the latest release.

1. Verify that the scheduler, controller, and webhook pods are running.

    ```console
    $ kubectl get pods -n volcano-system
    ```

    The output displays all pods, each with a `Running` status.

1. Verify that the CRDs are registered.

    ```console
    $ kubectl get crd | grep volcano
    ```

    The output lists all registered Volcano CRDs.

## Configure Queues

A queue is the unit of sharing in Volcano. Each queue carries a `weight` that determines its proportional share of the cluster under contention, and an optional `capability` that caps its consumption, regardless of how much capacity the cluster has free.

1. List the queues that Volcano creates at install time.

    ```console
    $ kubectl get queue
    ```

    The output lists two queues, `root` and `default`, and shows `root` as the parent of `default`.

1. Create a queue file named `analytics-queue.yaml`.

    ```console
    $ nano analytics-queue.yaml
    ```

1. Add the following configuration.

    ```yaml
    apiVersion: scheduling.volcano.sh/v1beta1
    kind: Queue
    metadata:
      name: analytics
    spec:
      weight: 4
      reclaimable: true
      capability:
        cpu: "8"
        memory: 16Gi
    ```

    Save and close the file.

1. Apply the analytics queue.

    ```console
    $ kubectl apply -f analytics-queue.yaml
    ```

1. Create a queue file named `reporting-queue.yaml`.

    ```console
    $ nano reporting-queue.yaml
    ```

1. Add the following configuration.

    ```yaml
    apiVersion: scheduling.volcano.sh/v1beta1
    kind: Queue
    metadata:
      name: reporting
    spec:
      weight: 1
      reclaimable: true
      capability:
        cpu: "4"
        memory: 8Gi
    ```

    Save and close the file.

1. Apply the reporting queue.

    ```console
    $ kubectl apply -f reporting-queue.yaml
    ```

1. Verify the weights and ceilings.

    ```console
    $ kubectl get queue analytics reporting -o custom-columns='NAME:.metadata.name,WEIGHT:.spec.weight,CPU:.spec.capability.cpu'
    ```

    The output shows a weight and CPU ceiling for analytics and reporting queues.

## Submit a Gang-Scheduled Job

Gang scheduling is the main reason teams adopt Volcano. A VolcanoJob declares `minAvailable`, and the scheduler places that many pods at once or places none at all. By default, the Kubernetes scheduler can start five pods of a job that needs eight, leaving them waiting for three that never arrive, thereby holding resources without making progress.

1. Create a job file named `gang-demo.yaml`.

    ```console
    $ nano gang-demo.yaml
    ```

1. Add the following configuration.

    ```yaml
    apiVersion: batch.volcano.sh/v1alpha1
    kind: Job
    metadata:
      name: gang-demo
    spec:
      minAvailable: 3
      schedulerName: volcano
      queue: analytics
      tasks:
      - replicas: 3
        name: worker
        template:
          spec:
            containers:
            - name: worker
              image: busybox:1.37
              command: ["sh", "-c", "echo worker starting; sleep 30; echo worker done"]
              resources:
                requests:
                  cpu: "1"
                  memory: 1Gi
            restartPolicy: Never
    ```

    Save and close the file.

1. Submit the job.

    ```console
    $ kubectl apply -f gang-demo.yaml
    ```

1. Check the pod group that Volcano creates for the job.

    ```console
    $ kubectl get podgroup
    ```

    The PodGroup reports a `Running` status with `3` in the `RUNNINGS` column once the scheduler places all three pods, which takes only a few seconds.

1. Verify that all three pods start together.

    ```console
    $ kubectl get pods -l volcano.sh/job-name=gang-demo
    ```

    The output lists three `gang-demo-worker` pods, each with a `Running` status and the same age.

1. Check the job status.

    ```console
    $ kubectl get vcjob gang-demo
    ```

    The job reports `Running` while the containers sleep, and `Completed` about 30 seconds after the pods start.

1. Read the output from one of the pods.

    ```console
    $ kubectl logs gang-demo-worker-0
    ```

    The log shows `worker starting`, followed by `worker done` once the 30-second sleep ends.

1. Remove the job.

    ```console
    $ kubectl delete -f gang-demo.yaml
    ```

## Run Array and Multi-Task Jobs

An AWS Batch array job runs the same container multiple times, distinguishing each copy by an index. Volcano expresses that as a task with several replicas, and it also lets one VolcanoJob define several distinct tasks, each with its own image and replica count. That covers the topologies that AWS Batch handles through multi-node parallel jobs.

1. Create a job file named `multitask-demo.yaml`.

    ```console
    $ nano multitask-demo.yaml
    ```

1. Add the following configuration.

    ```yaml
    apiVersion: batch.volcano.sh/v1alpha1
    kind: Job
    metadata:
      name: multitask-demo
    spec:
      minAvailable: 3
      schedulerName: volcano
      queue: analytics
      plugins:
        env: []
        svc: []
      tasks:
      - replicas: 1
        name: master
        template:
          spec:
            containers:
            - name: master
              image: busybox:1.37
              command: ["sh", "-c", "echo ROLE=master INDEX=$VC_TASK_INDEX; echo WORKER_NUM=$VC_WORKER_NUM; echo WORKER_HOSTS=$VC_WORKER_HOSTS; sleep 90"]
              resources:
                requests:
                  cpu: "250m"
                  memory: 256Mi
            restartPolicy: Never
      - replicas: 2
        name: worker
        template:
          spec:
            containers:
            - name: worker
              image: alpine:3.24
              command: ["sh", "-c", "echo ROLE=worker INDEX=$VC_TASK_INDEX; echo MASTER_HOSTS=$VC_MASTER_HOSTS; sleep 90"]
              resources:
                requests:
                  cpu: "250m"
                  memory: 256Mi
            restartPolicy: Never
    ```

    Save and close the file.

    The two tasks use different images and replica counts within one job. `minAvailable` counts pods across every task, so a value of `3` covers the master and both workers.

1. Submit the job.

    ```console
    $ kubectl apply -f multitask-demo.yaml
    ```

1. Verify that all three pods are running.

    ```console
    $ kubectl get pods -l volcano.sh/job-name=multitask-demo
    ```

    The master pod and both worker pods report a `Running` status.

1. Read the master's view of the job.

    ```console
    $ kubectl logs multitask-demo-master-0
    ```

    The output shows `INDEX=0`, `WORKER_NUM=2`, and a `WORKER_HOSTS` value that lists the hostnames of both worker pods.

1. Read a worker's view of the job.

    ```console
    $ kubectl logs multitask-demo-worker-0
    ```

    The output shows `INDEX=0` and a `MASTER_HOSTS` value that contains the master pod's hostname.

1. Remove the job.

    ```console
    $ kubectl delete -f multitask-demo.yaml
    ```

## Configure Job Retry and Failure Policies

AWS Batch retries a job based on an attempt count and optional exit conditions. Volcano splits that behavior into two: `maxRetry` on the job caps how many times a job can restart, and policies on each task decide which pod events trigger a restart.

1. Create a job file named `retry-demo.yaml`.

    ```console
    $ nano retry-demo.yaml
    ```

1. Add the following configuration.

    ```yaml
    apiVersion: batch.volcano.sh/v1alpha1
    kind: Job
    metadata:
      name: retry-demo
    spec:
      minAvailable: 1
      schedulerName: volcano
      queue: analytics
      maxRetry: 3
      tasks:
      - replicas: 1
        name: flaky
        policies:
        - event: PodEvicted
          action: RestartJob
        - event: PodFailed
          action: RestartJob
        template:
          spec:
            containers:
            - name: flaky
              image: busybox:1.37
              command: ["sh", "-c", "echo attempt starting; sleep 5; echo failing now; exit 1"]
              resources:
                requests:
                  cpu: "250m"
                  memory: 256Mi
            restartPolicy: Never
    ```

    Save and close the file.

    The container exits with status 1 on every run, so the job uses all of its retries and then fails. `RestartJob` restarts every task in the job, while `RestartTask` restarts only the affected task.

1. Submit the job.

    ```console
    $ kubectl apply -f retry-demo.yaml
    ```

1. Wait about 30 seconds for the retries to run out, then check the job status.

    ```console
    $ kubectl get vcjob retry-demo
    ```

    The job reports a `Failed` status. Run the command again if it still shows `Running` or `Restarting`.

1. Read the retry count and the events that produced it.

    ```console
    $ kubectl describe vcjob retry-demo
    ```

    The `Status` section reports `Retry Count: 3`, and the `Events` section shows the `Start to execute action RestartJob` event with an `x3` count, one for each retry.

1. Remove the job.

    ```console
    $ kubectl delete -f retry-demo.yaml
    ```

## Set Up Monitoring

The Volcano scheduler and controller both serve Prometheus metrics, and the chart enables those endpoints by default.

1. Verify that the metrics services exist.

    ```console
    $ kubectl get svc -n volcano-system
    ```

    The `volcano-scheduler-service` exposes port `8080`, and the `volcano-controllers-service` exposes port `8081`. Both serve Prometheus metrics.

1. Add the Prometheus community repository.

    ```console
    $ helm repo add prometheus-community https://prometheus-community.github.io/helm-charts
    ```

1. Refresh the repository index.

    ```console
    $ helm repo update
    ```

1. Install the monitoring stack.

    ```console
    $ helm install monitoring prometheus-community/kube-prometheus-stack -n monitoring --create-namespace --version 92.9.0
    ```

    Check the [official kube-prometheus-stack Helm chart](https://artifacthub.io/packages/helm/prometheus-community/kube-prometheus-stack) page for the latest release.

1. Verify that the monitoring pods are running.

    ```console
    $ kubectl get pods -n monitoring
    ```

    Every pod reports a `Running` status within a few minutes. Run the command again if any pod is still starting.

1. Verify that the stack requested no persistent volumes.

    ```console
    $ kubectl get pvc -n monitoring
    ```

    The command reports that no resources were found in the `monitoring` namespace because Prometheus, Alertmanager, and Grafana use ephemeral storage by default.

1. Create a service monitor file.

    ```console
    $ nano volcano-servicemonitors.yaml
    ```

1. Add the following configuration.

    ```yaml
    apiVersion: monitoring.coreos.com/v1
    kind: ServiceMonitor
    metadata:
      name: volcano-scheduler
      namespace: monitoring
      labels:
        release: monitoring
    spec:
      namespaceSelector:
        matchNames:
        - volcano-system
      selector:
        matchLabels:
          app: volcano-scheduler
      endpoints:
      - port: metrics
        interval: 30s
    ---
    apiVersion: monitoring.coreos.com/v1
    kind: ServiceMonitor
    metadata:
      name: volcano-controller
      namespace: monitoring
      labels:
        release: monitoring
    spec:
      namespaceSelector:
        matchNames:
        - volcano-system
      selector:
        matchLabels:
          app: volcano-controller
      endpoints:
      - port: metrics
        interval: 30s
    ```

    Save and close the file.

1. Apply the service monitor.

    ```console
    $ kubectl apply -f volcano-servicemonitors.yaml
    ```

1. Create a job file named `metrics-load.yaml`.

    ```console
    $ nano metrics-load.yaml
    ```

1. Add the following configuration.

    ```yaml
    apiVersion: batch.volcano.sh/v1alpha1
    kind: Job
    metadata:
      name: metrics-load
    spec:
      minAvailable: 4
      schedulerName: volcano
      queue: analytics
      tasks:
      - replicas: 4
        name: worker
        template:
          spec:
            containers:
            - name: worker
              image: busybox:1.37
              command: ["sh", "-c", "sleep 300"]
              resources:
                requests:
                  cpu: "500m"
                  memory: 512Mi
            restartPolicy: Never
    ```

    Save and close the file.

1. Submit the job.

    ```console
    $ kubectl apply -f metrics-load.yaml
    ```

1. Forward the Prometheus service to your workstation.

    ```console
    $ kubectl port-forward -n monitoring svc/monitoring-kube-prometheus-prometheus 9090:9090 > /dev/null 2>&1 &
    ```

1. List the active Volcano scrape targets.

    ```console
    $ curl -s 'http://localhost:9090/api/v1/targets?state=active' | grep -o 'serviceMonitor/monitoring/volcano-[a-z]*/0' | sort -u
    ```

    The output lists one target for the scheduler and one for the controller. Prometheus can take up to 2 minutes to load new ServiceMonitors, so rerun the command if the output is empty or a target is missing.

1. Query the allocated CPU for each queue.

    ```console
    $ curl -s 'http://localhost:9090/api/v1/query?query=volcano_queue_allocated_milli_cpu'
    ```

    The JSON response reports a value of `2000` for the `analytics` queue, which matches four replicas at 500m each, and `0` for the other queues. If every queue reports `0`, wait a minute, then run the command again.

1. Stop the port forward.

    ```console
    $ kill %1
    ```

1. Retrieve the Grafana administrator password.

    ```console
    $ kubectl get secret monitoring-grafana -n monitoring -o jsonpath="{.data.admin-password}" | base64 -d
    ```

    The command prints the password for the `admin` user. Save the password for use in the following steps.

1. Forward the Grafana service to your workstation.

    ```console
    $ kubectl port-forward -n monitoring svc/monitoring-grafana 3000:80 > /dev/null 2>&1 &
    ```

1. Open `http://localhost:3000` in a web browser and sign in as `admin` with the password from the earlier step.

1. Select **Explore** in the left-hand menu.

1. Choose the **Prometheus** data source and select `volcano_queue_allocated_milli_cpu` from the **Metric** drop-down.

1. Click the **Run query** icon in the top-right corner.

    The graph shows the allocated CPU of each queue, with the `analytics` queue at `2000` millicores while the `metrics-load` job runs.

    ![Grafana Explore graphing allocated CPU for each Volcano queue](https://assets.vultrdevrel.com/docs-main-doc-assets-1/2693/07b5a2a4-7e9f-4b90-ad84-4f25c49e43f7.png)

1. Stop the port forward.

    ```console
    $ kill %1
    ```

1. Remove the load metrics job.

    ```console
    $ kubectl delete -f metrics-load.yaml
    ```

## Verify the Deployment

Confirming that Volcano runs is different from confirming that it schedules differently from the default scheduler. The checks below cover both, and end with a job that cannot fit, which is where gang scheduling becomes visible.

1. List the queues and their hierarchy.

    ```console
    $ kubectl get queue
    ```

    The output lists the `analytics`, `default`, and `reporting` queues, each with `root` as its parent.

1. Create a job file named `verify-demo.yaml`.

    ```console
    $ nano verify-demo.yaml
    ```

1. Add the following configuration.

    ```yaml
    apiVersion: batch.volcano.sh/v1alpha1
    kind: Job
    metadata:
      name: verify-demo
    spec:
      minAvailable: 2
      schedulerName: volcano
      queue: analytics
      tasks:
      - replicas: 2
        name: worker
        template:
          spec:
            containers:
            - name: worker
              image: busybox:1.37
              command: ["sh", "-c", "sleep 60"]
              resources:
                requests:
                  cpu: "250m"
                  memory: 256Mi
            restartPolicy: Never
    ```

    Save and close the file.

1. Submit the job.

    ```console
    $ kubectl apply -f verify-demo.yaml
    ```

1. List the jobs.

    ```console
    $ kubectl get vcjob
    ```

    The job reports `Pending` until the scheduler places both pods, then as `Running` with two replicas running. After a minute, the containers exit and the job reports `Completed`.

1. Remove the job.

    ```console
    $ kubectl delete -f verify-demo.yaml
    ```

1. Record the cluster's CPU capacity.

    ```console
    $ kubectl get nodes -o custom-columns='NAME:.metadata.name,CPU:.status.allocatable.cpu'
    ```

    Each node reports its allocatable CPU in cores or millicores. Add the values together and note the total as `A`, in cores. For example, a value of `7910m` is 7.91 cores.

1. Raise the queue ceiling so that the cluster limits the next job.

    ```console
    $ kubectl patch queue analytics --type=merge -p '{"spec":{"capability":{"cpu":"64","memory":"128Gi"}}}'
    ```

1. Create a job file named `filler.yaml`.

    ```console
    $ nano filler.yaml
    ```

1. Add the following configuration. Replace `FILLER_REPLICAS` with half of `A`, rounded down. For example, on a 24 vCPU cluster, use `12`.

    ```yaml
    apiVersion: batch.volcano.sh/v1alpha1
    kind: Job
    metadata:
      name: filler
    spec:
      minAvailable: 1
      schedulerName: volcano
      queue: analytics
      tasks:
      - replicas: FILLER_REPLICAS
        name: worker
        template:
          spec:
            containers:
            - name: worker
              image: busybox:1.37
              command: ["sh", "-c", "sleep 600"]
              resources:
                requests:
                  cpu: "1"
                  memory: 512Mi
            restartPolicy: Never
    ```

    Save and close the file.

    This job sets `minAvailable: 1`, so its pods start individually as capacity allows.

1. Submit the filler job.

    ```console
    $ kubectl apply -f filler.yaml
    ```

1. Count the running filler pods.

    ```console
    $ kubectl get pods -l volcano.sh/job-name=filler --field-selector=status.phase=Running --no-headers | wc -l
    ```

    The command reports the value you set for `FILLER_REPLICAS`. Run it again if the count is lower, because the pods can take a few seconds to start.

1. Record how much CPU is already requested on the cluster.

    ```console
    $ kubectl describe nodes | grep -A 8 "Allocated resources"
    ```

    Add the CPU requests from each node and note the total as `R`, in cores. `R` includes the filler pods and the system pods.

1. Create a job file named `gang-wait.yaml`.

    ```console
    $ nano gang-wait.yaml
    ```

1. Add the following configuration. Replace `GANG_REPLICAS` with a whole number that satisfies the rule after the code block. Each pod requests 1 CPU, so the job's total CPU request equals that number.

    ```yaml
    apiVersion: batch.volcano.sh/v1alpha1
    kind: Job
    metadata:
      name: gang-wait
    spec:
      minAvailable: GANG_REPLICAS
      schedulerName: volcano
      queue: analytics
      tasks:
      - replicas: GANG_REPLICAS
        name: worker
        template:
          spec:
            containers:
            - name: worker
              image: busybox:1.37
              command: ["sh", "-c", "sleep 120"]
              resources:
                requests:
                  cpu: "1"
                  memory: 512Mi
            restartPolicy: Never
    ```

    Save and close the file.

    Choose `GANG_REPLICAS` so that the following holds:

    ```
    A − R < GANG_REPLICAS < 1.2 × A − R
    ```

    * The total must exceed the free CPU, `A − R`, so the job cannot start and waits.
    * The total must stay below `1.2 × A − R`. Volcano checks a job's minimum resources against that limit before it creates pods. A job that fails the check gets no pods, so the pod count in a later step finds nothing.

    For example, on a 24 vCPU cluster (A = 24) where system pods request 2 cores and the filler job requests 12, R is 14. The free CPU is 24 − 14 = 10, and the upper limit is 1.2 × 24 − 14 = 14.8. Any whole number from 11 to 14 works, so use `12`.

1. Submit the job.

    ```console
    $ kubectl apply -f gang-wait.yaml
    ```

1. Count the pods by status.

    ```console
    $ kubectl get pods -l volcano.sh/job-name=gang-wait --no-headers | awk '{print $3}' | sort | uniq -c
    ```

    The command reports `GANG_REPLICAS` pods in the `Pending` state.

1. Remove the filler job to free capacity.

    ```console
    $ kubectl delete -f filler.yaml
    ```

1. Check the gang job status.

    ```console
    $ kubectl get vcjob gang-wait
    ```

    The job reports `Running` with `GANG_REPLICAS` running replicas once the cluster has room for the whole group, which can take up to a minute.

1. Restore the queue ceiling.

    ```console
    $ kubectl patch queue analytics --type=merge -p '{"spec":{"capability":{"cpu":"8","memory":"16Gi"}}}'
    ```

1. Remove the job.

    ```console
    $ kubectl delete -f gang-wait.yaml
    ```

## Migrate from AWS Batch to Volcano

This section outlines the strategy for migrating batch workloads from AWS Batch to Volcano. It focuses on how AWS Batch concepts map onto Volcano resources, so the approach stays applicable as both projects release new versions. Refer to the current [AWS Batch](https://docs.aws.amazon.com/batch/) and [Volcano documentation](https://volcano.sh/en/docs/) for the exact settings your workloads require as you plan your migration.

### Job Definition

Job definition migration rewrites each AWS Batch job definition as a task inside a VolcanoJob. The image, command, and environment variables from the job definition's container properties are moved into the task's pod template, and the `VCPU` and `MEMORY` entries in `resourceRequirements` become `resources.requests` for the container. AWS Batch expresses memory in MiB, so a value of `2048` becomes `2048Mi`.

An array job becomes a single task with `replicas` set to the array size and the `env` plugin enabled, and `VC_TASK_INDEX` replaces `AWS_BATCH_JOB_ARRAY_INDEX`, so change the application to read `VC_TASK_INDEX`. A multi-node parallel job becomes one task for each node range in `nodeRangeProperties`, with `minAvailable` set to the total node count and the `svc` plugin enabled. `VC_<TASK_NAME>_HOSTS` replaces `AWS_BATCH_JOB_MAIN_NODE_PRIVATE_IPV4_ADDRESS`, such as `VC_MASTER_HOSTS` for a task named `master`, so change the child nodes to read the main node's hostname from it. The Volcano variable holds a DNS name.

### Queue and Priority

Queue migration starts with one Volcano queue for each AWS Batch job queue, but the two systems order work differently. AWS Batch evaluates job queues that share a compute environment in order of priority. Volcano queues have their own `priority` field. Higher values are prioritized for scheduling. When the `reclaim` action is enabled, the scheduler considers those queues later during capacity reclamation, so map the AWS Batch queue priority to that field.

Volcano also divides capacity between queues by `weight`, which is a soft limit. A queue can borrow idle capacity and returns it only when another queue reclaims it. Set the `weight` for each queue's share, and confirm the resulting shares under load. The `weight` field requires the `proportion` plugin, which the default scheduler configuration enables.

To keep the original compute limit, set `capability` on each queue. It acts as a hard upper limit. If several queues share a compute environment, give each queue the full `maxvCpus` value to share the pool, or divide the value among the queues to isolate them.

AWS Batch fair-share policies divide a single job queue between share identifiers by `weightFactor`, where a lower value earns more compute. Volcano's `weight` works the other way, so invert the values when you convert them. Within a Volcano queue, the default `drf` plugin favors the job with the smallest share of cluster resources and does not use per-workload weights, so place workloads that need different shares in separate weighted queues.

### Compute Provisioning

AWS Batch adjusts the instance count of a managed compute environment between its minimum and maximum vCPUs based on job queue demand. Volcano does not provision compute. It places pods on the nodes the cluster already has, so a job that does not fit waits until capacity becomes available.

Run a cluster autoscaler, such as Karpenter or the Cluster Autoscaler, for bursty workloads, and allow time for it to add a node. If you do not run an autoscaler, size node pools for peak job concurrency. Volcano's `enqueue` action holds a job's PodGroup in `Pending` until the job's minimum demand fits within the cluster's total resources multiplied by the `overcommit-factor` (default `1.2`), minus the resources already in use. A job slightly larger than the free capacity still enqueues, and its `Pending` pods can trigger an autoscaler. A job far larger than the cluster creates no pods, so a pending-pod autoscaler never sees it. Test this behavior before you rely on it.

### Migration Considerations

The following items require attention during the migration:

* **Capacity reclamation**: A Volcano queue can borrow idle capacity beyond its share. A default installation does not enable the scheduler's `reclaim` action, so a queue keeps borrowed capacity until its jobs finish. To change this, add `reclaim` to the `actions` list in the `volcano-scheduler-configmap` ConfigMap.
* **Job identity**: A job role becomes a Kubernetes ServiceAccount. To grant that ServiceAccount access to AWS APIs, associate it with an AWS Identity and Access Management (IAM) role. Amazon Elastic Kubernetes Service (Amazon EKS) clusters support EKS Pod Identity and IAM Roles for Service Accounts (IRSA). On other clusters, EKS Pod Identity is not available, and IRSA requires an OpenID Connect (OIDC) issuer for the cluster that you register as an identity provider in IAM. Role-based access control (RBAC) rules on the ServiceAccount control access to the Kubernetes API only.
* **Array job indexing**: `AWS_BATCH_JOB_ARRAY_INDEX` is unique across the entire array, whereas `VC_TASK_INDEX` restarts at 0 for each task. A job with several tasks needs its own scheme for globally unique identifiers.
* **Job revisions**: AWS Batch assigns an incremental revision number each time you register a job definition under the same name. A VolcanoJob accepts in-place changes to only a few fields, such as `minAvailable` and task replica counts, so most changes require you to delete and recreate the job. Manage revisions with Helm or Kustomize.
* **Retry behavior**: AWS Batch allows up to 10 `attempts`, counting the first run, and can retry or exit based on exit codes and status reasons. Volcano's `maxRetry` limits how many times a job can restart. The Volcano docs describe it as both retries and tries, so test whether the first run counts before you convert `attempts` values. Volcano restarts a job only when a lifecycle policy matches a pod event, such as `PodEvicted` with the `RestartJob` action. A Volcano restart also replaces the previous attempt's pods, so ship logs to external storage if you need them from earlier attempts.
* **Observability**: AWS Batch sends job state change events to Amazon EventBridge. Volcano reports job state through status phases such as `Pending`, `Running`, `Restarting`, `Completed`, and `Failed`, along with Kubernetes events and Prometheus metrics. You build alerts and dashboards yourself.
* **Cost model**: A managed compute environment with a minimum of zero vCPUs can scale down to no instances when its queues are empty. A Kubernetes cluster scales its worker nodes to zero only if you run an autoscaler. The control plane and any always-on nodes keep running and incurring charges.

## Conclusion

You have successfully deployed Volcano on a Kubernetes cluster as an alternative to AWS Batch. You configured weighted queues, ran gang-scheduled, multi-task, and retrying jobs, and monitored queue allocation with Prometheus and Grafana. For more information, visit the official [Volcano documentation](https://volcano.sh/en/docs/).
