gcluster job

NAME

gcluster job - manages jobs on the cluster.

SYNOPSIS

gcluster job COMMAND [FLAGS]

DESCRIPTION

The gcluster job command group lets you submit, cancel, list, and inspect workloads on Google Kubernetes Engine clusters.

PERSISTENT FLAGS

These flags are available to all commands:

  • -c, --cluster CLUSTER_NAME: The name of the GKE cluster.
  • -l, --location LOCATION: The location, either a region or a zone, of the GKE cluster.
  • -p, --project PROJECT_ID: The Google Cloud project ID.
  • --gke-namespace NAMESPACE: The target GKE namespace for the operation.
  • --skip-prereqs: Skips local environment prerequisite checks, such as gcloud, kubectl, and docker authentication.

COMMANDS

COMMAND is one of the following:

cancel
Cancels a job in the cluster.
config
Manages gcluster job configuration.
gke-template-extract
Extracts all default GKE templates to a local directory.
inspect
Inspects cluster health and workload status.
list
Lists workloads (jobs) in the cluster.
logs
Fetches logs for a job in the cluster.
submit
Submits a workload to a cluster. On GKE clusters, Cluster Toolkit deploys workloads as Kubernetes JobSets integrated with Kueue.

EXAMPLES

To submit a workload named train-job to a cluster:

gcluster job submit \
    --cluster=my-cluster \
    --location=us-central1-a \
    --name=train-job \
    --image=gcr.io/my-project/training:v1 \
    --command="python3 train.py"

To list all running jobs in a cluster:

gcluster job list \
    --cluster=my-cluster \
    --location=us-central1-a \
    --status=Running

To stream the logs for a specific job:

gcluster job logs train-job \
    --cluster=my-cluster \
    --location=us-central1-a \
    --follow

To cancel a running job:

gcluster job cancel train-job \
    --cluster=my-cluster \
    --location=us-central1-a

To configure default cluster settings so you don't need to pass them on each command:

gcluster job config set cluster my-cluster
gcluster job config set location us-central1-a