From fdb543e834ba59d2acbb1776e6d6ab4b3351f786 Mon Sep 17 00:00:00 2001 From: Dalton Hubble Date: Sun, 25 Mar 2018 22:11:18 -0700 Subject: [PATCH] Add optional controller_type and worker_type vars on GCP * Remove optional machine_type variable on Google Cloud * Use controller_type and worker_type instead --- CHANGES.md | 3 +++ docs/aws.md | 4 ++-- docs/google-cloud.md | 3 ++- google-cloud/container-linux/kubernetes/cluster.tf | 4 ++-- .../container-linux/kubernetes/variables.tf | 14 ++++++++++---- 5 files changed, 19 insertions(+), 9 deletions(-) diff --git a/CHANGES.md b/CHANGES.md index c1b0d7d9..43b7113a 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -13,6 +13,9 @@ Notable changes between versions. #### Google Cloud * Add `disk_size` variable for setting instance disk size in GB +* Add `controller_type` variable for setting machine type for controllers +* Add `worker_type` variable for setting machine type for workers +* Remove optional variable `machine_type`. Use `controller_type` and `worker_type`. ## v1.9.6 diff --git a/docs/aws.md b/docs/aws.md index 58db3bc8..e6a30330 100644 --- a/docs/aws.md +++ b/docs/aws.md @@ -249,8 +249,8 @@ Reference the DNS zone id with `"${aws_route53_zone.zone-for-clusters.zone_id}"` |:-----|:------------|:--------|:--------| | controller_count | Number of controllers (i.e. masters) | 1 | 1 | | worker_count | Number of workers | 1 | 3 | -| controller_type | EC2 instance type for controllers | "t2.small" | "t2.medium" | -| worker_type | EC2 instance type for workers | "t2.small" | "t2.medium" | +| controller_type | EC2 instance type for controllers | "t2.small" | See below | +| worker_type | EC2 instance type for workers | "t2.small" | See below | | os_channel | Container Linux AMI channel | stable | stable, beta, alpha | | disk_size | Size of the EBS volume in GB | "40" | "100" | | controller_clc_snippets | Controller Container Linux Config snippets | [] | | diff --git a/docs/google-cloud.md b/docs/google-cloud.md index ea154511..b3822a40 100644 --- a/docs/google-cloud.md +++ b/docs/google-cloud.md @@ -254,7 +254,8 @@ resource "google_dns_managed_zone" "zone-for-clusters" { |:-----|:------------|:--------|:--------| | controller_count | Number of controllers (i.e. masters) | 1 | 1 | | worker_count | Number of workers | 1 | 3 | -| machine_type | Machine type for compute instances | "n1-standard-1" | See below | +| controller_type | Machine type for controllers | "n1-standard-1" | See below | +| worker_type | Machine type for workers | "n1-standard-1" | See below | | os_image | Container Linux image for compute instances | "coreos-stable" | "coreos-stable-1632-3-0-v20180215" | | disk_size | Size of the disk in GB | 40 | 100 | | worker_preemptible | If enabled, Compute Engine will terminate workers randomly within 24 hours | false | true | diff --git a/google-cloud/container-linux/kubernetes/cluster.tf b/google-cloud/container-linux/kubernetes/cluster.tf index 5515892d..f1031d1e 100644 --- a/google-cloud/container-linux/kubernetes/cluster.tf +++ b/google-cloud/container-linux/kubernetes/cluster.tf @@ -8,7 +8,7 @@ module "controllers" { dns_zone = "${var.dns_zone}" dns_zone_name = "${var.dns_zone_name}" count = "${var.controller_count}" - machine_type = "${var.machine_type}" + machine_type = "${var.controller_type}" os_image = "${var.os_image}" disk_size = "${var.disk_size}" @@ -30,7 +30,7 @@ module "workers" { region = "${var.region}" network = "${google_compute_network.network.name}" count = "${var.worker_count}" - machine_type = "${var.machine_type}" + machine_type = "${var.worker_type}" os_image = "${var.os_image}" disk_size = "${var.disk_size}" preemptible = "${var.worker_preemptible}" diff --git a/google-cloud/container-linux/kubernetes/variables.tf b/google-cloud/container-linux/kubernetes/variables.tf index 46812a2e..ab589c5a 100644 --- a/google-cloud/container-linux/kubernetes/variables.tf +++ b/google-cloud/container-linux/kubernetes/variables.tf @@ -34,10 +34,16 @@ variable "worker_count" { description = "Number of workers" } -variable "machine_type" { - type = "string" - default = "n1-standard-1" - description = "Machine type for compute instances (see `gcloud compute machine-types list`)" +variable controller_type { + type = "string" + default = "n1-standard-1" + description = "Machine type for controllers (see `gcloud compute machine-types list`)" +} + +variable worker_type { + type = "string" + default = "n1-standard-1" + description = "Machine type for controllers (see `gcloud compute machine-types list`)" } variable "os_image" {