在GCP和Azure上使用Kubernetes的指南
1. GKE多区域集群
GKE支持多区域集群,允许在同一区域的多个区域中启动Kubernetes节点。之前的示例中,Kubernetes节点仅在asia-northeast1-a区域配置,现在我们重新配置一个包含asia-northeast1-a、asia-northeast1-b和asia-northeast1-c三个区域的集群。
操作步骤如下:
1. 删除之前的集群:
$ gcloud container clusters delete my-k8s-cluster --zone asia-northeast1-a- 创建一个新的多区域集群,每个区域有2个节点:
$ gcloud container clusters create my-k8s-cluster --machine-type f1-micro -num-nodes 2 --network my-custom-network --subnetwork subnet-c --tags private --zone asia-northeast1-a --node-locations asia-northeast1-a,asia-northeast1-b,asia-northeast1-c