Creates a cluster, consisting of the specified number and type of Google Compute Engine instances. By default, the cluster is created in the project's default network. One firewall is added for the cluster. After cluster creation, the Kubelet creates routes for each node to allow the containers on that node to communicate with all other instances in the cluster. Finally, an entry is added to the project's global metadata indicating which CIDR range the cluster is using.
This method waits—the workflow execution is paused—until the operation is
complete, fails, or times out. The default timeout value is 1800
seconds (30
minutes) and can be changed to a maximum value of 31536000
seconds (one year)
for long-running operations using the connector_params
field. See the
Connectors reference.
The connector uses polling to monitor the long-running operation, which might generate additional billable steps. For more information about retries and long-running operations, refer to Understand connectors.
The polling policy for the long-running operation can be configured. To set the
connector-specific parameters (connector_params
), refer to
Invoke a connector call.
Arguments
Parameters | |
---|---|
projectId |
Deprecated. (Although deprecated, this is a required parameter.) The Google Developers Console project ID or project number. This field has been deprecated and replaced by the parent field.
|
zone |
Deprecated. (Although deprecated, this is a required parameter.) The name of the Google Compute Engine zone in which the cluster resides. This field has been deprecated and replaced by the parent field.
|
body |
Required.
|
Raised exceptions
Exceptions | |
---|---|
ConnectionError |
In case of a network problem (such as DNS failure or refused connection). |
HttpError |
If the response status is >= 400 (excluding 429 and 503). |
TimeoutError |
If a long-running operation takes longer to finish than the specified timeout limit. |
TypeError |
If an operation or function receives an argument of the wrong type. |
ValueError |
If an operation or function receives an argument of the right type but an inappropriate value. For example, a negative timeout. |
OperationError |
If the long-running operation finished unsuccessfully. |
ResponseTypeError |
If the long-running operation returned a response of the wrong type. |
Response
If successful, the response contains an instance of Operation
.
Subworkflow snippet
Some fields might be optional or required. To identify required fields, refer to the API documentation.
YAML
- create: call: googleapis.container.v1.projects.zones.clusters.create args: projectId: ... zone: ... body: cluster: addonsConfig: cloudRunConfig: disabled: ... loadBalancerType: ... configConnectorConfig: enabled: ... dnsCacheConfig: enabled: ... gcePersistentDiskCsiDriverConfig: enabled: ... gcpFilestoreCsiDriverConfig: enabled: ... horizontalPodAutoscaling: disabled: ... httpLoadBalancing: disabled: ... kubernetesDashboard: disabled: ... networkPolicyConfig: disabled: ... authenticatorGroupsConfig: enabled: ... securityGroup: ... autopilot: enabled: ... autoscaling: autoprovisioningLocations: ... autoprovisioningNodePoolDefaults: bootDiskKmsKey: ... diskSizeGb: ... diskType: ... imageType: ... management: autoRepair: ... autoUpgrade: ... upgradeOptions: ... minCpuPlatform: ... oauthScopes: ... serviceAccount: ... shieldedInstanceConfig: enableIntegrityMonitoring: ... enableSecureBoot: ... upgradeSettings: maxSurge: ... maxUnavailable: ... autoscalingProfile: ... enableNodeAutoprovisioning: ... resourceLimits: ... binaryAuthorization: enabled: ... clusterIpv4Cidr: ... conditions: ... confidentialNodes: enabled: ... databaseEncryption: keyName: ... state: ... defaultMaxPodsConstraint: maxPodsPerNode: ... description: ... enableKubernetesAlpha: ... enableTpu: ... initialClusterVersion: ... initialNodeCount: ... instanceGroupUrls: ... ipAllocationPolicy: clusterIpv4Cidr: ... clusterIpv4CidrBlock: ... clusterSecondaryRangeName: ... createSubnetwork: ... nodeIpv4Cidr: ... nodeIpv4CidrBlock: ... servicesIpv4Cidr: ... servicesIpv4CidrBlock: ... servicesSecondaryRangeName: ... subnetworkName: ... tpuIpv4CidrBlock: ... useIpAliases: ... useRoutes: ... labelFingerprint: ... legacyAbac: enabled: ... locations: ... loggingConfig: componentConfig: enableComponents: ... loggingService: ... maintenancePolicy: resourceVersion: ... window: dailyMaintenanceWindow: startTime: ... maintenanceExclusions: ... recurringWindow: recurrence: ... window: endTime: ... startTime: ... masterAuth: clientCertificateConfig: issueClientCertificate: ... password: ... username: ... masterAuthorizedNetworksConfig: cidrBlocks: ... enabled: ... monitoringConfig: componentConfig: enableComponents: ... monitoringService: ... name: ... network: ... networkConfig: datapathProvider: ... defaultSnatStatus: disabled: ... enableIntraNodeVisibility: ... enableL4ilbSubsetting: ... privateIpv6GoogleAccess: ... networkPolicy: enabled: ... provider: ... nodeConfig: accelerators: ... bootDiskKmsKey: ... diskSizeGb: ... diskType: ... gvnic: enabled: ... imageType: ... kubeletConfig: cpuCfsQuota: ... cpuCfsQuotaPeriod: ... cpuManagerPolicy: ... labels: ... linuxNodeConfig: sysctls: ... localSsdCount: ... machineType: ... metadata: ... minCpuPlatform: ... nodeGroup: ... oauthScopes: ... preemptible: ... reservationAffinity: consumeReservationType: ... key: ... values: ... sandboxConfig: type: ... serviceAccount: ... shieldedInstanceConfig: ... tags: ... taints: ... workloadMetadataConfig: mode: ... nodePools: ... notificationConfig: pubsub: enabled: ... topic: ... privateClusterConfig: enablePrivateEndpoint: ... enablePrivateNodes: ... masterGlobalAccessConfig: enabled: ... masterIpv4CidrBlock: ... releaseChannel: channel: ... resourceLabels: ... resourceUsageExportConfig: bigqueryDestination: datasetId: ... consumptionMeteringConfig: enabled: ... enableNetworkEgressMetering: ... shieldedNodes: enabled: ... subnetwork: ... verticalPodAutoscaling: enabled: ... workloadIdentityConfig: workloadPool: ... parent: ... projectId: ... zone: ... result: createResult
JSON
[ { "create": { "call": "googleapis.container.v1.projects.zones.clusters.create", "args": { "projectId": "...", "zone": "...", "body": { "cluster": { "addonsConfig": { "cloudRunConfig": { "disabled": "...", "loadBalancerType": "..." }, "configConnectorConfig": { "enabled": "..." }, "dnsCacheConfig": { "enabled": "..." }, "gcePersistentDiskCsiDriverConfig": { "enabled": "..." }, "gcpFilestoreCsiDriverConfig": { "enabled": "..." }, "horizontalPodAutoscaling": { "disabled": "..." }, "httpLoadBalancing": { "disabled": "..." }, "kubernetesDashboard": { "disabled": "..." }, "networkPolicyConfig": { "disabled": "..." } }, "authenticatorGroupsConfig": { "enabled": "...", "securityGroup": "..." }, "autopilot": { "enabled": "..." }, "autoscaling": { "autoprovisioningLocations": "...", "autoprovisioningNodePoolDefaults": { "bootDiskKmsKey": "...", "diskSizeGb": "...", "diskType": "...", "imageType": "...", "management": { "autoRepair": "...", "autoUpgrade": "...", "upgradeOptions": "..." }, "minCpuPlatform": "...", "oauthScopes": "...", "serviceAccount": "...", "shieldedInstanceConfig": { "enableIntegrityMonitoring": "...", "enableSecureBoot": "..." }, "upgradeSettings": { "maxSurge": "...", "maxUnavailable": "..." } }, "autoscalingProfile": "...", "enableNodeAutoprovisioning": "...", "resourceLimits": "..." }, "binaryAuthorization": { "enabled": "..." }, "clusterIpv4Cidr": "...", "conditions": "...", "confidentialNodes": { "enabled": "..." }, "databaseEncryption": { "keyName": "...", "state": "..." }, "defaultMaxPodsConstraint": { "maxPodsPerNode": "..." }, "description": "...", "enableKubernetesAlpha": "...", "enableTpu": "...", "initialClusterVersion": "...", "initialNodeCount": "...", "instanceGroupUrls": "...", "ipAllocationPolicy": { "clusterIpv4Cidr": "...", "clusterIpv4CidrBlock": "...", "clusterSecondaryRangeName": "...", "createSubnetwork": "...", "nodeIpv4Cidr": "...", "nodeIpv4CidrBlock": "...", "servicesIpv4Cidr": "...", "servicesIpv4CidrBlock": "...", "servicesSecondaryRangeName": "...", "subnetworkName": "...", "tpuIpv4CidrBlock": "...", "useIpAliases": "...", "useRoutes": "..." }, "labelFingerprint": "...", "legacyAbac": { "enabled": "..." }, "locations": "...", "loggingConfig": { "componentConfig": { "enableComponents": "..." } }, "loggingService": "...", "maintenancePolicy": { "resourceVersion": "...", "window": { "dailyMaintenanceWindow": { "startTime": "..." }, "maintenanceExclusions": "...", "recurringWindow": { "recurrence": "...", "window": { "endTime": "...", "startTime": "..." } } } }, "masterAuth": { "clientCertificateConfig": { "issueClientCertificate": "..." }, "password": "...", "username": "..." }, "masterAuthorizedNetworksConfig": { "cidrBlocks": "...", "enabled": "..." }, "monitoringConfig": { "componentConfig": { "enableComponents": "..." } }, "monitoringService": "...", "name": "...", "network": "...", "networkConfig": { "datapathProvider": "...", "defaultSnatStatus": { "disabled": "..." }, "enableIntraNodeVisibility": "...", "enableL4ilbSubsetting": "...", "privateIpv6GoogleAccess": "..." }, "networkPolicy": { "enabled": "...", "provider": "..." }, "nodeConfig": { "accelerators": "...", "bootDiskKmsKey": "...", "diskSizeGb": "...", "diskType": "...", "gvnic": { "enabled": "..." }, "imageType": "...", "kubeletConfig": { "cpuCfsQuota": "...", "cpuCfsQuotaPeriod": "...", "cpuManagerPolicy": "..." }, "labels": "...", "linuxNodeConfig": { "sysctls": "..." }, "localSsdCount": "...", "machineType": "...", "metadata": "...", "minCpuPlatform": "...", "nodeGroup": "...", "oauthScopes": "...", "preemptible": "...", "reservationAffinity": { "consumeReservationType": "...", "key": "...", "values": "..." }, "sandboxConfig": { "type": "..." }, "serviceAccount": "...", "shieldedInstanceConfig": "...", "tags": "...", "taints": "...", "workloadMetadataConfig": { "mode": "..." } }, "nodePools": "...", "notificationConfig": { "pubsub": { "enabled": "...", "topic": "..." } }, "privateClusterConfig": { "enablePrivateEndpoint": "...", "enablePrivateNodes": "...", "masterGlobalAccessConfig": { "enabled": "..." }, "masterIpv4CidrBlock": "..." }, "releaseChannel": { "channel": "..." }, "resourceLabels": "...", "resourceUsageExportConfig": { "bigqueryDestination": { "datasetId": "..." }, "consumptionMeteringConfig": { "enabled": "..." }, "enableNetworkEgressMetering": "..." }, "shieldedNodes": { "enabled": "..." }, "subnetwork": "...", "verticalPodAutoscaling": { "enabled": "..." }, "workloadIdentityConfig": { "workloadPool": "..." } }, "parent": "...", "projectId": "...", "zone": "..." } }, "result": "createResult" } } ]