Skip to content

googleContainerCluster

-> Visit the Provision a GKE Cluster (Google Cloud) Learn tutorial to learn how to provision and interact with a GKE cluster.

-> See the Using GKE with Terraform guide for more information about using GKE with Terraform.

Manages a Google Kubernetes Engine (GKE) cluster. For more information see the official documentation and the API reference.

\~> Warning: All arguments and attributes, including basic auth username and passwords as well as certificate outputs will be stored in the raw state as plaintext. Read more about sensitive data in state.

/*Provider bindings are generated by running cdktf get.
See https://cdk.tf/provider-generation for more details.*/
import * as google from "./.gen/providers/google";
/*The following providers are missing schema information and might need manual adjustments to synthesize correctly: google.
For a more precise conversion please use the --provider flag in convert.*/
const googleContainerClusterPrimary =
  new google.containerCluster.ContainerCluster(this, "primary", {
    initial_node_count: 1,
    location: "us-central1",
    name: "my-gke-cluster",
    remove_default_node_pool: true,
  });
const googleServiceAccountDefault = new google.serviceAccount.ServiceAccount(
  this,
  "default",
  {
    account_id: "service-account-id",
    display_name: "Service Account",
  }
);
new google.containerNodePool.ContainerNodePool(
  this,
  "primary_preemptible_nodes",
  {
    cluster: googleContainerClusterPrimary.name,
    location: "us-central1",
    name: "my-node-pool",
    node_config: [
      {
        machine_type: "e2-medium",
        oauth_scopes: ["https://www.googleapis.com/auth/cloud-platform"],
        preemptible: true,
        service_account: googleServiceAccountDefault.email,
      },
    ],
    node_count: 1,
  }
);

\~> Note: It is recommended that node pools be created and managed as separate resources as in the example above. This allows node pools to be added and removed without recreating the cluster. Node pools defined directly in the googleContainerCluster resource cannot be removed without re-creating the cluster.

Example Usage - with the default node pool

/*Provider bindings are generated by running cdktf get.
See https://cdk.tf/provider-generation for more details.*/
import * as google from "./.gen/providers/google";
/*The following providers are missing schema information and might need manual adjustments to synthesize correctly: google.
For a more precise conversion please use the --provider flag in convert.*/
const googleServiceAccountDefault = new google.serviceAccount.ServiceAccount(
  this,
  "default",
  {
    account_id: "service-account-id",
    display_name: "Service Account",
  }
);
new google.containerCluster.ContainerCluster(this, "primary", {
  initial_node_count: 3,
  location: "us-central1-a",
  name: "marcellus-wallace",
  node_config: [
    {
      labels: [
        {
          foo: "bar",
        },
      ],
      oauth_scopes: ["https://www.googleapis.com/auth/cloud-platform"],
      service_account: googleServiceAccountDefault.email,
      tags: ["foo", "bar"],
    },
  ],
  timeouts: [
    {
      create: "30m",
      update: "40m",
    },
  ],
});

Argument Reference

  • name - (Required) The name of the cluster, unique within the project and location.

  • location - (Optional) The location (region or zone) in which the cluster master will be created, as well as the default node location. If you specify a zone (such as usCentral1A), the cluster will be a zonal cluster with a single cluster master. If you specify a region (such as usWest1), the cluster will be a regional cluster with multiple masters spread across zones in the region, and with default node locations in those zones as well

  • nodeLocations - (Optional) The list of zones in which the cluster's nodes are located. Nodes must be in the region of their regional cluster or in the same region as their cluster's zone for zonal clusters. If this is specified for a zonal cluster, omit the cluster's zone.

-> A "multi-zonal" cluster is a zonal cluster with at least one additional zone defined; in a multi-zonal cluster, the cluster master is only present in a single zone while nodes are present in each of the primary zone and the node locations. In contrast, in a regional cluster, cluster master nodes are present in multiple zones in the region. For that reason, regional clusters should be preferred.

  • addonsConfig - (Optional) The configuration for addons supported by GKE. Structure is documented below.

  • clusterIpv4Cidr - (Optional) The IP address range of the Kubernetes pods in this cluster in CIDR notation (e.g. 109600/14). Leave blank to have one automatically chosen or specify a /14 block in 10000/8. This field will only work for routes-based clusters, where ipAllocationPolicy is not defined.

  • clusterAutoscaling - (Optional) Per-cluster configuration of Node Auto-Provisioning with Cluster Autoscaler to automatically adjust the size of the cluster and create/delete node pools based on the current needs of the cluster's workload. See the guide to using Node Auto-Provisioning for more details. Structure is documented below.

  • binaryAuthorization - (Optional) Configuration options for the Binary Authorization feature. Structure is documented below.

  • serviceExternalIpsConfig - (Optional) Structure is documented below.

  • meshCertificates - (Optional) Structure is documented below.

  • databaseEncryption - (Optional) Structure is documented below.

  • description - (Optional) Description of the cluster.

  • defaultMaxPodsPerNode - (Optional) The default maximum number of pods per node in this cluster. This doesn't work on "routes-based" clusters, clusters that don't have IP Aliasing enabled. See the official documentation for more information.

  • enableBinaryAuthorization - (DEPRECATED) Enable Binary Authorization for this cluster. If enabled, all container images will be validated by Google Binary Authorization. Deprecated in favor of binaryAuthorization.

  • enableKubernetesAlpha - (Optional) Whether to enable Kubernetes Alpha features for this cluster. Note that when this option is enabled, the cluster cannot be upgraded and will be automatically deleted after 30 days.

  • enableTpu - (Optional) Whether to enable Cloud TPU resources in this cluster. See the official documentation.

  • enableLegacyAbac - (Optional) Whether the ABAC authorizer is enabled for this cluster. When enabled, identities in the system, including service accounts, nodes, and controllers, will have statically granted permissions beyond those provided by the RBAC configuration or IAM. Defaults to false

  • enableShieldedNodes - (Optional) Enable Shielded Nodes features on all nodes in this cluster. Defaults to true.

  • enableAutopilot - (Optional) Enable Autopilot for this cluster. Defaults to false. Note that when this option is enabled, certain features of Standard GKE are not available. See the official documentation for available features.

  • initialNodeCount - (Optional) The number of nodes to create in this cluster's default node pool. In regional or multi-zonal clusters, this is the number of nodes per zone. Must be set if nodePool is not set. If you're using googleContainerNodePool objects with no default node pool, you'll need to set this to a value of at least 1, alongside setting removeDefaultNodePool to true.

  • ipAllocationPolicy - (Optional) Configuration of cluster IP allocation for VPC-native clusters. Adding this block enables IP aliasing, making the cluster VPC-native instead of routes-based. Structure is documented below.

  • networkingMode - (Optional) Determines whether alias IPs or routes will be used for pod IPs in the cluster. Options are vpcNative or routes. vpcNative enables IP aliasing, and requires the ipAllocationPolicy block to be defined. By default, when this field is unspecified and no ipAllocationPolicy blocks are set, GKE will create a routes-based cluster.

  • loggingConfig - (Optional) Logging configuration for the cluster. Structure is documented below.

  • loggingService - (Optional) The logging service that the cluster should write logs to. Available options include loggingGoogleapisCom(Legacy Stackdriver), loggingGoogleapisCom/kubernetes(Stackdriver Kubernetes Engine Logging), and none. Defaults to loggingGoogleapisCom/kubernetes

  • maintenancePolicy - (Optional) The maintenance policy to use for the cluster. Structure is documented below.

  • masterAuth - (Optional) The authentication information for accessing the Kubernetes master. Some values in this block are only returned by the API if your service account has permission to get credentials for your GKE cluster. If you see an unexpected diff unsetting your client cert, ensure you have the containerClustersGetCredentials permission. Structure is documented below.

  • masterAuthorizedNetworksConfig - (Optional) The desired configuration options for master authorized networks. Omit the nested cidrBlocks attribute to disallow external access (except the cluster node IPs, which GKE automatically whitelists). Structure is documented below.

  • minMasterVersion - (Optional) The minimum version of the master. GKE will auto-update the master to new versions, so this does not guarantee the current master version--use the read-only masterVersion field to obtain that. If unset, the cluster's version will be set by GKE to the version of the most recent official release (which is not necessarily the latest version). Most users will find the googleContainerEngineVersions data source useful - it indicates which versions are available, and can be use to approximate fuzzy versions in a Terraform-compatible way. If you intend to specify versions manually, the docs describe the various acceptable formats for this field.

