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

reason:NetworkPluginNotReady message:Network plugin returns error: cni plugin not initialized #2247

Open
sadathknorket opened this issue Jan 16, 2025 · 0 comments

Comments

@sadathknorket
Copy link

Hi , I encounter weird behaviour with this configuration .

Initially when I run this terraform it works provisioning the nodepools and nodes I need , But when I deleted the node pool manually and re-run this terraform to create a new node pool the nodes are not able to join the cluster and I get error saying reason:NetworkPluginNotReady message:Network plugin returns error: cni plugin not initialized

module "vpc" {
  source  = "terraform-google-modules/network/google"
  version = "~> 10.0"

  project_id   = ""
  network_name = "example-vpc4"
  routing_mode = "GLOBAL"

  subnets = [
    {
      subnet_name           = "subnet-01"
      subnet_ip             = "10.10.0.0/16" 
      subnet_region         = "us-west1"
    }
  ]

  secondary_ranges = {
    subnet-01 = [
      {
        range_name    = "subnet-01-secondary-01"
        ip_cidr_range = "192.168.0.0/16" # Large range for pods
      },
      {
        range_name    = "subnet-01-secondary-02"
        ip_cidr_range = "192.169.0.0/16" # Large range for services
      }
    ]
  }

  routes = [
    {
      name                   = "egress-internet1"
      description            = "route through IGW to access internet"
      destination_range      = "0.0.0.0/0"
      tags                   = "egress-inet"
      next_hop_internet      = true
    }
  ]
}

module "gke" {
  source                     = "terraform-google-modules/kubernetes-engine/google//modules/private-cluster"
  version                    = "~> 35.0"
  project_id                 = ""
  name                       = "gke-test-4"
  region                     = "us-west1"
  zones                      = ["us-west1-a"]
  network                    = module.vpc.network_name
  subnetwork                 = "subnet-01"
  ip_range_pods              = "subnet-01-secondary-01"
  ip_range_services          = "subnet-01-secondary-02"
  http_load_balancing        = false
  network_policy             = false
  horizontal_pod_autoscaling = true
  filestore_csi_driver       = false
  dns_cache                  = false
  deletion_protection        = false

  node_pools = [
    {
      name                        = "default-node-pool"
      machine_type                = "e2-medium"
      autoscaling                 = true
      node_locations              = "us-west1-a"
      min_count                   = 1
      max_count                   = 10
      local_ssd_count             = 0
      spot                        = false
      disk_size_gb                = 100
      disk_type                   = "pd-standard"
      image_type                  = "COS_CONTAINERD"
      auto_repair                 = true
      auto_upgrade                = true
      service_account             = "svc_account" (with owner role)
    }
  ]

  depends_on = [module.vpc]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant