このフィールドは省略できます。 このフィールドの値を設定して、ピアリングされたネットワークの割り当て範囲内で VM を割り当てることができる内部 IP 範囲を指定します。サイズ制限や無効な開始 IP などのために、指定された IP 範囲をプライベート接続の範囲内で割り当てることができない場合は、プライベート プールを作成できません。
peeredNetworkIpRange は、'STARTING_IP/SUBNET_PREFIX_SIZE' 形式のクラスレス ドメイン間ルーティング(CIDR)表記を使用して指定します。このフィールドを使用する場合は、SUBNET_PREFIX_SIZE を指定する必要があります。SUBNET_PREFIX_SIZE は IP 範囲のサイズを決定します。先頭はスラッシュ(/)にしてください。値は 29 以下でなければなりません。STARTING_IP 部分は省略可能です。範囲の開始アドレスを指定します。STARTING_IP を指定しない場合、開始アドレスはプライベート接続範囲内から自動的に割り当てられます。peeredNetworkIpRange に値が指定されていない場合、デフォルト値 /24 が使用され、256 個の IP の範囲で開始 IP が自動的に割り当てられます。
SUBNET_PREFIX_SIZE の値は 29 以下にする必要があります。数値が大きいほどサブネットの接頭辞が大きくなり、使用できる IP 数が少なくなり、結果的に IP 範囲が小さくなります。IP アドレスが 32 ビットであるため、接頭辞のサイズが /24 の場合、範囲内の使用可能な IP の数は 256 個(8 ビット)ですが、プレフィックス サイズが /29 の場合、使用可能な IP の数は 8 個(3 ビット)になります。ビルダー VM の最大数は、範囲内の使用可能な IP の数に限定されます(範囲内の使用可能な IP の合計数 から 2 を引いた値)。
peeredNetworkIpRange フィールドの例については、以下をご覧ください。
192.168.0.0/24 は、サブネット接頭辞サイズが 24 の 192.168.0.0 から始まる IP 範囲を指定します(IP が 256、使用可能な IP が 254)。
/29 では、自動的に決定される開始 IP とサブネット接頭辞のサイズが 29(8 つの IP、6 つの使用可能な IP)で範囲を指定します。
[[["わかりやすい","easyToUnderstand","thumb-up"],["問題の解決に役立った","solvedMyProblem","thumb-up"],["その他","otherUp","thumb-up"]],[["わかりにくい","hardToUnderstand","thumb-down"],["情報またはサンプルコードが不正確","incorrectInformationOrSampleCode","thumb-down"],["必要な情報 / サンプルがない","missingTheInformationSamplesINeed","thumb-down"],["翻訳に関する問題","translationIssue","thumb-down"],["その他","otherDown","thumb-down"]],["最終更新日 2025-06-14 UTC。"],[[["\u003cp\u003eA private pool config file is essential for defining the specifications of a private pool in Cloud Build, including disk size and machine type.\u003c/p\u003e\n"],["\u003cp\u003eThe private pool config file can be written in either YAML or JSON format, but when using \u003ccode\u003ecurl\u003c/code\u003e it must be in JSON.\u003c/p\u003e\n"],["\u003cp\u003e\u003ccode\u003enetworkConfig\u003c/code\u003e is an optional setting for private pools that enables peering with a VPC network, requiring \u003ccode\u003epeeredNetwork\u003c/code\u003e to be defined and allowing \u003ccode\u003epeeredNetworkIpRange\u003c/code\u003e for IP range customization.\u003c/p\u003e\n"],["\u003cp\u003e\u003ccode\u003eworkerConfig\u003c/code\u003e is required to specify the setup of your private pool and to use optional fields such as \u003ccode\u003ediskSizeGb\u003c/code\u003e for disk size configuration and \u003ccode\u003emachineType\u003c/code\u003e to determine the type of Compute Engine.\u003c/p\u003e\n"],["\u003cp\u003eWhen setting a \u003ccode\u003epeeredNetworkIpRange\u003c/code\u003e subnet prefix it must not exceed 29, with a larger number resulting in a smaller number of useable IP's.\u003c/p\u003e\n"]]],[],null,["# Private pool configuration file schema\n\nA private pool configuration file (private pool config file) contains\ninstructions for Cloud Build to create a private pool based on\nyour specifications. A private pool config file contains information such as the\ndisk size and machine type you want to use for your private pool. The\nprivate pool config file is required when you create and manage private pools\nusing the `gcloud` tool or the Cloud Build API.\n| **Note:** The private pool config file is different from the [Cloud Build configuration file](/build/docs/build-config): the Cloud Build config file lets you configure your build whereas the private pool config file lets you configure your private pool.\n\nStructure of a private pool config file\n---------------------------------------\n\nYou can write the private pool config file using the YAML or the JSON\nsyntax. To create and manage private pools using `curl`, write\nthe private pool config file in the JSON format. To create and manage private\npools using the `gcloud` tool, write the private pool config file in the\nYAML or the JSON format.\n\nA private pool config file has the following structure: \n\n### YAML\n\n privatePoolV1Config:\n networkConfig:\n egressOption: NO_PUBLIC_EGRESS\n peeredNetwork: '\u003cvar translate=\"no\"\u003ePEERED_NETWORK\u003c/var\u003e'\n peeredNetworkIpRange: '\u003cvar translate=\"no\"\u003ePEERED_NETWORK_IP_RANGE\u003c/var\u003e'\n workerConfig:\n diskSizeGb: '\u003cvar translate=\"no\"\u003ePRIVATE_POOL_DISK_SIZE\u003c/var\u003e'\n machineType: \u003cvar translate=\"no\"\u003e\u003cspan class=\"devsite-syntax-l devsite-syntax-l-Scalar devsite-syntax-l-Scalar-Plain\"\u003ePRIVATE_POOL_MACHINE_TYPE\u003c/span\u003e\u003c/var\u003e\n\n### JSON\n\n {\n \"privatePoolV1Config\": {\n \"networkConfig\": {\n \"egressOption\": \"NO_PUBLIC_EGRESS\",\n \"peeredNetwork\": \"\u003cvar translate=\"no\"\u003ePEERED_NETWORK\u003c/var\u003e\",\n \"peeredNetworkIpRange\": \"\u003cvar translate=\"no\"\u003ePEERED_NETWORK_IP_RANGE\u003c/var\u003e\"\n },\n \"workerConfig\": {\n \"diskSizeGb\": \"\u003cvar translate=\"no\"\u003ePRIVATE_POOL_DISK_SIZE\u003c/var\u003e\",\n \"machineType\": \"\u003cvar translate=\"no\"\u003ePRIVATE_POOL_MACHINE_TYPE\u003c/var\u003e\"\n }\n }\n }\n\nThe fields in the private pool config file are explained as follows:\n\n`networkConfig`\n---------------\n\nThis is an optional field. Specify `networkConfig` only if you're peering your\nVPC network with the service producer network.\n\n### `egressOption`\n\nThis is an optional field. Set the value of this field to `NO_PUBLIC_EGRESS` if\nyou're creating your private pool within a VPC Service Controls perimeter. If you\ndon't include this field in the private pool config file, public egress is enabled.\nFor information on setting up VPC Service Controls for private pools, see\n[Using VPC Service Controls](/build/docs/private-pools/using-vpc-service-controls).\n\n### `peeredNetwork`\n\nThis is a required field if your private pool config file contains the `networkConfig`\nfield. Set the value of this field to the network\nresource URL of the VPC network that is peered to the service\nproducer network. The network resource URL must be of the format\n`projects/`\u003cvar translate=\"no\"\u003eNETWORK_PROJECT_ID\u003c/var\u003e`/global/networks/`\u003cvar translate=\"no\"\u003eNETWORK_NAME\u003c/var\u003e,\nwhere \u003cvar translate=\"no\"\u003eNETWORK_PROJECT_ID\u003c/var\u003e is the project ID of\nthe Google Cloud project that holds your VPC network and\n\u003cvar translate=\"no\"\u003eNETWORK_NAME\u003c/var\u003e is the name of your VPC network.\nIf you don't specify a value, Cloud Build uses the [service producer\nnetwork](/build/docs/private-pools/set-up-private-pool-environment) by default.\n\n### `peeredNetworkIpRange`\n\nThis is an optional field. Set the value of this field to specify the internal\nIP range that VMs can be assigned to within the peered network's allocated\nrange. If the specified IP range can't be allocated within the range of the\nprivate connection, for example due to size limitations or an invalid starting\nIP, then the private pool can't be created.\n\n`peeredNetworkIpRange` is specified using Classless Inter-Domain Routing (CIDR)\nnotation in the format `'STARTING_IP/SUBNET_PREFIX_SIZE'`.\nIf this field is used, then `SUBNET_PREFIX_SIZE` must be specified.\n`SUBNET_PREFIX_SIZE` determines the size of the IP range. It must begin with a\nslash (`/`) and have a value less than or equal to 29.The `STARTING_IP` portion\nis optional, and specifies the starting address of the range. If the\n`STARTING_IP` is not specified, then a starting address is automatically\nassigned from within the private connection range. If no value is specified for\n`peeredNetworkIpRange`, a default value of `/24` will be used which\nautomatically assigns a starting IP with a range of 256 IPs.\n\nThe value of `SUBNET_PREFIX_SIZE` must not exceed 29. A larger number specifies\na larger subnet prefix, which would leave fewer possible IPs and result in a\nsmaller IP range. Since an IP address is 32 bits, a prefix size of `/24` allows\n256 possible IPs in the range (eight bits) whereas a prefix size of `/29` leaves\neight possible IPs (three bits). The maximum number of builder VMs is limited to\nthe number of usable IPs in the range (the total possible number of IPs in the\nrange minus two).\n\nSee the following for examples of the `peeredNetworkIpRange` field:\n\n- `192.168.0.0/24` specifies an IP range starting at 192.168.0.0 with a subnet prefix size of 24 (256 IPs, with 254 usable IPs).\n- `/29` specifies a range with an automatically determined starting IP and a subnet prefix size of 29 (eight IPs, with six usable IPs).\n\n`workerConfig`\n--------------\n\nThis is a required field. It contains configuration options for your private\npool.\n\n### `diskSizeGb`\n\nThis is an optional field. Use this field to specify a disk size for your\nprivate pool instance in GB. Specify a value greater than or equal to\n100 and less than or equal to 4000. If you don't include this field in your\nprivate pool config file, or if you specify `0` as the value of this field,\nCloud Build uses the default value of 100.\n\n### `machineType`\n\nThis is an optional field. Use this field to specify the [Compute Engine\nmachine type](/compute/docs/machine-resource#predefined_machine_types) for your\nprivate pool instance. If you don't specify a value, then Cloud Build\nuses the default value of `e2-medium`. Otherwise, specify one of the following\nmachine types: \n\n#### Machine types\n\nThe following table shows the availability of machine types by region: \n\n#### Machine type availability by region\n\n### `enableNestedVirtualization`\n\nThis is an optional field. If your private pool uses a VM with a\n`C3` machine type, then you can enable nested virtualization to run other\nVM instances inside your private pool's VM. For more information, see\n[About nested virtualization](/compute/docs/instances/nested-virtualization/overview).\n\nWhat's next\n-----------\n\n- Learn how to [run builds in private pools](/build/docs/private-pools/run-builds-in-private-pool).\n- Learn how to [create and manage private pools](/build/docs/private-pools/create-manage-private-pools)."]]