hashicorp / terraform-provider-google

Terraform Provider for Google Cloud Platform
https://registry.terraform.io/providers/hashicorp/google/latest/docs
Mozilla Public License 2.0
2.29k stars 1.72k forks source link

Removing deprecated API fields from GKE Resources #7185

Open upodroid opened 4 years ago

upodroid commented 4 years ago

Affected Resource(s)

According to this page, https://cloud.google.com/kubernetes-engine/docs/reference/rest/v1/projects.locations.clusters and https://cloud.google.com/kubernetes-engine/docs/reference/rest/v1beta1/projects.locations.clusters Google has deprecated a lot of fields from the API which need to be removed in v4 of the provider.

Fields that need to be marked as removed in v4.

initial_node_count
cluster_ipv4_cidr
instance_group_urls

Fields that need to be renamed in v4

cluster_ipv4_cidr => cluster_ipv4_cidr_block
services_ipv4_cidr => services_ipv4_cidr_block
node_config => node_pool.*.config
enable_tpu => tpu_config.enabled and tpu_config_use_service_networking

Fields that were marked Removed in v3 and need to be removed from the code in v4.

zone
region
additional_zones
addons_config.kubernetes_dashboard
subnetwork_name
node_ipv4_cidr_block

b/299312685

apex-omontgomery commented 3 years ago

node_config allows someone to network tag for firewall rule application. After the cluster is provisioned they can use the remove_default_node_pool to delete it, at which point they can use a google_container_node_pool to create the node pools that should persist.

Current docs state that using resource:google_container_node_pool and resource:google_container_cluster.node_pool together are incompatible.

node_pool - (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.

Does this API change make a workflow where the temporary default pools could not have a network tag applied?

rileykarson commented 3 years ago

See https://github.com/hashicorp/terraform-provider-google/issues/4963#issuecomment-557268286 for what configuration would look like for default-pool specific configuration if we removed the node_config field.

apex-omontgomery commented 3 years ago

Thank you for this answer.

c2thorn commented 2 years ago

We don't necessarily have to do the renames here, we could focus on the deprecated fields.

rileykarson commented 2 years ago

We did a partial removal in 4.0.0, but did not completely remove every associated field. Remaining values for cluster @ GA include:

initial_node_count
node_config
node_version
statusMessage (used inline, not a user-visible field)
c2thorn commented 1 year ago

Dropping from 5.0.0.