Open ttruong-actian opened 5 months ago
Hi @ttruong-actian!
To replicate this issue we need the full name of the terraform resource, I found the service google_service_account in terraform registry, but it don't contain any argument or attribute called disk_type
Also please share the full code of the resource, because we can't replicate the issue with information that only you know. For sensitive information you could change it with examples like:
project = "my-project" org_id = "1234567890" email = "my-user@my-domain.com"
hi @ggtisc ,
my bad about the missing details. Here's my sample code for the cluster_autoscaling
block with auto_provisioning_defaults. I wanted to use this block to define the ServiceAccount and KMSEncryptionKey for all node pools. In this block, the disk_type
and disk_size
are indicated as optional but they're set with a Default Value of 100Gb and pd-standard
.
enabled = var.cluster_autoscaling.enabled
dynamic "auto_provisioning_defaults" {
for_each = var.cluster_autoscaling.enabled ? [1] : []
content {
service_account = google_service_account.main_cluster.email
oauth_scopes = local.node_oauth_scopes
boot_disk_kms_key = var.cluster_autoscaling.manual_updated_nap ? var.kms_encryption_key : null
management {
auto_repair = lookup(var.cluster_autoscaling, "auto_repair", false)
auto_upgrade = lookup(var.cluster_autoscaling, "auto_upgrade", false)
}
upgrade_settings {
strategy = "SURGE"
max_surge = 1
max_unavailable = 0
}
}
}
When I tried to enable node-autoprovisioning via gcloud
cli with a config file, the disk_type
and disk_size
are not required. my sample nap-config file below
autoprovisioningLocations:
- us-central1-a
- us-central1-c
bootDiskKmsKey: projects/<name>/locations/us-central1/keyRings/<ring>/cryptoKeys/<key>
imageType: COS_CONTAINERD
serviceAccount: <name>@<project>.iam.gserviceaccount.com
scopes:
- https://www.googleapis.com/auth/logging.write
- https://www.googleapis.com/auth/monitoring
resourceLimits:
- resourceType: 'cpu'
maximum: 100
- resourceType: 'memory'
maximum: 100
Thanks!
As you can see in Google Cloud documentation looking for the diskType
field you'll notice that the default disk type
is pd-standard
if you don't set a value for this optional field.
If you're looking to use a hyperdisk-balanced
you need to define it. If you need help on how to use it you could check the documentation here, and the different disk types here.
If after this you continue with issues please share a full code of your google_container_cluster
like this.
Community Note
Terraform Version & Provider Version(s)
Terraform v1.8.3 on darwin_arm64
Affected Resource(s)
node autoprovisioning does not required
disk_type
to be defined with default settings. that way, we NAP can create node pools with N2/N4 where differentdisk_type
are required.Terraform Configuration