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 | |
---|---|
parent |
Required. The parent (project and location) where the cluster will be created. Specified in the format
|
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.v1beta1.projects.locations.clusters.create args: parent: ... body: cluster: addonsConfig: cloudRunConfig: disabled: ... loadBalancerType: ... configConnectorConfig: enabled: ... dnsCacheConfig: enabled: ... gcePersistentDiskCsiDriverConfig: enabled: ... horizontalPodAutoscaling: disabled: ... httpLoadBalancing: disabled: ... istioConfig: auth: ... disabled: ... kalmConfig: enabled: ... 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: ... clusterTelemetry: type: ... conditions: ... confidentialNodes: enabled: ... databaseEncryption: keyName: ... state: ... defaultMaxPodsConstraint: maxPodsPerNode: ... description: ... enableKubernetesAlpha: ... enableTpu: ... identityServiceConfig: enabled: ... initialClusterVersion: ... initialNodeCount: ... instanceGroupUrls: ... ipAllocationPolicy: allowRouteOverlap: ... 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: ... master: ... masterAuth: clientCertificateConfig: issueClientCertificate: ... clusterCaCertificate: ... password: ... username: ... masterAuthorizedNetworksConfig: cidrBlocks: ... enabled: ... masterIpv4CidrBlock: ... monitoringConfig: componentConfig: enableComponents: ... monitoringService: ... name: ... network: ... networkConfig: datapathProvider: ... defaultSnatStatus: disabled: ... dnsConfig: clusterDns: ... clusterDnsDomain: ... clusterDnsScope: ... enableIntraNodeVisibility: ... enableL4ilbSubsetting: ... privateIpv6GoogleAccess: ... serviceExternalIpsConfig: enabled: ... networkPolicy: enabled: ... provider: ... nodeConfig: accelerators: ... bootDiskKmsKey: ... diskSizeGb: ... diskType: ... ephemeralStorageConfig: localSsdCount: ... gvnic: enabled: ... imageType: ... kubeletConfig: cpuCfsQuota: ... cpuCfsQuotaPeriod: ... cpuManagerPolicy: ... labels: ... linuxNodeConfig: sysctls: ... localSsdCount: ... machineType: ... metadata: ... minCpuPlatform: ... nodeGroup: ... oauthScopes: ... preemptible: ... reservationAffinity: consumeReservationType: ... key: ... values: ... sandboxConfig: sandboxType: ... type: ... serviceAccount: ... shieldedInstanceConfig: ... tags: ... taints: ... workloadMetadataConfig: mode: ... nodeMetadata: ... nodePoolDefaults: nodeConfigDefaults: ... nodePools: ... notificationConfig: pubsub: enabled: ... topic: ... podSecurityPolicyConfig: enabled: ... privateCluster: ... privateClusterConfig: enablePrivateEndpoint: ... enablePrivateNodes: ... masterGlobalAccessConfig: enabled: ... masterIpv4CidrBlock: ... releaseChannel: channel: ... resourceLabels: ... resourceUsageExportConfig: bigqueryDestination: datasetId: ... consumptionMeteringConfig: enabled: ... enableNetworkEgressMetering: ... shieldedNodes: enabled: ... subnetwork: ... tpuConfig: enabled: ... ipv4CidrBlock: ... useServiceNetworking: ... verticalPodAutoscaling: enabled: ... workloadCertificates: enableCertificates: ... workloadIdentityConfig: identityNamespace: ... identityProvider: ... workloadPool: ... parent: ... projectId: ... zone: ... result: createResult
JSON
[ { "create": { "call": "googleapis.container.v1beta1.projects.locations.clusters.create", "args": { "parent": "...", "body": { "cluster": { "addonsConfig": { "cloudRunConfig": { "disabled": "...", "loadBalancerType": "..." }, "configConnectorConfig": { "enabled": "..." }, "dnsCacheConfig": { "enabled": "..." }, "gcePersistentDiskCsiDriverConfig": { "enabled": "..." }, "horizontalPodAutoscaling": { "disabled": "..." }, "httpLoadBalancing": { "disabled": "..." }, "istioConfig": { "auth": "...", "disabled": "..." }, "kalmConfig": { "enabled": "..." }, "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": "...", "clusterTelemetry": { "type": "..." }, "conditions": "...", "confidentialNodes": { "enabled": "..." }, "databaseEncryption": { "keyName": "...", "state": "..." }, "defaultMaxPodsConstraint": { "maxPodsPerNode": "..." }, "description": "...", "enableKubernetesAlpha": "...", "enableTpu": "...", "identityServiceConfig": { "enabled": "..." }, "initialClusterVersion": "...", "initialNodeCount": "...", "instanceGroupUrls": "...", "ipAllocationPolicy": { "allowRouteOverlap": "...", "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": "..." } } } }, "master": "...", "masterAuth": { "clientCertificateConfig": { "issueClientCertificate": "..." }, "clusterCaCertificate": "...", "password": "...", "username": "..." }, "masterAuthorizedNetworksConfig": { "cidrBlocks": "...", "enabled": "..." }, "masterIpv4CidrBlock": "...", "monitoringConfig": { "componentConfig": { "enableComponents": "..." } }, "monitoringService": "...", "name": "...", "network": "...", "networkConfig": { "datapathProvider": "...", "defaultSnatStatus": { "disabled": "..." }, "dnsConfig": { "clusterDns": "...", "clusterDnsDomain": "...", "clusterDnsScope": "..." }, "enableIntraNodeVisibility": "...", "enableL4ilbSubsetting": "...", "privateIpv6GoogleAccess": "...", "serviceExternalIpsConfig": { "enabled": "..." } }, "networkPolicy": { "enabled": "...", "provider": "..." }, "nodeConfig": { "accelerators": "...", "bootDiskKmsKey": "...", "diskSizeGb": "...", "diskType": "...", "ephemeralStorageConfig": { "localSsdCount": "..." }, "gvnic": { "enabled": "..." }, "imageType": "...", "kubeletConfig": { "cpuCfsQuota": "...", "cpuCfsQuotaPeriod": "...", "cpuManagerPolicy": "..." }, "labels": "...", "linuxNodeConfig": { "sysctls": "..." }, "localSsdCount": "...", "machineType": "...", "metadata": "...", "minCpuPlatform": "...", "nodeGroup": "...", "oauthScopes": "...", "preemptible": "...", "reservationAffinity": { "consumeReservationType": "...", "key": "...", "values": "..." }, "sandboxConfig": { "sandboxType": "...", "type": "..." }, "serviceAccount": "...", "shieldedInstanceConfig": "...", "tags": "...", "taints": "...", "workloadMetadataConfig": { "mode": "...", "nodeMetadata": "..." } }, "nodePoolDefaults": { "nodeConfigDefaults": "..." }, "nodePools": "...", "notificationConfig": { "pubsub": { "enabled": "...", "topic": "..." } }, "podSecurityPolicyConfig": { "enabled": "..." }, "privateCluster": "...", "privateClusterConfig": { "enablePrivateEndpoint": "...", "enablePrivateNodes": "...", "masterGlobalAccessConfig": { "enabled": "..." }, "masterIpv4CidrBlock": "..." }, "releaseChannel": { "channel": "..." }, "resourceLabels": "...", "resourceUsageExportConfig": { "bigqueryDestination": { "datasetId": "..." }, "consumptionMeteringConfig": { "enabled": "..." }, "enableNetworkEgressMetering": "..." }, "shieldedNodes": { "enabled": "..." }, "subnetwork": "...", "tpuConfig": { "enabled": "...", "ipv4CidrBlock": "...", "useServiceNetworking": "..." }, "verticalPodAutoscaling": { "enabled": "..." }, "workloadCertificates": { "enableCertificates": "..." }, "workloadIdentityConfig": { "identityNamespace": "...", "identityProvider": "...", "workloadPool": "..." } }, "parent": "...", "projectId": "...", "zone": "..." } }, "result": "createResult" } } ]