From c112ee38297144143ee5992aff175a4a4014028b Mon Sep 17 00:00:00 2001 From: Dalton Hubble Date: Sat, 3 Mar 2018 17:52:01 -0800 Subject: [PATCH] Rename cluster_name to name in internal module * Ensure consistency between AWS and GCP platforms --- aws/container-linux/kubernetes/workers.tf | 2 +- aws/container-linux/kubernetes/workers/ingress.tf | 6 +++--- aws/container-linux/kubernetes/workers/variables.tf | 4 ++-- aws/container-linux/kubernetes/workers/workers.tf | 4 ++-- docs/advanced/worker-pools.md | 4 ++-- .../container-linux/kubernetes/workers/variables.tf | 2 +- 6 files changed, 11 insertions(+), 11 deletions(-) diff --git a/aws/container-linux/kubernetes/workers.tf b/aws/container-linux/kubernetes/workers.tf index a8ec605a..6515b994 100644 --- a/aws/container-linux/kubernetes/workers.tf +++ b/aws/container-linux/kubernetes/workers.tf @@ -1,6 +1,6 @@ module "workers" { source = "workers" - cluster_name = "${var.cluster_name}" + name = "${var.cluster_name}" # AWS vpc_id = "${aws_vpc.network.id}" diff --git a/aws/container-linux/kubernetes/workers/ingress.tf b/aws/container-linux/kubernetes/workers/ingress.tf index 5b01f985..59207ca8 100644 --- a/aws/container-linux/kubernetes/workers/ingress.tf +++ b/aws/container-linux/kubernetes/workers/ingress.tf @@ -1,6 +1,6 @@ # Network Load Balancer for Ingress resource "aws_lb" "ingress" { - name = "${var.cluster_name}-ingress" + name = "${var.name}-ingress" load_balancer_type = "network" internal = false @@ -34,7 +34,7 @@ resource "aws_lb_listener" "ingress-https" { # Network Load Balancer target groups of instances resource "aws_lb_target_group" "workers-http" { - name = "${var.cluster_name}-workers-http" + name = "${var.name}-workers-http" vpc_id = "${var.vpc_id}" target_type = "instance" @@ -57,7 +57,7 @@ resource "aws_lb_target_group" "workers-http" { } resource "aws_lb_target_group" "workers-https" { - name = "${var.cluster_name}-workers-https" + name = "${var.name}-workers-https" vpc_id = "${var.vpc_id}" target_type = "instance" diff --git a/aws/container-linux/kubernetes/workers/variables.tf b/aws/container-linux/kubernetes/workers/variables.tf index 64088b57..4f73a33d 100644 --- a/aws/container-linux/kubernetes/workers/variables.tf +++ b/aws/container-linux/kubernetes/workers/variables.tf @@ -1,6 +1,6 @@ -variable "cluster_name" { +variable "name" { type = "string" - description = "Unique name" + description = "Unique name instance group" } variable "vpc_id" { diff --git a/aws/container-linux/kubernetes/workers/workers.tf b/aws/container-linux/kubernetes/workers/workers.tf index 527a00c7..da251b02 100644 --- a/aws/container-linux/kubernetes/workers/workers.tf +++ b/aws/container-linux/kubernetes/workers/workers.tf @@ -1,6 +1,6 @@ # Workers AutoScaling Group resource "aws_autoscaling_group" "workers" { - name = "${var.cluster_name}-worker ${aws_launch_configuration.worker.name}" + name = "${var.name}-worker ${aws_launch_configuration.worker.name}" # count desired_capacity = "${var.count}" @@ -29,7 +29,7 @@ resource "aws_autoscaling_group" "workers" { tags = [{ key = "Name" - value = "${var.cluster_name}-worker" + value = "${var.name}-worker" propagate_at_launch = true }] } diff --git a/docs/advanced/worker-pools.md b/docs/advanced/worker-pools.md index c22ef10f..316b9788 100644 --- a/docs/advanced/worker-pools.md +++ b/docs/advanced/worker-pools.md @@ -25,7 +25,7 @@ module "tempest-worker-pool" { security_groups = "${module.aws-tempest.worker_security_groups}" # configuration - cluster_name = "tempest-worker-pool" + name = "tempest-worker-pool" kubeconfig = "${module.aws-tempest.kubeconfig}" ssh_authorized_key = "${var.ssh_authorized_key}" @@ -54,7 +54,7 @@ The AWS internal `workers` module supports a number of [variables](https://githu | vpc_id | Must be set to `vpc_id` output by cluster | "${module.cluster.vpc_id}" | | subnet_ids | Must be set to `subnet_ids` output by cluster | "${module.cluster.subnet_ids}" | | security_groups | Must be set to `worker_security_groups` output by cluster | "${module.cluster.worker_security_groups}" | -| cluster_name | Unique name | "tempest-worker-pool" | +| name | Unique name (distinct from cluster name) | "tempest-m5s" | | kubeconfig | Must be set to `kubeconfig` output by cluster | "${module.cluster.kubeconfig}" | | ssh_authorized_key | SSH public key for ~/.ssh_authorized_keys | "ssh-rsa AAAAB3NZ..." | diff --git a/google-cloud/container-linux/kubernetes/workers/variables.tf b/google-cloud/container-linux/kubernetes/workers/variables.tf index 0ff62b16..1e68b7a0 100644 --- a/google-cloud/container-linux/kubernetes/workers/variables.tf +++ b/google-cloud/container-linux/kubernetes/workers/variables.tf @@ -1,6 +1,6 @@ variable "name" { type = "string" - description = "Unique name" + description = "Unique name for instance group" } variable "cluster_name" {