terraform-google-modules / terraform-google-kubernetes-engine

Configures opinionated GKE clusters
https://registry.terraform.io/modules/terraform-google-modules/kubernetes-engine/google
Apache License 2.0
1.13k stars 1.15k forks source link

Add reservation_affinity to node_pools config #1990

Closed A-Bush closed 1 week ago

A-Bush commented 2 months ago

TL;DR

Add possibility to create nodepools from specific reservation

Terraform Resources

https://cloud.google.com/kubernetes-engine/docs/how-to/consuming-reservations#specific
https://registry.terraform.io/providers/hashicorp/google/latest/docs/resources/container_cluster#nested_reservation_affinity

Detailed design

Add possibility to request specific reservations in nodepools like Hashicorp Terraform provider for Google Cloud

  node_config {
    machine_type = "e2-medium"

    reservation_affinity {
      consume_reservation_type = "SPECIFIC_RESERVATION"
      key                      = "compute.googleapis.com/reservation-name"
      values                   = [google_compute_reservation.specific_reservation.name]
    }
  }


### Additional information

_No response_
song-william commented 1 month ago

This would help our project as well! Our nodes require capacity reservations to be hit.

DrFaust92 commented 1 month ago

Ill try to take a look at this in the upcoming week