Google Compute Engine クラウドプロバイダーのセットアップ
このセクションでは、Rancher のカスタムクラスター用に Google Compute Engine (GCE) クラウドプロバイダーを有効にする方法を学びます。カスタムクラスターとは、Rancher が既存のノードに Kubernetes をインストールするクラスターのことです。
GCE クラウドプロバイダーに関する公式の Kubernetes ドキュメントは こちらです。
|
前提条件:
GCE での |
Calico を使用している場合、
-
*☰ > クラスター管理*をクリックします。
-
クラスター ページで、カスタムクラスターに移動し、*⋮ > 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 を使用している場合、
-
*☰ > クラスター管理*をクリックします。
-
クラスター ページで、カスタムクラスターに移動し、*⋮ > 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