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 (GKE) and Kubernetes clusters.
PERSISTENT FLAGS
These flags are available to all commands:
-c,--cluster CLUSTER_NAME: The name of the GKE cluster or Kuberneteskubeconfigcontext. Optional in Kubernetes mode when thecurrent-contextfield is set.-l,--location LOCATION: The location, either a region or a zone, of the GKE cluster (GKE only).-p,--project PROJECT_ID: The Google Cloud project ID (GKE only).--gke-namespace NAMESPACE: The target Kubernetes namespace for the operation. If you omit this flag, then thegclusterCLI detects the namespace automatically.--skip-prereqs: Skips local environment prerequisite checks, such askubectlandgcloudchecks, and container registry authentication for Crane builds.
ENVIRONMENT VARIABLES
You can customize gcluster job command behavior with the following environment
variables:
GCLUSTER_AIR_GAPPED: Set totrue(or1,yes,on) in disconnected environments to skip live API server version probes, outbound GitHub add-on installations, Cloud Storage pre-flight checks, and CLI telemetry uploads for the current command.GCLUSTER_DISABLE_JOBSET: Set to1(ortrue,yes,on) to bypass theJobSetAPI acrossgcluster jobcommands and submit single-slice, non-Pathways workloads as a standalonebatch/v1IndexedJoband headlessService.GCLUSTER_DISABLE_KUEUE: Set to1(ortrue,yes,on) to skip Kueue installation and queueing and omit thekueue.x-k8s.io/queue-namelabel.GCLUSTER_IMAGE_REPO: The destination repository for Crane--build-contextbuilds. Set an Artifact Registry repository name or a fullREGISTRY_HOST/REPOSITORYOpen Container Initiative (OCI) prefix.GCLUSTER_INSECURE_REGISTRY: Set totrueor1to allow plain HTTP or self-signed Transport Layer Security (TLS) for custom or local OCI registries during--build-contextbuilds. Ignored for Artifact Registry and public cloud registries.GCLUSTER_ORCHESTRATOR: Set togkeork8sto override automatickubeconfigorchestrator detection.GCLUSTER_REFRESH_CREDENTIALS: Set to1to run thegcloud container clusters get-credentialscommand before each command instead of reusing a verifiedkubeconfigcontext.GCLUSTER_TELEMETRY_IMAGE: The default container image for the built-in ML Diagnostics collector sidecar when the--enable-ml-diagnosticsflag is set without the--ml-diagnostics-imageflag.
COMMANDS
COMMAND is one of the following:
cancel- Cancels a job in the cluster.
config- Manages configuration for the
gcluster jobcommand group. gke-template-extract- Extracts all default GKE templates to a local directory.
inspect- Inspects cluster health and workload status.
list- Lists workloads 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
JobSetresources integrated with Kueue, or falls back to a standalonebatch/v1IndexedJobwhen theJobSetAPI isn't available or is disabled.
EXAMPLES
To submit a workload named train-job to a cluster:
gcluster job submit \
--project=my-project \
--cluster=my-cluster \
--location=us-central1-a \
--name=train-job \
--compute-type=n2-standard-32 \
--image=us-docker.pkg.dev/my-project/my-repo/training:v1 \
--command="python3 train.py"
To list all running jobs in a cluster:
gcluster job list \
--project=my-project \
--cluster=my-cluster \
--location=us-central1-a \
--status=Running
To stream the logs for a specific job:
gcluster job logs train-job \
--project=my-project \
--cluster=my-cluster \
--location=us-central1-a \
--follow
To cancel a running job:
gcluster job cancel train-job \
--project=my-project \
--cluster=my-cluster \
--location=us-central1-a
To configure default project and cluster settings so that you don't need to pass them on each command:
gcluster job config set project my-project
gcluster job config set cluster my-cluster
gcluster job config set location us-central1-a