如何将托管实例组添加到目标池?

use*_*717 4 google-compute-engine gcloud gce-instance-group

如何将自动扩展托管实例组添加到目标池?

通过以下方式将现有实例添加到目标池非常容易

$ gcloud compute target-pools create mypool --region us-central1
$ gcloud compute target-pools add-instances mypool \
   --instances existing-instance1 existing-instance2 --zone us-central1-b
Run Code Online (Sandbox Code Playgroud)

但是,我希望自动扩展组中出现的所有实例都自动添加到我的目标池中。

Fai*_*zan 5

您可以使用gcloudcomputeinstance-groups Managed set-target-pools命令为现有托管实例组设置目标池。您可以参考此链接了解更多信息。