From db21d290356543acdca0b626fb3541313159e06f Mon Sep 17 00:00:00 2001 From: Siddharth Rawat Date: Sun, 26 Nov 2023 20:25:26 -0500 Subject: [PATCH] feat: add k8s machine type for more compute power --- modules/k8s/main.tf | 2 +- modules/k8s/variables.tf | 1 + root/example.tfvars | 1 + root/main.tf | 1 + root/variables.tf | 8 +++++++- 5 files changed, 11 insertions(+), 2 deletions(-) diff --git a/modules/k8s/main.tf b/modules/k8s/main.tf index 6fbae5b..2b763f2 100644 --- a/modules/k8s/main.tf +++ b/modules/k8s/main.tf @@ -88,7 +88,7 @@ resource "google_container_node_pool" "gke_linux_node_pool" { node_config { preemptible = true - machine_type = "e2-small" + machine_type = var.k8s_machine_type image_type = "COS_CONTAINERD" labels = { diff --git a/modules/k8s/variables.tf b/modules/k8s/variables.tf index ffa1635..bd04ecd 100644 --- a/modules/k8s/variables.tf +++ b/modules/k8s/variables.tf @@ -1,6 +1,7 @@ variable "vpc_name" {} variable "subnet_name" {} variable "region" {} +variable "k8s_machine_type" {} variable "project_id" {} variable "account_id_kubernetes" {} variable "initial_node_count" {} diff --git a/root/example.tfvars b/root/example.tfvars index 30868dd..dec0662 100644 --- a/root/example.tfvars +++ b/root/example.tfvars @@ -11,6 +11,7 @@ vpc_name = "" subnet_name = "" vm_name = "" machine_type = "" +k8s_machine_type = "" zone = "" ssh_key_file = "" cluster_master_ip_cidr_range = "" diff --git a/root/main.tf b/root/main.tf index a52e80b..16c8021 100644 --- a/root/main.tf +++ b/root/main.tf @@ -90,6 +90,7 @@ module "k8s" { vpc_name = var.vpc_name subnet_name = var.subnet_name region = var.region + k8s_machine_type = var.k8s_machine_type account_id_kubernetes = var.account_id_kubernetes initial_node_count = var.initial_node_count max_node_count = var.max_node_count diff --git a/root/variables.tf b/root/variables.tf index 86bad9a..6788634 100644 --- a/root/variables.tf +++ b/root/variables.tf @@ -66,7 +66,13 @@ variable "vm_name" { variable "machine_type" { type = string - description = "The compute instance machine type. Default machine has 8 vCPU and 32GiB vRAM" + description = "The bastion host machine type." + default = "e2-micro" +} + +variable "k8s_machine_type" { + type = string + description = "The kubernetes cluster machine type. Default machine has 8 vCPU and 32GiB vRAM" default = "e2-standard-8" }