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

Error deleting default node pool: googleapi: Error 404: Not found #2184

Closed
amingilani opened this issue Oct 8, 2018 · 4 comments
Closed
Labels

Comments

@amingilani
Copy link

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
  • Please do not leave "+1" or "me too" comments, they generate extra noise for issue followers and do not help prioritize the request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment
  • If an issue is assigned to the "modular-magician" user, it is either in the process of being autogenerated, or is planned to be autogenerated soon. If an issue is assigned to a user, that user is claiming responsibility for the issue. If an issue is assigned to "hashibot", a community member has claimed the issue already.

Terraform Version

Terraform v0.11.8
+ provider.google v1.18.0

Affected Resource(s)

  • google_container_cluster

Terraform Configuration Files

/* This configuration sets up a Kubernetes Cluster following
   https://www.doxsey.net/blog/kubernetes--the-surprisingly-affordable-platform-for-personal-projects

   Confession: there's a minor difference between the article and my config, the
   former created a Cluster and configured the default node pool, however the options
   for doing this via the API are limited, so my configuration creates an empty
   default node pool for the cluster, and the creates and adds a fully configured
   one on top
    */

provider "google" {
  credentials = "${file("secret-account.json")}"
  project     = "worklark-218609"
  zone        = "us-central1-a"
}

# Node pool configuration
resource "google_container_node_pool" "primary_pool" {
  name       = "worklark-node-pool"
  cluster    = "${google_container_cluster.primary.name}"
  node_count = 3

  node_config {
    machine_type = "f1-micro"
    disk_size_gb = 10         # Set the initial disk size
    preemptible  = true
  }

  management {
    auto_repair  = true
    auto_upgrade = true
  }
}

# configuration
resource "google_container_cluster" "primary" {
  name               = "worklark-cluster"
  logging_service    = "none"
  monitoring_service = "none"

  addons_config {
    kubernetes_dashboard {
      disabled = false # Configure the Kubernetes dashboard
    }

    http_load_balancing {
      disabled = false # Configure the Kubernetes dashboard
    }
  }

  remove_default_node_pool = "true"

  node_pool {
    name = "imploding-pool"
  }
}

resource "google_compute_firewall" "default" {
  name        = "http-https"
  network     = "${google_container_cluster.primary.network}"
  description = "Enable HTTP and HTTPS access"

  direction = "INGRESS"

  allow {
    protocol = "tcp"
    ports    = ["80", "443"]
  }
}

Debug Output

https://gist.github.com/amingilani/d8481a323a19cf051d826b2514c04299#file-terraform-output-failure-txt

Expected Behavior

The entire plan should have applied with no errors.

Actual Behavior

The plan threw an error and stopped. I believe the error occured because it tried to delete the default node pool (remove_default_node_pool = true), but the default node pool hadn't yet been created.

Steps to Reproduce

  1. terraform apply

Important Factoids

References

@ghost ghost added the bug label Oct 8, 2018
@amingilani
Copy link
Author

I fixed it by making by changing the name of the default pool from very creative imploding-pool to the default default-pool:

  node_pool {
    name = "imploding-pool"
  }

I'm going to leave this open, because I still don't understand why this happened :/ can't I specify the name of the pool when creating it?

@structurefall
Copy link

@amingilani can you explain your default-pool workaround a little more? Once you changed the name of the pool associated with the cluster resource, did you change the name in the google_container_node_pool resource as well? Did you have to destroy the cluster to make this work?

I've been trying all sorts of combinations with that, and so far I'm still getting the 404 error.

@danawillow
Copy link
Contributor

Hey @amingilani, the reason the default node pool can't be found is that if you add a node pool at cluster creation time (on the cluster resource), then it won't add a default node pool. I'd recommend only defining your node pools via the node pool resource and using remove_default_node_pool on the cluster, that way you can fully make changes to the node pools. I'm going to go ahead and close this out since I don't think there's anything that needs to change in the provider, but let me know if you have any other questions!

@ghost
Copy link

ghost commented Jan 12, 2019

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.

If you feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. If you feel I made an error 🤖 🙉 , please reach out to my human friends 👉 [email protected]. Thanks!

@ghost ghost locked and limited conversation to collaborators Jan 12, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

3 participants