Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GKE cluster forces replacement after updating DNS config #1744

Closed
siva-spotdraft opened this issue Sep 21, 2023 · 4 comments
Closed

GKE cluster forces replacement after updating DNS config #1744

siva-spotdraft opened this issue Sep 21, 2023 · 4 comments
Labels
bug Something isn't working Stale

Comments

@siva-spotdraft
Copy link

TL;DR

after adding

cluster_dns_provider   = "CLOUD_DNS"
cluster_dns_scope      = "CLUSTER_SCOPE"

Screenshot 2023-09-21 at 11 12 27 AM

gcp terraform provider version: 4.82.0
gke version: 1.25.12-gke.500

module and version

source             = "terraform-google-modules/kubernetes-engine/google//modules/safer-cluster"
version            = "27.0.0"

Expected behavior

cluster should not be recreated by terraform

Observed behavior

TF forces replacement of clusterthe

Terraform Configuration

// GKE cluster EU

module "gke" {
  source             = "terraform-google-modules/kubernetes-engine/google//modules/safer-cluster"
  version            = "27.0.0"
  project_id         = module.enabled_google_apis.project_id
  name               = var.EU.cluster_name
  region             = var.EU.region
  regional           = false
  kubernetes_version = var.k8s_version_eu
  release_channel    = "STABLE"
  cluster_resource_labels = {
    "sprinto" = "notprod" #label to classify resources in sprinto
  }
  zones                        = var.gke-zones-eu
  network                      = module.vpc.network_name
  subnetwork                   = var.EU.subnet_name
  ip_range_pods                = var.EU.ip_range_pods_name
  dns_cache                    = true
  ip_range_services            = var.EU.ip_range_services_name
  datapath_provider            = "DATAPATH_PROVIDER_UNSPECIFIED"
  enable_private_endpoint      = true
  master_ipv4_cidr_block       = "172.0.0.0/28"
  authenticator_security_group = "[email protected]"
  master_authorized_networks = [{
    cidr_block   = "${module.bastion-india.ip_address}/32"
    display_name = "Bastion Host"
  }]
  grant_registry_access  = true
  maintenance_start_time = "2023-01-17T00:01:00Z"
  maintenance_end_time   = "2023-01-17T06:01:00Z"
  maintenance_recurrence = "FREQ=WEEKLY;BYDAY=SU,SA"
  node_pools = [
    {
      name                      = "on-demand-4c-16gb-with-taints"
      machine_type              = "n2-standard-4"
      min_count                 = 0
      max_count                 = 2
      disk_size_gb              = 100
      disk_type                 = "pd-standard"
      image_type                = "COS_CONTAINERD"
      auto_repair               = true
      auto_upgrade              = true
      preemptible               = false
      initial_node_count        = 0
      node_metadata             = "GKE_METADATA"
      default_max_pods_per_node = 60
    },
    {
      name                      = "on-demand-4c-16gb-with-taints-1"
      machine_type              = "n2-standard-4"
      min_count                 = 0
      max_count                 = 1
      disk_size_gb              = 100
      disk_type                 = "pd-standard"
      image_type                = "COS_CONTAINERD"
      auto_repair               = true
      auto_upgrade              = true
      preemptible               = false
      initial_node_count        = 0
      node_metadata             = "GKE_METADATA"
      default_max_pods_per_node = 60
    },
    {
      name                      = "preemp-dev-n2standard4-1"
      machine_type              = "n2-standard-8"
      min_count                 = 0
      max_count                 = 5
      disk_size_gb              = 100
      disk_type                 = "pd-standard"
      image_type                = "COS_CONTAINERD"
      auto_repair               = true
      auto_upgrade              = true
      preemptible               = true
      initial_node_count        = 1
      enable_gcfs               = true
      node_metadata             = "GKE_METADATA"
      default_max_pods_per_node = 60
    },
    {
      name                      = "preemp-qa-n2standard4-1"
      machine_type              = "n2-standard-8"
      min_count                 = 0
      max_count                 = 4
      disk_size_gb              = 100
      disk_type                 = "pd-standard"
      image_type                = "COS_CONTAINERD"
      auto_repair               = true
      auto_upgrade              = true
      preemptible               = true
      initial_node_count        = 1
      node_metadata             = "GKE_METADATA"
      default_max_pods_per_node = 60
    },
    {
      name                      = "preemp-dev-n2dstandard4-1"
      machine_type              = "n2d-standard-8"
      min_count                 = 0
      max_count                 = 6
      disk_size_gb              = 100
      disk_type                 = "pd-standard"
      image_type                = "COS_CONTAINERD"
      auto_repair               = true
      auto_upgrade              = true
      preemptible               = true
      initial_node_count        = 1
      node_metadata             = "GKE_METADATA"
      default_max_pods_per_node = 60
    },
  ]
  node_pools_labels = {
    all = {}
    on-demand-4c-16gb-with-taints = {
      on-demand = "true"
    }
    on-demand-4c-16gb-with-taints-1 = {
      app = "qa"
    }
    preemp-dev-n2standard4-1 = {
      app         = "dev"
      preemptible = "true"
    }
    preemp-qa-n2standard4-1 = {
      app         = "qa"
      preemptible = "true"
    }
    preemp-dev-n2dstandard4-1 = {
      app         = "dev"
      preemptible = "true"
    }
  }
  node_pools_taints = {
    all = []

    on-demand-4c-16gb-with-taints = [
      {
        key    = "on-demand"
        value  = "true"
        effect = "NO_SCHEDULE"
      },
    ]
    on-demand-4c-16gb-with-taints-1 = [
      {
        key    = "on-demand"
        value  = "true"
        effect = "NO_SCHEDULE"
      },
    ]
    preemp-qa-n2standard4-1 = [
      {
        key    = "preemptible"
        value  = "true"
        effect = "NO_SCHEDULE"
      },
      {
        key    = "env"
        value  = "qa"
        effect = "NO_SCHEDULE"
      },
    ]


  }
}

Terraform Version

v0.14.9

Additional information

No response

@siva-spotdraft siva-spotdraft added the bug Something isn't working label Sep 21, 2023
@54nd20
Copy link

54nd20 commented Nov 16, 2023

I think this is related to the issue #1783

Copy link

This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 7 days

@github-actions github-actions bot added the Stale label Jan 15, 2024
@54nd20
Copy link

54nd20 commented Jan 15, 2024

Related to: #1833

@github-actions github-actions bot removed the Stale label Jan 16, 2024
Copy link

This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 7 days

@github-actions github-actions bot added the Stale label Mar 16, 2024
@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Mar 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working Stale
Projects
None yet
Development

No branches or pull requests

2 participants