If you want to use the Google Cloud CLI for this task,
install and then
initialize the
gcloud CLI. If you previously installed the gcloud CLI, get the latest
version by running gcloud components update.
CLUSTER_LOCATION: the Compute Engine location of the control plane of your cluster. Provide a region for regional clusters, or a zone for zonal clusters.
The query returns logs related to the Ray Operator addon, such as the status of the Ray cluster, the creation of the Ray resources, and the reconciliation of the Ray resources.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-09-04 UTC."],[],[],null,["# View Ray Operator logs on GKE\n\n[Autopilot](/kubernetes-engine/docs/concepts/autopilot-overview) [Standard](/kubernetes-engine/docs/concepts/choose-cluster-mode)\n\n*** ** * ** ***\n\nThis page shows you how to read Ray Operator logs on Google Kubernetes Engine (GKE) using Cloud Logging when you use the Ray Operator on GKE.\n\nBefore you begin\n----------------\n\nBefore you start, make sure that you have performed the following tasks:\n\n- Enable the Google Kubernetes Engine API.\n[Enable Google Kubernetes Engine API](https://console.cloud.google.com/flows/enableapi?apiid=container.googleapis.com)\n- If you want to use the Google Cloud CLI for this task, [install](/sdk/docs/install) and then [initialize](/sdk/docs/initializing) the gcloud CLI. If you previously installed the gcloud CLI, get the latest version by running `gcloud components update`. **Note:** For existing gcloud CLI installations, make sure to set the `compute/region` [property](/sdk/docs/properties#setting_properties). If you use primarily zonal clusters, set the `compute/zone` instead. By setting a default location, you can avoid errors in the gcloud CLI like the following: `One of [--zone, --region] must be supplied: Please specify location`. You might need to specify the location in certain commands if the location of your cluster differs from the default that you set.\n\n\u003c!-- --\u003e\n\n- [Enable the Ray Operator for Google Kubernetes Engine (GKE)](/kubernetes-engine/docs/add-on/ray-on-gke/how-to/enable-ray-on-gke).\n\n### Requirements and limitations\n\nRay Operator logs are available on GKE cluster versions 1.33.1-gke.1231000 or later.\n\nView Ray operator logs\n----------------------\n\nWhen enabling the Ray Operator on GKE, the operator logs are automatically available in Cloud Logging.\n\nTo view the logs, follow these steps:\n\n1. In the Google Cloud console, go to the Logs Explorer page.\n\n [**Open the Logs Explorer**](https://console.cloud.google.com/logs)\n2. Open the query editor. In the query editor, enter your expression and click **Run query**.\n\n You can use the following example query in the Logs Explorer: \n\n resource.type=\"k8s_control_plane_component\"\n resource.labels.cluster_name=\"\u003cvar translate=\"no\"\u003eCLUSTER_NAME\u003c/var\u003e\"\n resource.labels.location=\"\u003cvar translate=\"no\"\u003eCLUSTER_LOCATION\u003c/var\u003e\"\n logName=\"projects/\"\u003cvar translate=\"no\"\u003ePROJECT_NAME\u003c/var\u003e\"/logs/container.googleapis.com%2Fray-operator\"\n\n Replace the following values:\n - \u003cvar translate=\"no\"\u003eCLUSTER_NAME\u003c/var\u003e: the name of your GKE cluster.\n - \u003cvar translate=\"no\"\u003eCLUSTER_LOCATION\u003c/var\u003e: the Compute Engine [location](/compute/docs/regions-zones#available) of the control plane of your cluster. Provide a region for regional clusters, or a zone for zonal clusters.\n - \u003cvar translate=\"no\"\u003ePROJECT_NAME\u003c/var\u003e: your Google Cloud [project ID](/resource-manager/docs/creating-managing-projects#identifying_projects).\n\n The query returns logs related to the Ray Operator addon, such as the status of the Ray cluster, the creation of the Ray resources, and the reconciliation of the Ray resources."]]