
上QQ阅读APP看书,第一时间看更新
Provisioning a highly available Kubernetes cluster on Alibaba Cloud
Let's perform the following steps:
- Open a browser window and go to the Alibaba Cloud Virtual Private Cloud console at https://vpc.console.aliyun.com.
- Make sure you select a region with at least three zones (most of the regions in mainland China have more than three zones) and click on Create VPC.
- Give a unique name to your VPC and select an IPv4 CIDR block. In our example, this is 10.0.0.0/8.
- Enter a name for your first VSwitch ( k8s-1), and select a zone (Beijing Zone A).
- Set an IPv4 CIDR block. In our example, we used 10.10.0.0./16.
- Click on the Add button and repeat steps 4 and 5 to get different zones. Use the following CIDR block information:
VSwitch 2 VSwitch 3
Name: k8s-2 k8s-3
Zone: Beijing Zone B Beijing Zone E
IPv4 CIDR Block: 10.20.0.0/16 10.30.0.0/16
- Click OK to create your VPC and VSwitches.
- Open the Aliyun Web console on your web browser (https://cs.console.aliyun.com.).
- Click on Create Kubernetes Cluster.
- Select Standard Managed Cluster.
- Click on the Multi-AZ Kubernetes tab, give your cluster a name, and select the same region that you used to create your VPCs and VSwitches.
- If you have selected the same region, the VPC dropdown will be populated with k8s-devops-cookbook-vpc. Now, select all three VSwitches that we've created:
- Set the instance types for the Master node configuration in each zone.
- Set the instance type for the Worker node configuration in each zone and the number of nodes in every zone to 3. Otherwise, use the defaults.
- Select the Kubernetes version (1.12.6-aliyun.1, at the time of writing).
- Select Key Pair Name from the drop-down menu, or create one by clicking Create a new key pair:
- Alibaba offers two CNI options: Flannel and Terway. The difference is explained in the There's more… section of this recipe. Leave the default network options using Flannel. The default parameters support up to 512 servers in the cluster.
- Monitoring and logging will be explained in Chapter 8, Observability and Monitoring on Kubernetes, and Chapter 10, Logging on Kubernetes. Therefore, this step is optional. Check the Install cloud monitoring plug-in on your ECS and Using Log Service options to enable monitoring and logging.
- Now, click on Create to provision your Multi-AZ Kubernetes cluster. This step may take 15-20 minutes to complete.