[[["易于理解","easyToUnderstand","thumb-up"],["解决了我的问题","solvedMyProblem","thumb-up"],["其他","otherUp","thumb-up"]],[["很难理解","hardToUnderstand","thumb-down"],["信息或示例代码不正确","incorrectInformationOrSampleCode","thumb-down"],["没有我需要的信息/示例","missingTheInformationSamplesINeed","thumb-down"],["翻译问题","translationIssue","thumb-down"],["其他","otherDown","thumb-down"]],["最后更新时间 (UTC):2024-05-08。"],[[["\u003cp\u003eThis page demonstrates the use of \u003ccode\u003egcloud container bare-metal clusters create\u003c/code\u003e to set up a Google Distributed Cloud user cluster.\u003c/p\u003e\n"],["\u003cp\u003eAfter creating the user cluster, you must utilize \u003ccode\u003egcloud container bare-metal node-pools create\u003c/code\u003e to establish at least one node pool.\u003c/p\u003e\n"],["\u003cp\u003eThe examples provided showcase cluster creation using MetalLB and manual load balancer configurations, each with distinct command structures.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003egcloud\u003c/code\u003e commands include settings that map to the cluster and node pool configuration file, however, IP addresses and CIDR ranges in the example must be replaced.\u003c/p\u003e\n"],["\u003cp\u003eYou can utilize the \u003ccode\u003e--metal-lb-load-balancer-node-configs\u003c/code\u003e flag to run the load balancer on specific nodes, or \u003ccode\u003e--enable-manual-lb\u003c/code\u003e to enable a manual load balancer configuration.\u003c/p\u003e\n"]]],[],null,["# Examples using the gcloud CLI to create a user cluster\n\n\u003cbr /\u003e\n\nThis page provides examples of using the command\n`gcloud container bare-metal clusters create` to create an\nGoogle Distributed Cloud user cluster. After creating the user cluster, you\nneed to create at least one node pool. You can use the command\n`gcloud container bare-metal node-pools create` to\n[create a node pool](#create_a_node_pool). Most of the settings that the\ncommands take correspond to fields in the cluster and node pool\n[configuration file](/anthos/clusters/docs/bare-metal/1.16/reference/cluster-config-ref).\n| **Important:** These are examples. You must replace the IP addresses and CIDR ranges with values from your network.\n\nFor descriptions of the flags, see the following:\n\n- [Create a user cluster](/anthos/clusters/docs/bare-metal/1.16/installing/creating-clusters/create-user-cluster-api#create_a_user_cluster)\n- [The gcloud CLI reference](/sdk/gcloud/reference/beta/container/bare-metal)\n\nExamples creating a cluster\n---------------------------\n\n### MetalLB\n\n```\ngcloud container bare-metal clusters create user-cluster-1 \\\n --project=example-project-12345 \\\n --location=europe-west1 \\\n --admin-cluster-membership=projects/example-project-12345/locations/global/memberships/admin-cluster-1 \\\n --version=1.16.8 \\\n --admin-users=sara@example.com \\\n --admin-users=amal@example.com \\\n --island-mode-service-address-cidr-blocks=10.96.0.0/20 \\\n --island-mode-pod-address-cidr-blocks=192.168.0.0/16 \\\n --metal-lb-address-pools='pool=pool1,avoid-buggy-ips=True,manual-assign=True,addresses=10.251.134.80/32;10.251.133.0/24;10.251.131.70-10.251.131.74' \\\n --control-plane-node-configs='node-ip=10.200.0.10' \\\n --control-plane-node-configs='node-ip=10.200.0.11,labels=key2.1=value2.1' \\\n --control-plane-node-configs='node-ip=10.200.0.12,labels=key3.1=value3.1;key3.2=value3.2' \\\n --control-plane-node-labels=cp-node-pool-key=cp-node-pool-value \\\n --control-plane-node-taints=dedicated=experimental:PreferNoSchedule \\\n --control-plane-vip=172.16.20.61 \\\n --control-plane-load-balancer-port=443 \\\n --ingress-vip=10.251.134.80 \\\n --lvp-share-path=/mnt/localpv-share \\\n --lvp-share-storage-class=local-shared \\\n --lvp-node-mounts-config-path=/mnt/localpv-disk \\\n --lvp-node-mounts-config-storage-class=local-disks\n```\n\nOptionally, you can include the `--metal-lb-load-balancer-node-configs` flag\nif you need to run the load balancer on a dedicated pool of worker nodes.\nFor details see\n[MetalLB nodes](/anthos/clusters/docs/bare-metal/1.16/installing/creating-clusters/create-user-cluster-api#metal_lb_nodes).\n\n### Manual load balancer\n\n```\ngcloud container bare-metal clusters create user-cluster-2 \\\n --project=example-project-12345 \\\n --location=europe-west1 \\\n --admin-cluster-membership=projects/example-project-12345/locations/global/memberships/admin-cluster-1 \\\n --version=1.16.8 \\\n --admin-users=sara@example.com \\\n --admin-users=amal@example.com \\\n --island-mode-service-address-cidr-blocks=10.96.0.0/20 \\\n --island-mode-pod-address-cidr-blocks=192.168.0.0/16 \\\n --enable-manual-lb \\\n --control-plane-node-configs='node-ip=10.200.0.10' \\\n --control-plane-node-configs='node-ip=10.200.0.11,labels=key2.1=value2.1' \\\n --control-plane-node-configs='node-ip=10.200.0.12,labels=key3.1=value3.1;key3.2=value3.2' \\\n --control-plane-node-labels=cp-node-pool-key=cp-node-pool-value \\\n --control-plane-node-taints=dedicated=experimental:PreferNoSchedule \\\n --control-plane-vip=172.16.20.61 \\\n --control-plane-load-balancer-port=443 \\\n --ingress-vip=10.251.134.80 \\\n --lvp-share-path=/mnt/localpv-share \\\n --lvp-share-storage-class=local-shared \\\n --lvp-node-mounts-config-path=/mnt/localpv-disk \\\n --lvp-node-mounts-config-storage-class=local-disks\n```\n\nCreate a node pool\n------------------\n\nAfter the cluster is created, you can use the\n`gcloud container bare-metal node-pools create` command to create a\nnode pool:\n\n```\ngcloud container bare-metal node-pools create default-pool \\\n --cluster=user-cluster-1 \\\n --project=example-project-12345 \\\n --location=us-west1 \\\n --node-configs='node-ip=10.200.0.10' \\\n --node-configs='node-ip=10.200.0.11,labels=key2.1=value2.1' \\\n --node-labels=node-pool-key=node-pool-value \\\n --node-taints=dedicated=experimental:PreferNoSchedule\n```\n\nFor descriptions of the flags, see\n[Create a node pool](/anthos/clusters/docs/bare-metal/1.16/installing/creating-clusters/create-user-cluster-api#create_the_cluster_and_node_pools).\n\nWhat's next\n-----------\n\n- [Create a user cluster](/anthos/clusters/docs/bare-metal/1.16/installing/creating-clusters/create-user-cluster-api#create_a_user_cluster)\n- [The gcloud CLI reference](/sdk/gcloud/reference/beta/container/bare-metal)"]]