{"data":{"slug":"github-google-skills-skills-cloud-gke-batch-hpc-a51fc01a1fc1","title":"Run Batch & HPC Workloads on GKE","summary":"Execute batch processing and high-performance computing (HPC) workloads on Google Kubernetes Engine (GKE) using JobSets, MPI Jobs, and Kueue for job scheduling. This includes setting up job queues, configuring HPC node pools with compact placement, and deploying MPI-based applications.","url":"https:\/\/skillshunter.net\/skills\/github-google-skills-skills-cloud-gke-batch-hpc-a51fc01a1fc1","json_url":"https:\/\/skillshunter.net\/api\/public\/v1\/skills\/github-google-skills-skills-cloud-gke-batch-hpc-a51fc01a1fc1","markdown_url":"https:\/\/skillshunter.net\/skills\/github-google-skills-skills-cloud-gke-batch-hpc-a51fc01a1fc1.md","download_url":"https:\/\/skillshunter.net\/skills\/github-google-skills-skills-cloud-gke-batch-hpc-a51fc01a1fc1\/download","category":{"slug":"software-development","name":"Software & Development"},"editor_note":"Before executing any `gcloud`, REST API, or MCP command, you MUST read [Usage Attribution](references\/attribution.md). For commands executed directly in the terminal, prefix `gcloud` with `CLOUDSDK_METRICS_REQUEST_ATTRIBUTION=\"agent-skills\/1.0 (skill:gke-batch-hpc)\"` and append `agent-skills\/1.0 (skill:gke-batch-hpc)` to `User-Agent` headers.","instructions":"---\nname: gke-batch-hpc\ndescription: >-\n  Runs batch and HPC workloads on GKE, utilizing job queues and parallel\n  processing. Use when running GKE batch jobs, configuring GKE HPC, or setting\n  up GKE job queues. Don't use for standard web application deployments (use\n  gke-app-onboarding instead).\nmetadata:\n  version: \"1.0.1\"\n  category: Containers\n---\n\n# GKE Batch & HPC Workloads\n\nThis reference covers running batch processing and high-performance computing\n(HPC) workloads on GKE.\n\n> **MCP Tools:** `apply_k8s_manifest`, `get_k8s_resource`,\n> `describe_k8s_resource`, `get_k8s_logs`, `delete_k8s_resource`,\n> `list_k8s_events`\n\n## Attribution\n\n**MUST READ**: Before executing any `gcloud`, REST API, or MCP command, you\nMUST read [Usage Attribution](references\/attribution.md). For commands executed\ndirectly in the terminal (never in generated scripts, Terraform, or user code),\nprefix `gcloud` with\n`CLOUDSDK_METRICS_REQUEST_ATTRIBUTION=\"agent-skills\/1.0 (skill:gke-batch-hpc)\"`\nand append `agent-skills\/1.0 (skill:gke-batch-hpc)` to `User-Agent` headers.\n\n## When to Use\n\n-   Running batch data processing pipelines\n-   HPC simulations (CFD, molecular dynamics, financial modeling)\n-   Large-scale parallel computation (MPI, MapReduce)\n-   ML training jobs\n-   CI\/CD build farms\n\n## Batch Processing on GKE\n\n### Kubernetes Jobs\n\n```yaml\napiVersion: batch\/v1\nkind: Job\nmetadata:\n  name: batch-job\nspec:\n  parallelism: 10\n  completions: 100\n  backoffLimit: 3\n  template:\n    spec:\n      containers:\n      - name: worker\n        image: <IMAGE>\n        resources:\n          requests:\n            cpu: \"1\"\n            memory: \"2Gi\"\n      restartPolicy: Never\n```\n\n### JobSet (for Complex Multi-Job Workflows)\n\nThe golden path enables JobSet monitoring (`JOBSET` in monitoringConfig).\n\n```yaml\napiVersion: jobset.x-k8s.io\/v1alpha2\nkind: JobSet\nmetadata:\n  name: training-job\nspec:\n  replicatedJobs:\n  - name: workers\n    replicas: 4\n    template:\n      spec:\n        parallelism: 1\n        completions: 1\n        template:\n          spec:\n            containers:\n            - name: worker\n              image: <IMAGE>\n              resources:\n                requests:\n                  cpu: \"4\"\n                  memory: \"8Gi\"\n```\n\n### Kueue (Job Queuing)\n\nKueue manages job scheduling and resource allocation for batch workloads:\n\n```bash\n# Install Kueue\nkubectl apply --server-side -f https:\/\/github.com\/kubernetes-sigs\/kueue\/releases\/latest\/download\/manifests.yaml\n```\n\n```yaml\n# Define a ClusterQueue\napiVersion: kueue.x-k8s.io\/v1beta1\nkind: ClusterQueue\nmetadata:\n  name: batch-queue\nspec:\n  namespaceSelector: {}\n  resourceGroups:\n  - coveredResources: [\"cpu\", \"memory\"]\n    flavors:\n    - name: default\n      resources:\n      - name: \"cpu\"\n        nominalQuota: 100\n      - name: \"memory\"\n        nominalQuota: \"200Gi\"\n---\n# Allow a namespace to use the queue\napiVersion: kueue.x-k8s.io\/v1beta1\nkind: LocalQueue\nmetadata:\n  name: batch-local\n  namespace: batch-jobs\nspec:\n  clusterQueue: batch-queue\n```\n\n## HPC on GKE\n\n### Compact Placement (Low-Latency Networking)\n\nFor tightly-coupled HPC workloads that need low-latency inter-node\ncommunication:\n\n```bash\n# Standard clusters: create node pool with compact placement\ngcloud container node-pools create hpc-pool \\\n  --cluster <CLUSTER_NAME> --region <REGION> \\\n  --machine-type c3-standard-44 \\\n  --placement-type COMPACT \\\n  --num-nodes 8 \\\n  --enable-autoscaling --min-nodes 0 --max-nodes 16 \\\n  --quiet\n```\n\n### MPI Workloads\n\nUse the MPI Operator for MPI-based HPC applications:\n\n```bash\n# Install MPI Operator\nkubectl apply -f https:\/\/raw.githubusercontent.com\/kubeflow\/mpi-operator\/master\/deploy\/v2beta1\/mpi-operator.yaml\n```\n\n```yaml\napiVersion: kubeflow.org\/v2beta1\nkind: MPIJob\nmetadata:\n  name: hpc-simulation\nspec:\n  slotsPerWorker: 4\n  mpiReplicaSpecs:\n    Launcher:\n      replicas: 1\n      template:\n        spec:\n          containers:\n          - name: launcher\n            image: <MPI_IMAGE>\n            command: [\"mpirun\", \"-np\", \"32\", \".\/simulation\"]\n            resources:\n              requests:\n                cpu: \"1\"\n                memory: \"2Gi\"\n              limits:\n                cpu: \"2\"\n                memory: \"4Gi\"\n    Worker:\n      replicas: 8\n      template:\n        spec:\n          containers:\n          - name: worker\n            image: <MPI_IMAGE>\n            resources:\n              requests:\n                cpu: \"4\"\n                memory: \"8Gi\"\n              limits:\n                cpu: \"8\"\n                memory: \"16Gi\"\n```\n\n## Cost Optimization for Batch\/HPC\n\n### Spot VMs for Batch\n\nBatch workloads are ideal Spot VM candidates (interruptible, can checkpoint).\nUse a ComputeClass with Spot-first priority and `activeMigration` to return to\nSpot when available. See the `gke-compute-classes` skill for the\nSpot-with-fallback pattern.\n\n### Scale-to-Zero\n\nFor batch clusters, allow node pools to scale to zero when no jobs are running:\n\n-   Autopilot (golden path): Automatic, nodes scale to zero when no pods are\n    scheduled\n-   Standard: Set `--min-nodes 0` on batch node pools\n\n## Best Practices & Production Guidelines\n\n-   **Resource Quotas**: Always specify resource requests and limits (CPU,\n    memory, and optionally GPU\/TPU) for all batch\/HPC manifests. This is\n    critical for Kueue admission, autoscaling, and preventing resource\n    starvation in the cluster.\n-   **TPU\/Spot Cluster Maintenance**: For long-running AI training runs on Spot\n    VMs\/TPUs, advise using **GKE maintenance exclusions** to block automatic\n    cluster upgrades\/reboots during the active training window to minimize\n    unnecessary preemption.\n-   **MPI Workloads**: Use the **Kubeflow Training Operator** to orchestrate\n    distributed MPI applications via the `MPIJob` custom resource.\n-   **Kueue & JobSet**: Use **Kueue** for multi-tenant job queueing and fair\n    sharing; use **JobSet** for multi-component tightly coupled workloads.\n-   **Resilience**: Always set a `backoffLimit` on Jobs, and implement\n    application-level checkpointing (e.g., using Orbax or PyTorch checkpointing)\n    to survive Spot VM preemption.\n","use_cases":["Running batch data processing pipelines","HPC simulations (CFD, molecular dynamics, financial modeling)","Large-scale parallel computation (MPI, MapReduce)","ML training jobs","CI\/CD build farms"],"limitations":[],"compatibility":[],"setup_tip":null,"sample_input":null,"sample_output":null,"source_url":"https:\/\/github.com\/google\/skills\/blob\/e3c591afe426ea585e4c21799e5199d6d47cd1be\/skills\/cloud\/gke-batch-hpc\/SKILL.md","source_commit":"e3c591afe426ea585e4c21799e5199d6d47cd1be","license":null,"version":null,"listing_approved_at":"2026-11-17","created_at":"2026-11-16T15:43:31.000000Z","updated_at":"2026-11-17T10:20:00.000000Z","seo_title":"Run Batch & HPC Workloads on GKE","seo_description":"Execute batch processing and HPC workloads on GKE with JobSets, MPI Jobs, and Kueue for efficient job scheduling and resource management.","seo_keywords":["Run batch workloads on GKE","HPC on Google Kubernetes Engine","Kueue job scheduling","MPI Jobs on GKE","GKE batch processing"]}}