この文書は自動機械翻訳技術を使用して翻訳されています。 正確な翻訳を提供するように努めておりますが、翻訳された内容の完全性、正確性、信頼性については一切保証いたしません。 相違がある場合は、元の英語版 英語 が優先され、正式なテキストとなります。

Google Compute Engine クラウドプロバイダーのセットアップ

このセクションでは、Rancher のカスタムクラスター用に Google Compute Engine (GCE) クラウドプロバイダーを有効にする方法を学びます。カスタムクラスターとは、Rancher が既存のノードに Kubernetes をインストールするクラスターのことです。

GCE クラウドプロバイダーに関する公式の Kubernetes ドキュメントは こちらです。

前提条件:

GCE での Identity and API アクセスのサービスアカウントには Computer Admin 権限が必要です。

Calico を使用している場合、

  1. *☰ > クラスター管理*をクリックします。

  2. クラスター ページで、カスタムクラスターに移動し、*⋮ > YAML を編集 をクリックします。次の設定を入力してください:

     rancher_kubernetes_engine_config:
       cloud_provider:
         name: gce
         customCloudProvider: |-
           [Global]
           project-id=<your project ID, optional>
           network-name=<your network, optional if using default network>
           subnetwork-name=<your subnetwork of the above network, optional if using default network>
           node-instance-prefix=<your instance group name/your instance name specific prefix, required>
           node-tags=<your network tags, must patch one or some tags, required>
       network:
         options:
           calico_cloud_provider: "gce"
         plugin: "calico"

Canal または Flannel を使用している場合、

  1. *☰ > クラスター管理*をクリックします。

  2. クラスター ページで、カスタムクラスターに移動し、*⋮ > YAML を編集 をクリックします。次の設定を入力してください:

     rancher_kubernetes_engine_config:
       cloud_provider:
         name: gce
         customCloudProvider: |-
           [Global]
           project-id=<your project ID, optional>
           network-name=<your network, optional if using default network>
           subnetwork-name=<your subnetwork of the above network, optional if using default network>
           node-instance-prefix=<your instance group name/your instance name specific prefix, required>
           node-tags=<your network tags, must patch one or some tags, required>
       services:
         kube_controller:
           extra_args:
             configure-cloud-routes: true # we need to allow the cloud provider configure the routes for the hosts