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

container cluster is not indemptent #3208

Closed
roidelapluie opened this issue Mar 9, 2019 · 4 comments
Closed

container cluster is not indemptent #3208

roidelapluie opened this issue Mar 9, 2019 · 4 comments
Assignees
Labels
bug forward/review In review; remove label to forward service/container

Comments

@roidelapluie
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.12

  • provider.google v2.1.0
    `

Affected Resource(s)

  • google_container_cluster

Terraform Configuration Files

provider "google" {

  project     = "test-isocial"
#  region      = "europe-west1"
#  zone        = "europe-west1-b"
  region      = "us-west2"
  zone        = "us-west2-b"
}



data "google_compute_image" "centos7" {
  family    = "centos-7"
  project = "centos-cloud"
}

resource "google_compute_instance" "gcp-mgmt01" {
  name = "gcp-mgmt01"
  machine_type = "f1-micro"

  boot_disk {
    initialize_params {
      image = "${data.google_compute_image.centos7.self_link}"
    }
  }

  metadata = {
    purpose = "isocial"
  }

  network_interface {
    network = "default"
    access_config {
        network_tier = "PREMIUM"
#        network_tier = "STANDARD"
    }
  }
}

resource "google_container_cluster" "primary" {
  name   = "my-gke-cluster"
  region = "us-central1"

  # We can't create a cluster with no node pool defined, but we want to only use
  # separately managed node pools. So we create the smallest possible default
  # node pool and immediately delete it.
  remove_default_node_pool = true
  initial_node_count = 1

  # Setting an empty username and password explicitly disables basic auth
  master_auth {
    username = ""
    password = ""
  }

  node_config {
    oauth_scopes = [
      "https://www.googleapis.com/auth/compute",
      "https://www.googleapis.com/auth/devstorage.read_only",
      "https://www.googleapis.com/auth/logging.write",
      "https://www.googleapis.com/auth/monitoring",
    ]

    labels = {
      foo = "bar"
    }

    tags = ["foo", "bar"]
  }
}

resource "google_container_node_pool" "primary_preemptible_nodes" {
  name       = "my-node-pool"
  region     = "us-central1"
  cluster    = "${google_container_cluster.primary.name}"
  node_count = 1

  node_config {
   # preemptible  = true
    machine_type = "f1-micro"

    oauth_scopes = [
      "https://www.googleapis.com/auth/compute",
      "https://www.googleapis.com/auth/devstorage.read_only",
      "https://www.googleapis.com/auth/logging.write",
      "https://www.googleapis.com/auth/monitoring",
    ]
  }
}

# The following outputs allow authentication and connectivity to the GKE Cluster
# by using certificate-based authentication.
output "client_certificate" {
  value = "${google_container_cluster.primary.master_auth.0.client_certificate}"
}

output "client_key" {
  value = "${google_container_cluster.primary.master_auth.0.client_key}"
}

output "cluster_ca_certificate" {
  value = "${google_container_cluster.primary.master_auth.0.cluster_ca_certificate}"
}

output "cluster_version" {
  value = "${google_container_cluster.primary.master_version}"
}

Expected Behavior

I run terraform apply.

I run it again, nothing changes

Actual Behavior

google_container_cluster.primary is recreated

Steps to Reproduce

  1. Use above config
  2. terraform apply
  3. terraform apply

Output : https://gist.github.com/roidelapluie/accd50e74de46c99cde1f0fec3113ef7

@ghost ghost added the bug label Mar 9, 2019
@mattnworb
Copy link

mattnworb commented Mar 11, 2019

Looking at https://www.terraform.io/docs/providers/google/r/container_node_pool.html, you seem to have a mix of what is recommended there in your resource "google_container_cluster" "primary" and resource "google_container_node_pool" "primary_preemptible_nodes" - I believe that if you set remove_default_node_pool = true in google_container_cluster then you should not also specify node_config.

see also #2115

@chrisst chrisst self-assigned this Mar 18, 2019
@PsyonixBarrett
Copy link

Thanks @mattnworb - that solved my "issue".

@rileykarson rileykarson assigned rileykarson and unassigned chrisst Mar 18, 2019
@roidelapluie
Copy link
Author

Thanks. Not a bug!

@ghost
Copy link

ghost commented Apr 18, 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 Apr 18, 2019
@github-actions github-actions bot added service/container forward/review In review; remove label to forward labels Jan 15, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug forward/review In review; remove label to forward service/container
Projects
None yet
Development

No branches or pull requests

5 participants