-> If you are using the googleContainerEngineVersions datasource with a regional cluster, ensure that you have provided a location to the datasource. A region can have a different set of supported versions than its corresponding zones, and not all zones in a region are guaranteed to support the same version.

  • monitoringConfig - (Optional) Monitoring configuration for the cluster. Structure is documented below.

  • monitoringService - (Optional) The monitoring service that the cluster should write metrics to. Automatically send metrics from pods in the cluster to the Google Cloud Monitoring API. VM metrics will be collected by Google Compute Engine regardless of this setting Available options include monitoringGoogleapisCom(Legacy Stackdriver), monitoringGoogleapisCom/kubernetes(Stackdriver Kubernetes Engine Monitoring), and none. Defaults to monitoringGoogleapisCom/kubernetes

  • network - (Optional) The name or self_link of the Google Compute Engine network to which the cluster is connected. For Shared VPC, set this to the self link of the shared network.

  • networkPolicy - (Optional) Configuration options for the NetworkPolicy feature. Structure is documented below.

  • nodeConfig - (Optional) Parameters used in creating the default node pool. Generally, this field should not be used at the same time as a googleContainerNodePool or a nodePool block; this configuration manages the default node pool, which isn't recommended to be used with Terraform. Structure is documented below.

  • nodePool - (Optional) List of node pools associated with this cluster. See google_container_node_pool for schema. Warning: node pools defined inside a cluster can't be changed (or added/removed) after cluster creation without deleting and recreating the entire cluster. Unless you absolutely need the ability to say "these are the only node pools associated with this cluster", use the google_container_node_pool resource instead of this property.

  • nodePoolAutoConfig - (Optional, Beta) Node pool configs that apply to auto-provisioned node pools in autopilot clusters and node auto-provisioning-enabled clusters. Structure is documented below.

  • nodePoolDefaults - (Optional) Default NodePool settings for the entire cluster. These settings are overridden if specified on the specific NodePool object. Structure is documented below.

  • nodeVersion - (Optional) The Kubernetes version on the nodes. Must either be unset or set to the same value as minMasterVersion on create. Defaults to the default version set by GKE which is not necessarily the latest version. This only affects nodes in the default node pool. While a fuzzy version can be specified, it's recommended that you specify explicit versions as Terraform will see spurious diffs when fuzzy versions are used. See the googleContainerEngineVersions data source's versionPrefix field to approximate fuzzy versions in a Terraform-compatible way. To update nodes in other node pools, use the version attribute on the node pool.

  • notificationConfig - (Optional) Configuration for the cluster upgrade notifications feature. Structure is documented below.

  • confidentialNodes - Configuration for Confidential Nodes feature. Structure is documented below documented below.

  • podSecurityPolicyConfig - (Optional, Beta) Configuration for the PodSecurityPolicy feature. Structure is documented below.

  • authenticatorGroupsConfig - (Optional) Configuration for the Google Groups for GKE feature. Structure is documented below.

  • privateClusterConfig - (Optional) Configuration for private clusters, clusters with private nodes. Structure is documented below.

  • clusterTelemetry - (Optional, Beta) Configuration for ClusterTelemetry feature, Structure is documented below.

  • project - (Optional) The ID of the project in which the resource belongs. If it is not provided, the provider project is used.

  • releaseChannel - (Optional) Configuration options for the Release channel feature, which provide more control over automatic upgrades of your GKE clusters. When updating this field, GKE imposes specific version requirements. See Selecting a new release channel for more details; the googleContainerEngineVersions datasource can provide the default version for a channel. Note that removing the releaseChannel field from your config will cause Terraform to stop managing your cluster's release channel, but will not unenroll it. Instead, use the "unspecified" channel. Structure is documented below.

  • removeDefaultNodePool - (Optional) If true, deletes the default node pool upon cluster creation. If you're using googleContainerNodePool resources with no default node pool, this should be set to true, alongside setting initialNodeCount to at least 1.

  • resourceLabels - (Optional) The GCE resource labels (a map of key/value pairs) to be applied to the cluster.

  • costManagementConfig - (Optional) Configuration for the Cost Allocation feature. Structure is documented below.

  • resourceUsageExportConfig - (Optional) Configuration for the ResourceUsageExportConfig feature. Structure is documented below.

  • subnetwork - (Optional) The name or self_link of the Google Compute Engine subnetwork in which the cluster's instances are launched.

  • verticalPodAutoscaling - (Optional) Vertical Pod Autoscaling automatically adjusts the resources of pods controlled by it. Structure is documented below.

  • workloadIdentityConfig - (Optional) Workload Identity allows Kubernetes service accounts to act as a user-managed Google IAM Service Account. Structure is documented below.

  • enableIntranodeVisibility - (Optional) Whether Intra-node visibility is enabled for this cluster. This makes same node pod to pod traffic visible for VPC network.

  • enableL4IlbSubsetting - (Optional, Beta) Whether L4ILB Subsetting is enabled for this cluster.

  • privateIpv6GoogleAccess - (Optional) The desired state of IPv6 connectivity to Google Services. By default, no private IPv6 access to or from Google Services (all access will be via IPv4).

  • datapathProvider - (Optional) The desired datapath provider for this cluster. By default, uses the IPTables-based kube-proxy implementation.

  • defaultSnatStatus - (Optional) GKE SNAT DefaultSnatStatus contains the desired state of whether default sNAT should be disabled on the cluster, API doc. Structure is documented below

  • dnsConfig - (Optional) Configuration for Using Cloud DNS for GKE. Structure is documented below.

  • gatewayApiConfig - (Optional) Configuration for GKE Gateway API controller. Structure is documented below.

  • protectConfig - (Optional, Beta) Enable/Disable Protect API features for the cluster. Structure is documented below.

