Add machine type variable to GKE.
This commit is contained in:
@@ -22,6 +22,13 @@ variable "private_subnetwork_id" {
|
||||
type = string
|
||||
}
|
||||
|
||||
variable "machine_type" {
|
||||
description = "Machine type for GKE nodes."
|
||||
type = string
|
||||
# Default is very cheap but low ram. Good for simple testing but not for production. Try e2-standard-2 if you need more ram.
|
||||
default = "e2-medium"
|
||||
}
|
||||
|
||||
output "gke_connect_command" {
|
||||
description = "Command to run to connect to the kubernetes cluster."
|
||||
value = "gcloud container clusters get-credentials ${google_container_cluster.primary.name} --region ${var.region} --project ${var.project}"
|
||||
@@ -179,7 +186,7 @@ resource "google_container_node_pool" "primary" {
|
||||
|
||||
node_config {
|
||||
preemptible = true
|
||||
machine_type = "e2-medium"
|
||||
machine_type = var.machine_type
|
||||
|
||||
service_account = google_service_account.gke.email
|
||||
oauth_scopes = [
|
||||
|
||||
Reference in New Issue
Block a user