NAME
gcluster job logs - fetches logs for a job in the cluster.
SYNOPSIS
gcluster job logs JOB_NAME [FLAGS]
DESCRIPTION
The gcluster job logs command fetches logs for a job running in the cluster.
POSITIONAL ARGUMENTS
JOB_NAME- The name of the job to fetch logs for.
FLAGS
-f,--follow: Streams logs continuously.--main-only: Fetches logs from only the default container in the rank-0 Pod (themain-joborpathways-headreplicated job forJobSetworkloads, or completion index0for standalonebatch/v1Jobworkloads). For jobs with more than 5 Pods, thegclusterCLI defaults to the--main-only=trueflag.
PERSISTENT FLAGS
These flags are available to all
gcluster job commands:
-c,--cluster CLUSTER_NAME: The name of the Google Kubernetes Engine (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.
EXAMPLES
To fetch logs for a job named train-job:
gcluster job logs train-job \
--project=my-project \
--cluster=my-cluster \
--location=us-central1-a
To continuously stream logs for a job:
gcluster job logs train-job \
--project=my-project \
--cluster=my-cluster \
--location=us-central1-a \
--follow