Creating a VPC

VPC in GCP is like AWS, but there's no need to bind a particular region, and also no need to set the CIDR address range. This means you can create a VPC that covers all regions. By default, your Kubernetes Cookbook project has a default VPC.

However, for a better understanding, let's create a new VPC by following these steps:

  1. Run the gcloud compute networks command to create a new VPC. The name is chap7 and subnet-mode is custom, which means subnets are not created automatically. So we will add it manually in the next step:
$ gcloud compute networks create chap7 --subnet-mode=custom
  1. Check the VPC list; you should have two VPCs, default VPC and chap7 VPC:
$ gcloud compute networks list
NAME SUBNET_MODE BGP_ROUTING_MODE IPV4_RANGE GATEWAY_IPV4
chap7 CUSTOM REGIONAL
default AUTO REGIONAL
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset