Version 1.14. This version is no longer supported. For information about how to upgrade to version 1.15, see Upgrading Anthos on bare metal in the 1.15 documentation. For more information about supported and unsupported versions, see the Version history page in the latest documentation.
This page provides examples of using the command
gcloud container bare-metal clusters create to create an
Google Distributed Cloud user cluster. After creating the user cluster, you
need to create at least one node pool. You can use the command
gcloud container bare-metal node-pools create to
create a node pool. Most of the settings that the
commands take correspond to fields in the cluster and node pool
configuration file.
Optionally, you can include the --metal-lb-load-balancer-node-configs flag
if you need to run the load balancer on a dedicated pool of worker nodes.
For details see
MetalLB nodes.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-09-04 UTC."],[[["\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, which is required before creating any node pools.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003egcloud container bare-metal node-pools create\u003c/code\u003e command is used to establish a node pool within an existing user cluster, and examples of its usage are included.\u003c/p\u003e\n"],["\u003cp\u003eTwo methods of cluster configuration are detailed: one using MetalLB for load balancing and another using a manual load balancer setup.\u003c/p\u003e\n"],["\u003cp\u003eThe commands provided require users to substitute example IP addresses and CIDR ranges with values specific to their network environment, as indicated by an important notice.\u003c/p\u003e\n"],["\u003cp\u003eMost of the settings within the commands are directly linked to specific fields in the cluster and node pool configuration files, offering a correspondence between CLI commands and configuration settings.\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.14/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.14/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.14.11 \\\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.14/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.14.11 \\\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.14/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.14/installing/creating-clusters/create-user-cluster-api#create_a_user_cluster)\n- [The gcloud CLI reference](/sdk/gcloud/reference/beta/container/bare-metal)"]]