GKE で Ray クラスタをデプロイして管理する場合は、Ray オペレーターを使用することをおすすめします。GKE で Ray オペレーターを実行すると、Ray の Python サポートと GKE のエンタープライズ グレードの信頼度、ポータビリティ、スケーラビリティを利用できます。
GKE の Ray オペレーターは KubeRay に基づいています。KubeRay は、Ray クラスタの管理用に特別に設計された宣言型 Kubernetes API を提供します。つまり、GKE 上の他のコンテナ化されたワークロードを使用して Ray Deployment をプロビジョニング、スケーリング、管理できます。
GKE で Ray オペレーターが機能する仕組み
GKE クラスタで Ray オペレーターを有効にすると、GKE は KubeRay オペレーターを自動的にインストールしてホストします。
KubeRay は、Kubernetes 上の Ray Deployment を管理するための Kubernetes カスタム リソースを提供します。たとえば、次のようなものがあります。
[[["わかりやすい","easyToUnderstand","thumb-up"],["問題の解決に役立った","solvedMyProblem","thumb-up"],["その他","otherUp","thumb-up"]],[["わかりにくい","hardToUnderstand","thumb-down"],["情報またはサンプルコードが不正確","incorrectInformationOrSampleCode","thumb-down"],["必要な情報 / サンプルがない","missingTheInformationSamplesINeed","thumb-down"],["翻訳に関する問題","translationIssue","thumb-down"],["その他","otherDown","thumb-down"]],["最終更新日 2025-09-01 UTC。"],[],[],null,["# About Ray on Google Kubernetes Engine (GKE)\n\n[Autopilot](/kubernetes-engine/docs/concepts/autopilot-overview) [Standard](/kubernetes-engine/docs/concepts/choose-cluster-mode)\n\n*** ** * ** ***\n\nThis page provides an overview of the Ray Operator and relevant custom\nresources to deploy and manage Ray clusters and applications on\nGoogle Kubernetes Engine (GKE).\n\n[Ray](https://www.ray.io/) is an open-source unified compute framework for\nscaling AI/ML and Python applications. Ray provides a set of libraries to\ndistribute the compute runtime for AI/ML across multiple compute nodes.\n\nTo learn how to enable the Ray operator on GKE, see\n[Enable the Ray operator on GKE](/kubernetes-engine/docs/add-on/ray-on-gke/how-to/enable-ray-on-gke).\n\nWhy use the Ray Operator on GKE\n-------------------------------\n\nThe Ray Operator is the recommended way to deploy and manage Ray clusters on\nGKE. When you run the Ray Operator on GKE, you\nbenefit from Ray's support for Python and GKE's enterprise-grade\nreliability, portability, and scalability.\n\nThe Ray Operator on GKE is based on\n[KubeRay](https://github.com/ray-project/kuberay), which provides\ndeclarative Kubernetes APIs specifically designed for managing Ray clusters.\nThis means that you can provision, scale, and manage your Ray Deployments with\nother containerized workloads on GKE.\n\nHow the Ray Operator on GKE works\n---------------------------------\n\nWhen you enable the Ray Operator in your GKE clusters,\nGKE automatically installs and hosts the KubeRay operator.\n\nKubeRay provides Kubernetes custom resources to manage Ray Deployments\non Kubernetes, including:\n\n- [RayCluster](#raycluster)\n- [RayJob](#rayjob)\n- [RayService](#rayservice)\n\n### RayCluster custom resource\n\nThe RayCluster custom resource lets you specify a Ray cluster that\nGKE deploys as Kubernetes Pods. A Ray cluster typically consists\nof a single head Pod and multiple worker Pods.\n\n### RayJob custom resource\n\nThe RayJob custom resource lets you execute a single Ray job. KubeRay\ncreates a RayCluster to provide compute resources for the job, then creates a\nKubernetes Job that submits the Ray job to the head Pod of the RayCluster.\n\nFor efficient resource management, you can configure KubeRay to\nautomatically clean up the RayCluster after your job is successfully completed.\n\n### RayService custom resource\n\nThe RayService custom resource lets you configure\n[Ray Serve applications](https://docs.ray.io/en/latest/serve/index.html),\nsuch as applications for model serving and inference. KubeRay creates a\nRayCluster to provide the compute resources and then deploys the Ray Serve\napplication as specified by the Ray Serve configuration.\n\nRay on GKE shared responsibility\n--------------------------------\n\nWhen you choose to run Ray workloads on GKE with the Ray operator, it's\nimportant to understand how responsibilities are divided between Google Cloud\nand you, the customer:\n\n### Google's responsibilities\n\n- Maintaining the reliability and uptime of the KubeRay operator.\n- Managing version upgrades for the KubeRay operator.\n- Capabilities specific to KubeRay for managing the RayCluster, RayJob, and RayService custom resources.\n\n### Customer's responsibilities\n\n- Maintaining container images used for the Ray head and Ray worker Pods.\n- Maintaining versioning and upgrades for the Ray head and Ray worker Pods.\n- Configuring resource requirements (CPU, GPU, memory, etc.) for your Ray clusters.\n- Following best practices for [securing Ray clusters](https://docs.ray.io/en/latest/ray-security/index.html).\n- Reliability and monitoring for your Ray applications.\n\nSee [GKE shared responsibility](/kubernetes-engine/docs/concepts/shared-responsibility) to learn more.\n\nWhat's next\n-----------\n\n- Learn how to [Enable the Ray operator on GKE](/kubernetes-engine/docs/add-on/ray-on-gke/how-to/enable-ray-on-gke).\n- Explore the [Ray on Kubernetes](https://docs.ray.io/en/latest/cluster/kubernetes/index.html) documentation."]]