The defaultSnatStatus block supports

  • disabled - (Required) Whether the cluster disables default in-node sNAT rules. In-node sNAT rules will be disabled when defaultSnatStatus is disabled.When disabled is set to false, default IP masquerade rules will be applied to the nodes to prevent sNAT on cluster internal traffic

The clusterTelemetry block supports

  • type - Telemetry integration for the cluster. Supported values (enabled,Disabled,SystemOnly); systemOnly (Only system components are monitored and logged) is only available in GKE versions 1.15 and later.

The addonsConfig block supports:

  • horizontalPodAutoscaling - (Optional) The status of the Horizontal Pod Autoscaling addon, which increases or decreases the number of replica pods a replication controller has based on the resource usage of the existing pods. It is enabled by default; set disabled =True to disable.

  • httpLoadBalancing - (Optional) The status of the HTTP (L7) load balancing controller addon, which makes it easy to set up HTTP load balancers for services in a cluster. It is enabled by default; set disabled =True to disable.

  • networkPolicyConfig - (Optional) Whether we should enable the network policy addon for the master. This must be enabled in order to enable network policy for the nodes. To enable this, you must also define a networkPolicy block, otherwise nothing will happen. It can only be disabled if the nodes already do not have network policies enabled. Defaults to disabled; set disabled =False to enable.

  • gcpFilestoreCsiDriverConfig - (Optional) The status of the Filestore CSI driver addon, which allows the usage of filestore instance as volumes. It is disabled by default; set enabled =True to enable.

  • cloudrunConfig - (Optional). Structure is documented below.

  • istioConfig - (Optional, Beta). Structure is documented below.

  • identityServiceConfig - (Optional, Beta). Structure is documented below.

  • dnsCacheConfig - (Optional). The status of the NodeLocal DNSCache addon. It is disabled by default. Set enabled =True to enable.

    Enabling/Disabling NodeLocal DNSCache in an existing cluster is a disruptive operation. All cluster nodes running GKE 1.15 and higher are recreated.

  • gcePersistentDiskCsiDriverConfig - (Optional). Whether this cluster should enable the Google Compute Engine Persistent Disk Container Storage Interface (CSI) Driver. Defaults to disabled; set enabled =True to enabled.

  • gkeBackupAgentConfig - (Optional). The status of the Backup for GKE agent addon. It is disabled by default; Set enabled =True to enable.

  • kalmConfig - (Optional, Beta). Configuration for the KALM addon, which manages the lifecycle of k8s. It is disabled by default; Set enabled =True to enable.

  • configConnectorConfig - (Optional). The status of the ConfigConnector addon. It is disabled by default; Set enabled =True to enable.

This example addonsConfig disables two addons:

addons_config {
  http_load_balancing {
    disabled = true
  }

  horizontal_pod_autoscaling {
    disabled = true
  }
}

The binaryAuthorization block supports:

  • enabled - (DEPRECATED) Enable Binary Authorization for this cluster. Deprecated in favor of evaluationMode.

  • evaluationMode - (Optional) Mode of operation for Binary Authorization policy evaluation. Valid values are disabled and projectSingletonPolicyEnforce. projectSingletonPolicyEnforce is functionally equivalent to the deprecated enableBinaryAuthorization parameter being set to true.

The serviceExternalIpsConfig block supports:

  • enabled - (Required) Controls whether external ips specified by a service will be allowed. It is enabled by default.

The meshCertificates block supports:

  • enableCertificates - (Required) Controls the issuance of workload mTLS certificates. It is enabled by default. Workload Identity is required, see workload_config.

The databaseEncryption block supports:

  • state - (Required) encrypted or decrypted

  • keyName - (Required) the key to use to encrypt/decrypt secrets. See the DatabaseEncryption definition for more information.

The cloudrunConfig block supports:

  • disabled - (Optional) The status of the CloudRun addon. It is disabled by default. Set disabled=false to enable.

  • loadBalancerType - (Optional) The load balancer type of CloudRun ingress service. It is external load balancer by default. Set loadBalancerType=loadBalancerTypeInternal to configure it as internal load balancer.

The identityServiceConfig block supports:

  • enabled - (Optional) Whether to enable the Identity Service component. It is disabled by default. Set enabled=true to enable.

The istioConfig block supports:

  • disabled - (Optional) The status of the Istio addon, which makes it easy to set up Istio for services in a cluster. It is disabled by default. Set disabled =False to enable.

  • auth - (Optional) The authentication type between services in Istio. Available options include authMutualTls.

The clusterAutoscaling block supports:

  • enabled - (Optional) Whether node auto-provisioning is enabled. Must be supplied for GKE Standard clusters, true is implied for autopilot clusters. Resource limits for cpu and memory must be defined to enable node auto-provisioning for GKE Standard.

  • resourceLimits - (Optional) Global constraints for machine resources in the cluster. Configuring the cpu and memory types is required if node auto-provisioning is enabled. These limits will apply to node pool autoscaling in addition to node auto-provisioning. Structure is documented below.

  • autoProvisioningDefaults - (Optional) Contains defaults for a node pool created by NAP. A subset of fields also apply to GKE Autopilot clusters. Structure is documented below.

  • autoscalingProfile - (Optional, Beta) Configuration options for the Autoscaling profile feature, which lets you choose whether the cluster autoscaler should optimize for resource utilization or resource availability when deciding to remove nodes from a cluster. Can be balanced or optimizeUtilization. Defaults to balanced.

