Add machine type variable to GKE.
This commit is contained in:
parent
858d8ad35a
commit
bae77832d2
@ -80,6 +80,7 @@ module "gke" {
|
|||||||
private_network_id = module.networking.private_network_id
|
private_network_id = module.networking.private_network_id
|
||||||
private_subnetwork_id = module.networking.private_subnetwork_id
|
private_subnetwork_id = module.networking.private_subnetwork_id
|
||||||
service_cloudkms = google_project_service.cloudkms
|
service_cloudkms = google_project_service.cloudkms
|
||||||
|
machine_type = "e2-standard-2"
|
||||||
|
|
||||||
depends_on = [
|
depends_on = [
|
||||||
module.networking
|
module.networking
|
||||||
|
@ -22,6 +22,13 @@ variable "private_subnetwork_id" {
|
|||||||
type = string
|
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" {
|
output "gke_connect_command" {
|
||||||
description = "Command to run to connect to the kubernetes cluster."
|
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}"
|
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 {
|
node_config {
|
||||||
preemptible = true
|
preemptible = true
|
||||||
machine_type = "e2-medium"
|
machine_type = var.machine_type
|
||||||
|
|
||||||
service_account = google_service_account.gke.email
|
service_account = google_service_account.gke.email
|
||||||
oauth_scopes = [
|
oauth_scopes = [
|
||||||
|
Loading…
x
Reference in New Issue
Block a user