The resourceLimits block supports:

  • resourceType - (Required) The type of the resource. For example, cpu and memory. See the guide to using Node Auto-Provisioning for a list of types.

  • minimum - (Optional) Minimum amount of the resource in the cluster.

  • maximum - (Optional) Maximum amount of the resource in the cluster.

The autoProvisioningDefaults block supports:

  • minCpuPlatform - (Optional, Beta) Minimum CPU platform to be used for NAP created node pools. The instance may be scheduled on the specified or newer CPU platform. Applicable values are the friendly names of CPU platforms, such as "Intel Haswell" or "Intel Sandy Bridge".

  • oauthScopes - (Optional) Scopes that are used by NAP and GKE Autopilot when creating node pools. Use the "https://www.googleapis.com/auth/cloud-platform" scope to grant access to all APIs. It is recommended that you set serviceAccount to a non-default service account and grant IAM roles to that service account for only the resources that it needs.

-> monitoringWrite is always enabled regardless of user input. monitoring and loggingWrite may also be enabled depending on the values for monitoringService and loggingService.

  • serviceAccount - (Optional) The Google Cloud Platform Service Account to be used by the node VMs created by GKE Autopilot or NAP.

  • bootDiskKmsKey - (Optional) The Customer Managed Encryption Key used to encrypt the boot disk attached to each node in the node pool. This should be of the form projects/[KEY_PROJECT_ID]/locations/[LOCATION]/keyRings/[RING_NAME]/cryptoKeys/[KEY_NAME]. For more information about protecting resources with Cloud KMS Keys please see: https://cloud.google.com/compute/docs/disks/customer-managed-encryption

  • diskSize - (Optional) Size of the disk attached to each node, specified in GB. The smallest allowed disk size is 10GB. Defaults to 100

  • diskType - (Optional) Type of the disk attached to each node (e.g. 'pd-standard', 'pd-ssd' or 'pd-balanced'). Defaults to pdStandard

  • imageType - (Optional) The default image type used by NAP once a new node pool is being created. Please note that according to the official documentation the value must be one of the [COS_CONTAINERD, COS, UBUNTU_CONTAINERD, UBUNTU]. NOTE : COS AND UBUNTU are deprecated as of gke124

  • shieldedInstanceConfig - (Optional) Shielded Instance options. Structure is documented below.

  • management - (Optional) NodeManagement configuration for this NodePool. Structure is documented below.

The management block supports:

  • autoUpgrade - (Optional) Specifies whether node auto-upgrade is enabled for the node pool. If enabled, node auto-upgrade helps keep the nodes in your node pool up to date with the latest release version of Kubernetes.

  • autoRepair - (Optional) Specifies whether the node auto-repair is enabled for the node pool. If enabled, the nodes in this node pool will be monitored and, if they fail health checks too many times, an automatic repair action will be triggered.

This block also contains several computed attributes, documented below.

  • upgradeSettings - (Optional) Specifies the upgrade settings for NAP created node pools. Structure is documented below.

The upgradeSettings block supports:

  • strategy - (Optional) Strategy used for node pool update. Strategy can only be one of BLUE_GREEN or SURGE. The default is value is SURGE.

  • maxSurge - (Optional) The maximum number of nodes that can be created beyond the current size of the node pool during the upgrade process. To be used when strategy is set to SURGE. Default is 0.

  • maxUnavailable - (Optional) The maximum number of nodes that can be simultaneously unavailable during the upgrade process. To be used when strategy is set to SURGE. Default is 0.

  • blueGreenSettings - (Optional) Settings for blue-green upgrade strategy. To be specified when strategy is set to BLUE_GREEN. Structure is documented below.

The blueGreenSettings block supports:

  • nodePoolSoakDuration - (Optional) Time needed after draining entire blue pool. After this period, blue pool will be cleaned up. A duration in seconds with up to nine fractional digits, ending with 's'. Example: "3.5s".

  • standardRolloutPolicy: (Optional) Standard policy for the blue-green upgrade. To be specified when strategy is set to BLUE_GREEN. Structure is documented below.

The standardRolloutPolicy block supports:

  • batchPercentage: (Optional) Percentage of the bool pool nodes to drain in a batch. The range of this field should be (0.0, 1.0). Only one of the batch_percentage or batch_node_count can be specified.

  • batchNodeCount - (Optional) Number of blue nodes to drain in a batch. Only one of the batch_percentage or batch_node_count can be specified.

  • batchSoakDuration - (Optional) Soak time after each batch gets drained. A duration in seconds with up to nine fractional digits, ending with 's'. Example: "3.5s".`.

The authenticatorGroupsConfig block supports:

  • securityGroup - (Required) The name of the RBAC security group for use with Google security groups in Kubernetes RBAC. Group name must be in format gkeSecurityGroups@yourdomainCom.

The loggingConfig block supports:

  • enableComponents - (Required) The GKE components exposing logs. Supported values include: systemComponents, apiserver, controllerManager, scheduler, and workloads.

The monitoringConfig block supports:

  • enableComponents - (Optional) The GKE components exposing metrics. Supported values include: systemComponents, apiserver, controllerManager, and scheduler. In beta provider, workloads is supported on top of those 4 values. (workloads is deprecated and removed in GKE 1.24.)

  • managedPrometheus - (Optional) Configuration for Managed Service for Prometheus. Structure is documented below.

The managedPrometheus block supports:

  • enabled - (Required) Whether or not the managed collection is enabled.

The maintenancePolicy block supports:

  • dailyMaintenanceWindow - (Optional) structure documented below.
  • recurringWindow - (Optional) structure documented below
  • maintenanceExclusion - (Optional) structure documented below

In beta, one or the other of recurringWindow and dailyMaintenanceWindow is required if a maintenancePolicy block is supplied.

  • dailyMaintenanceWindow - Time window specified for daily maintenance operations. Specify startTime in RFC3339 format "HH:MM”, where HH : [00-23] and MM : [00-59] GMT. For example:

Examples:

maintenance_policy {
  daily_maintenance_window {
    start_time = "03:00"
  }
}
  • recurringWindow - Time window for recurring maintenance operations.

Specify startTime and endTime in RFC3339 "Zulu" date format. The start time's date is the initial date that the window starts, and the end time is used for calculating duration. Specify recurrence in RFC5545 RRULE format, to specify when this recurs. Note that GKE may accept other formats, but will return values in UTC, causing a permanent diff.

Examples:

maintenance_policy {
  recurring_window {
    start_time = "2019-08-01T02:00:00Z"
    end_time = "2019-08-01T06:00:00Z"
    recurrence = "FREQ=DAILY"
  }
}
maintenance_policy {
  recurring_window {
    start_time = "2019-01-01T09:00:00Z"
    end_time = "2019-01-01T17:00:00Z"
    recurrence = "FREQ=WEEKLY;BYDAY=MO,TU,WE,TH,FR"
  }
}
  • maintenanceExclusion - Exceptions to maintenance window. Non-emergency maintenance should not occur in these windows. A cluster can have up to three maintenance exclusions at a time Maintenance Window and Exclusions

The maintenanceExclusion block supports:

  • exclusionOptions - (Optional) MaintenanceExclusionOptions provides maintenance exclusion related options.

The exclusionOptions block supports:

  • scope - (Required) The scope of automatic upgrades to restrict in the exclusion window. One of: NO_UPGRADES | NO_MINOR_UPGRADES | NO_MINOR_OR_NODE_UPGRADES

Specify startTime and endTime in RFC3339 "Zulu" date format. The start time's date is the initial date that the window starts, and the end time is used for calculating duration.Specify recurrence in RFC5545 RRULE format, to specify when this recurs. Note that GKE may accept other formats, but will return values in UTC, causing a permanent diff.

Examples:

maintenance_policy {
  recurring_window {
    start_time = "2019-01-01T00:00:00Z"
    end_time = "2019-01-02T00:00:00Z"
    recurrence = "FREQ=DAILY"
  }
  maintenance_exclusion{
    exclusion_name = "batch job"
    start_time = "2019-01-01T00:00:00Z"
    end_time = "2019-01-02T00:00:00Z"
    exclusion_options {
      scope = "NO_UPGRADES"
    }
  }
  maintenance_exclusion{
    exclusion_name = "holiday data load"
    start_time = "2019-05-01T00:00:00Z"
    end_time = "2019-05-02T00:00:00Z"
    exclusion_options {
      scope = "NO_MINOR_UPGRADES"
    }
  }
}

The ipAllocationPolicy block supports:

  • clusterSecondaryRangeName - (Optional) The name of the existing secondary range in the cluster's subnetwork to use for pod IP addresses. Alternatively, clusterIpv4CidrBlock can be used to automatically create a GKE-managed one.

  • servicesSecondaryRangeName - (Optional) The name of the existing secondary range in the cluster's subnetwork to use for service clusterIps. Alternatively, servicesIpv4CidrBlock can be used to automatically create a GKE-managed one.

  • clusterIpv4CidrBlock - (Optional) The IP address range for the cluster pod IPs. Set to blank to have a range chosen with the default size. Set to /netmask (e.g. /14) to have a range chosen with a specific netmask. Set to a CIDR notation (e.g. 10.96.0.0/14) from the RFC-1918 private networks (e.g. 10.0.0.0/8, 172.16.0.0/12, 192.168.0.0/16) to pick a specific range to use.

  • servicesIpv4CidrBlock - (Optional) The IP address range of the services IPs in this cluster. Set to blank to have a range chosen with the default size. Set to /netmask (e.g. /14) to have a range chosen with a specific netmask. Set to a CIDR notation (e.g. 10.96.0.0/14) from the RFC-1918 private networks (e.g. 10.0.0.0/8, 172.16.0.0/12, 192.168.0.0/16) to pick a specific range to use.

  • stackType - (Optional) The IP Stack Type of the cluster. Default value is ipv4. Possible values are ipv4 and pv4Ipv6.

The masterAuth block supports:

  • clientCertificateConfig - (Required) Whether client certificate authorization is enabled for this cluster. For example:
master_auth {
  client_certificate_config {
    issue_client_certificate = false
  }
}

This block also contains several computed attributes, documented below.

The masterAuthorizedNetworksConfig block supports:

  • cidrBlocks - (Optional) External networks that can access the Kubernetes cluster master through HTTPS.

  • gcpPublicCidrsAccessEnabled - (Optional) Whether Kubernetes master is accessible via Google Compute Engine Public IPs.

The masterAuthorizedNetworksConfigCidrBlocks block supports:

  • cidrBlock - (Optional) External network that can access Kubernetes master through HTTPS. Must be specified in CIDR notation.

  • displayName - (Optional) Field for users to identify CIDR blocks.

The networkPolicy block supports:

  • provider - (Optional) The selected network policy provider. Defaults to PROVIDER_UNSPECIFIED.

  • enabled - (Required) Whether network policy is enabled on the cluster.

The nodeConfig block supports:

  • diskSizeGb - (Optional) Size of the disk attached to each node, specified in GB. The smallest allowed disk size is 10GB. Defaults to 100GB.

  • diskType - (Optional) Type of the disk attached to each node (e.g. 'pd-standard', 'pd-balanced' or 'pd-ssd'). If unspecified, the default disk type is 'pd-standard'

  • ephemeralStorageConfig - (Optional, [Beta]) Parameters for the ephemeral storage filesystem. If unspecified, ephemeral storage is backed by the boot disk. Structure is documented below.

ephemeral_storage_config {
  local_ssd_count = 2
}
  • localNvmeSsdBlockConfig - (Optional) Parameters for the local NVMe SSDs. Structure is documented below.

  • loggingVariant (Optional) Parameter for specifying the type of logging agent used in a node pool. This will override any cluster-wide default value. Valid values include DEFAULT and MAX_THROUGHPUT. See Increasing logging agent throughput for more information.

  • gcfsConfig - (Optional) Parameters for the Google Container Filesystem (GCFS). If unspecified, GCFS will not be enabled on the node pool. When enabling this feature you must specify imageType = "cosContainerd" and nodeVersion from GKE versions 1.19 or later to use it. For GKE versions 1.19, 1.20, and 1.21, the recommended minimum nodeVersion would be 1.19.15-gke.1300, 1.20.11-gke.1300, and 1.21.5-gke.1300 respectively. A machineType that has more than 16 GiB of memory is also recommended. GCFS must be enabled in order to use image streaming. Structure is documented below.

gcfs_config {
  enabled = true
}
  • gvnic - (Optional) Google Virtual NIC (gVNIC) is a virtual network interface. Installing the gVNIC driver allows for more efficient traffic transmission across the Google network infrastructure. gVNIC is an alternative to the virtIO-based ethernet driver. GKE nodes must use a Container-Optimized OS node image. GKE node version 1.15.11-gke.15 or later Structure is documented below.
gvnic {
  enabled = true
}
  • guestAccelerator - (Optional) List of the type and count of accelerator cards attached to the instance. Structure documented below. To support removal of guest_accelerators in Terraform 0.12 this field is an Attribute as Block

  • imageType - (Optional) The image type to use for this node. Note that changing the image type will delete and recreate all nodes in the node pool.

  • labels - (Optional) The Kubernetes labels (key/value pairs) to be applied to each node. The kubernetes.io/ and k8s.io/ prefixes are reserved by Kubernetes Core components and cannot be specified.

  • resourceLabels - (Optional) The GCP labels (key/value pairs) to be applied to each node. Refer here for how these labels are applied to clusters, node pools and nodes.

  • localSsdCount - (Optional) The amount of local SSD disks that will be attached to each cluster node. Defaults to 0.

  • machineType - (Optional) The name of a Google Compute Engine machine type. Defaults to e2Medium. To create a custom machine type, value should be set as specified here.

  • metadata - (Optional) The metadata key/value pairs assigned to instances in the cluster. From GKE 112 onwards, disableLegacyEndpoints is set to true by the API; if metadata is set but that default value is not included, Terraform will attempt to unset the value. To avoid this, set the value in your config.

  • minCpuPlatform - (Optional) Minimum CPU platform to be used by this instance. The instance may be scheduled on the specified or newer CPU platform. Applicable values are the friendly names of CPU platforms, such as intelHaswell. See the official documentation for more information.

  • oauthScopes - (Optional) The set of Google API scopes to be made available on all of the node VMs under the "default" service account. Use the "https://www.googleapis.com/auth/cloud-platform" scope to grant access to all APIs. It is recommended that you set serviceAccount to a non-default service account and grant IAM roles to that service account for only the resources that it needs.

    See the official documentation for information on migrating off of legacy access scopes.

  • preemptible - (Optional) A boolean that represents whether or not the underlying node VMs are preemptible. See the official documentation for more information. Defaults to false.

  • reservationAffinity (Optional) The configuration of the desired reservation which instances could take capacity from. Structure is documented below.

  • spot - (Optional) A boolean that represents whether the underlying node VMs are spot. See the official documentation for more information. Defaults to false.

  • sandboxConfig - (Optional, Beta) GKE Sandbox configuration. When enabling this feature you must specify imageType = "cosContainerd" and nodeVersion = "1127Gke17" or later to use it. Structure is documented below.

  • bootDiskKmsKey - (Optional) The Customer Managed Encryption Key used to encrypt the boot disk attached to each node in the node pool. This should be of the form projects/[KEY_PROJECT_ID]/locations/[LOCATION]/keyRings/[RING_NAME]/cryptoKeys/[KEY_NAME]. For more information about protecting resources with Cloud KMS Keys please see: https://cloud.google.com/compute/docs/disks/customer-managed-encryption

  • serviceAccount - (Optional) The service account to be used by the Node VMs. If not specified, the "default" service account is used.

  • shieldedInstanceConfig - (Optional) Shielded Instance options. Structure is documented below.

  • tags - (Optional) The list of instance tags applied to all nodes. Tags are used to identify valid sources or targets for network firewalls.

  • taint - (Optional) A list of Kubernetes taints to apply to nodes. GKE's API can only set this field on cluster creation. However, GKE will add taints to your nodes if you enable certain features such as GPUs. If this field is set, any diffs on this field will cause Terraform to recreate the underlying resource. Taint values can be updated safely in Kubernetes (eg. through kubectl), and it's recommended that you do not use this field to manage taints. If you do, lifecycleIgnoreChanges is recommended. Structure is documented below.

  • workloadMetadataConfig - (Optional) Metadata configuration to expose to workloads on the node pool. Structure is documented below.

  • kubeletConfig - (Optional) Kubelet configuration, currently supported attributes can be found here. Structure is documented below.

kubelet_config {
  cpu_manager_policy   = "static"
  cpu_cfs_quota        = true
  cpu_cfs_quota_period = "100us"
  pod_pids_limit       = 1024
}
  • linuxNodeConfig - (Optional) Linux node configuration, currently supported attributes can be found here. Note that validations happen all server side. All attributes are optional. Structure is documented below.
linux_node_config {
  sysctls = {
    "net.core.netdev_max_backlog" = "10000"
    "net.core.rmem_max"           = "10000"
  }
}
  • nodeGroup - (Optional) Setting this field will assign instances of this pool to run on the specified node group. This is useful for running workloads on sole tenant nodes.

  • advancedMachineFeatures - (Optional) Specifies options for controlling advanced machine features. Structure is documented below.

The advancedMachineFeatures block supports:

  • threadsPerCore - (Required) The number of threads per physical core. To disable simultaneous multithreading (SMT) set this to 1. If unset, the maximum number of threads supported per core by the underlying processor is assumed.

The ephemeralStorageConfig block supports:

  • localSsdCount (Required) - Number of local SSDs to use to back ephemeral storage. Uses NVMe interfaces. Each local SSD is 375 GB in size. If zero, it means to disable using local SSDs as ephemeral storage.

The localNvmeSsdBlockConfig block supports:

  • localSsdCount (Required) - Number of raw-block local NVMe SSD disks to be attached to the node. Each local SSD is 375 GB in size. If zero, it means no raw-block local NVMe SSD disks to be attached to the node. -> Note: Local NVMe SSD storage available in GKE versions v1.25.3-gke.1800 and later.

The gcfsConfig block supports:

  • enabled (Required) - Whether or not the Google Container Filesystem (GCFS) is enabled

The gvnic block supports:

  • enabled (Required) - Whether or not the Google Virtual NIC (gVNIC) is enabled

The guestAccelerator block supports:

  • type (Required) - The accelerator type resource to expose to this instance. E.g. nvidiaTeslaK80.

  • count (Required) - The number of the guest accelerator cards exposed to this instance.

  • gpuPartitionSize (Optional) - Size of partitions to create on the GPU. Valid values are described in the NVIDIA mig user guide.

  • gpuSharingConfig (Optional) - Configuration for GPU sharing. Structure is documented below.

The gpuSharingConfig block supports:

  • gpuSharingStrategy (Required) - The type of GPU sharing strategy to enable on the GPU node. Accepted values are:

    • "timeSharing": Allow multiple containers to have time-shared access to a single GPU device.
  • maxSharedClientsPerGpu (Required) - The maximum number of containers that can share a GPU.

The workloadIdentityConfig block supports:

  • workloadPool (Optional) - The workload pool to attach all Kubernetes service accounts to.
workload_identity_config {
  workload_pool = "${data.google_project.project.project_id}.svc.id.goog"
}

The nodePoolAutoConfig block supports:

  • networkTags (Optional, Beta) - The network tag config for the cluster's automatically provisioned node pools.

The networkTags block supports:

  • tags (Optional, Beta) - List of network tags applied to auto-provisioned node pools.
node_pool_auto_config {
  network_tags {
    tags = ["foo", "bar"]
  }
}

The nodePoolDefaults block supports:

  • nodeConfigDefaults (Optional) - Subset of NodeConfig message that has defaults.

The nodeConfigDefaults block supports:

  • loggingVariant (Optional) The type of logging agent that is deployed by default for newly created node pools in the cluster. Valid values include DEFAULT and MAX_THROUGHPUT. See Increasing logging agent throughput for more information.

  • gcfsConfig (Optional, Beta) The default Google Container Filesystem (GCFS) configuration at the cluster level. e.g. enable image streaming across all the node pools within the cluster. Structure is documented below.

The notificationConfig block supports:

  • pubsub (Required) - The pubsub config for the cluster's upgrade notifications.

The pubsub block supports:

  • enabled (Required) - Whether or not the notification config is enabled

  • topic (Optional) - The pubsub topic to push upgrade notifications to. Must be in the same project as the cluster. Must be in the format: projects/{project}/topics/{topic}.

  • filter (Optional) - Choose what type of notifications you want to receive. If no filters are applied, you'll receive all notification types. Structure is documented below.

notification_config {
  pubsub {
    enabled = true
    topic = google_pubsub_topic.notifications.id
  }
}

The filter block supports:

  • eventType (Optional) - Can be used to filter what notifications are sent. Accepted values are upgradeAvailableEvent, upgradeEvent and securityBulletinEvent. See Filtering notifications for more details.

The confidentialNodes block supports:

  • enabled (Required) - Enable Confidential Nodes for this cluster.

The podSecurityPolicyConfig block supports:

  • enabled (Required) - Enable the PodSecurityPolicy controller for this cluster. If enabled, pods must be valid under a PodSecurityPolicy to be created.

The privateClusterConfig block supports:

  • enablePrivateNodes (Optional) - Enables the private cluster feature, creating a private endpoint on the cluster. In a private cluster, nodes only have RFC 1918 private addresses and communicate with the master's private endpoint via private networking.

  • enablePrivateEndpoint (Optional) - When true, the cluster's private endpoint is used as the cluster endpoint and access through the public endpoint is disabled. When false, either endpoint can be used. This field only applies to private clusters, when enablePrivateNodes is true.

  • masterIpv4CidrBlock (Optional) - The IP range in CIDR notation to use for the hosted master network. This range will be used for assigning private IP addresses to the cluster master(s) and the ILB VIP. This range must not overlap with any other ranges in use within the cluster's network, and it must be a /28 subnet. See Private Cluster Limitations for more details. This field only applies to private clusters, when enablePrivateNodes is true.

  • masterGlobalAccessConfig (Optional) - Controls cluster master global access settings. If unset, Terraform will no longer manage this field and will not modify the previously-set value. Structure is documented below.

In addition, the privateClusterConfig allows access to the following read-only fields:

  • peeringName - The name of the peering between this cluster and the Google owned VPC.

  • privateEndpoint - The internal IP address of this cluster's master endpoint.

  • privateEndpointSubnetwork - Subnetwork in cluster's network where master's endpoint will be provisioned.

  • publicEndpoint - The external IP address of this cluster's master endpoint.

!> The Google provider is unable to validate certain configurations of privateClusterConfig when enablePrivateNodes is false. It's recommended that you omit the block entirely if the field is not set to true.

The privateClusterConfigMasterGlobalAccessConfig block supports:

  • enabled (Optional) - Whether the cluster master is accessible globally or not.

The reservationAffinity block supports:

  • consumeReservationType (Required) The type of reservation consumption Accepted values are:

    • "unspecified": Default value. This should not be used.
    • "noReservation": Do not consume from any reserved capacity.
    • "anyReservation": Consume any reservation available.
    • "specificReservation": Must consume from a specific reservation. Must specify key value fields for specifying the reservations.
    • key (Optional) The label key of a reservation resource. To target a SPECIFIC_RESERVATION by name, specify "compute.googleapis.com/reservation-name" as the key and specify the name of your reservation as its value.
    • values (Optional) The list of label values of reservation resources. For example: the name of the specific reservation when using a key of "compute.googleapis.com/reservation-name"

The sandboxConfig block supports:

  • sandboxType (Required) Which sandbox to use for pods in the node pool. Accepted values are:

    • "gvisor": Pods run within a gVisor sandbox.

The releaseChannel block supports:

  • channel - (Required) The selected release channel. Accepted values are:
  • UNSPECIFIED: Not set.
  • RAPID: Weekly upgrade cadence; Early testers and developers who requires new features.
  • REGULAR: Multiple per month upgrade cadence; Production users who need features not yet offered in the Stable channel.
  • STABLE: Every few months upgrade cadence; Production users who need stability above all else, and for whom frequent upgrades are too risky.

The costManagementConfig block supports:

The resourceUsageExportConfig block supports:

  • enableNetworkEgressMetering (Optional) - Whether to enable network egress metering for this cluster. If enabled, a daemonset will be created in the cluster to meter network egress traffic.

  • enableResourceConsumptionMetering (Optional) - Whether to enable resource consumption metering on this cluster. When enabled, a table will be created in the resource export BigQuery dataset to store resource consumption data. The resulting table can be joined with the resource usage table or with BigQuery billing export. Defaults to true.

  • bigqueryDestination (Required) - Parameters for using BigQuery as the destination of resource usage export.

  • bigqueryDestinationDatasetId (Required) - The ID of a BigQuery Dataset. For Example:

resource_usage_export_config {
  enable_network_egress_metering = false
  enable_resource_consumption_metering = true

  bigquery_destination {
    dataset_id = "cluster_resource_usage"
  }
}

The shieldedInstanceConfig block supports:

  • enableSecureBoot (Optional) - Defines if the instance has Secure Boot enabled.

Secure Boot helps ensure that the system only runs authentic software by verifying the digital signature of all boot components, and halting the boot process if signature verification fails. Defaults to false.

  • enableIntegrityMonitoring (Optional) - Defines if the instance has integrity monitoring enabled.

Enables monitoring and attestation of the boot integrity of the instance. The attestation is performed against the integrity policy baseline. This baseline is initially derived from the implicitly trusted boot image when the instance is created. Defaults to true.

The taint block supports:

  • key (Required) Key for taint.

  • value (Required) Value for taint.

  • effect (Required) Effect for taint. Accepted values are noSchedule, preferNoSchedule, and noExecute.

The workloadMetadataConfig block supports:

  • mode (Required) How to expose the node metadata to the workload running on the node. Accepted values are:
  • MODE_UNSPECIFIED: Not Set
  • GCE_METADATA: Expose all Compute Engine metadata to pods.
  • GKE_METADATA: Run the GKE Metadata Server on this node. The GKE Metadata Server exposes a metadata API to workloads that is compatible with the V1 Compute Metadata APIs exposed by the Compute Engine and App Engine Metadata Servers. This feature can only be enabled if workload identity is enabled at the cluster level.

The kubeletConfig block supports:

  • cpuManagerPolicy - (Required) The CPU management policy on the node. See K8S CPU Management Policies. One of "none" or "static". Defaults to none when kubeletConfig is unset.

  • cpuCfsQuota - (Optional) If true, enables CPU CFS quota enforcement for containers that specify CPU limits.

  • cpuCfsQuotaPeriod - (Optional) The CPU CFS quota period value. Specified as a sequence of decimal numbers, each with optional fraction and a unit suffix, such as "300Ms". Valid time units are "ns", "us" (or "µs"), "ms", "s", "m", "h". The value must be a positive duration.

-> Note: At the time of writing (2020/08/18) the GKE API rejects the none value and accepts an invalid default value instead. While this remains true, not specifying the kubeletConfig block should be the equivalent of specifying none.

  • podPidsLimit - (Optional) Controls the maximum number of processes allowed to run in a pod. The value must be greater than or equal to 1024 and less than 4194304.

The linuxNodeConfig block supports:

  • sysctls - (Required) The Linux kernel parameters to be applied to the nodes and all pods running on the nodes. Specified as a map from the key, such as netCoreWmemMax, to a string value.

The verticalPodAutoscaling block supports:

  • enabled (Required) - Enables vertical pod autoscaling

The dnsConfig block supports:

  • clusterDns - (Optional) Which in-cluster DNS provider should be used. providerUnspecified (default) or platformDefault or cloudDns.

  • clusterDnsScope - (Optional) The scope of access to cluster DNS records. dnsScopeUnspecified (default) or clusterScope or vpcScope.

  • clusterDnsDomain - (Optional) The suffix used for all cluster service records.

The gatewayApiConfig block supports:

  • channel - (Required) Which Gateway Api channel should be used. channelDisabled or channelStandard.

The protectConfig block supports:

  • workloadConfig - (Optional, Beta) WorkloadConfig defines which actions are enabled for a cluster's workload configurations. Structure is documented below

  • workloadVulnerabilityMode - (Optional, Beta) Sets which mode to use for Protect workload vulnerability scanning feature. Accepted values are WORKLOAD_VULNERABILITY_MODE_UNSPECIFIED, DISABLED, BASIC.

The protectConfigWorkloadConfig block supports:

  • auditMode - (Optional, Beta) WorkloadConfig defines the flags to enable or disable the workload configurations for the cluster. Accepted values are MODE_UNSPECIFIED, DISABLED, BASIC.

Attributes Reference

In addition to the arguments listed above, the following computed attributes are exported:

  • id - an identifier for the resource with format projects/{{project}}/locations/{{zone}}/clusters/{{name}}

  • selfLink - The server-defined URL for the resource.

  • endpoint - The IP address of this cluster's Kubernetes master.

  • labelFingerprint - The fingerprint of the set of labels for this cluster.

  • maintenancePolicy0DailyMaintenanceWindow0Duration - Duration of the time window, automatically chosen to be smallest possible in the given scenario. Duration will be in RFC3339 format "PTnHnMnS".

  • masterAuth0ClientCertificate - Base64 encoded public certificate used by clients to authenticate to the cluster endpoint.

  • masterAuth0ClientKey - Base64 encoded private key used by clients to authenticate to the cluster endpoint.

  • masterAuth0ClusterCaCertificate - Base64 encoded public certificate that is the root certificate of the cluster.

  • masterVersion - The current version of the master in the cluster. This may be different than the minMasterVersion set in the config if the master has been updated by GKE.

  • tpuIpv4CidrBlock - The IP address range of the Cloud TPUs in this cluster, in CIDR notation (e.g. 1234/29).

  • servicesIpv4Cidr - The IP address range of the Kubernetes services in this cluster, in CIDR notation (e.g. 1234/29). Service addresses are typically put in the last /16 from the container CIDR.

  • clusterAutoscaling0AutoProvisioningDefaults0Management0UpgradeOptions - Specifies the Auto Upgrade knobs for the node pool.

Timeouts

This resource provides the following Timeouts configuration options: configuration options:

  • create - Default is 40 minutes.
  • read - Default is 40 minutes.
  • update - Default is 60 minutes.
  • delete - Default is 40 minutes.

Import

GKE clusters can be imported using the project , location, and name. If the project is omitted, the default provider value will be used. Examples:

$ terraform import google_container_cluster.mycluster projects/my-gcp-project/locations/us-east1-a/clusters/my-cluster

$ terraform import google_container_cluster.mycluster my-gcp-project/us-east1-a/my-cluster

$ terraform import google_container_cluster.mycluster us-east1-a/my-cluster

\~> Note: This resource has several fields that control Terraform-specific behavior and aren't present in the API. If they are set in config and you import a cluster, Terraform may need to perform an update immediately after import. Most of these updates should be no-ops but some may modify your cluster if the imported state differs.

For example, the following fields will show diffs if set in config:

  • minMasterVersion
  • removeDefaultNodePool

User Project Overrides

This resource supports User Project Overrides.