diff --git a/contrib/terraform/aws/create-infrastructure.tf b/contrib/terraform/aws/create-infrastructure.tf index 350dba32cc265e7313962e4e479e7a575ce80245..9c0617d84852745f0d0d09e5d3f1893a035f3ee2 100644 --- a/contrib/terraform/aws/create-infrastructure.tf +++ b/contrib/terraform/aws/create-infrastructure.tf @@ -98,7 +98,7 @@ resource "aws_instance" "k8s-master" { tags = "${merge(var.default_tags, map( "Name", "kubernetes-${var.aws_cluster_name}-master${count.index}", - "Cluster", "${var.aws_cluster_name}", + "kubernetes.io/cluster/${var.aws_cluster_name}", "member", "Role", "master" ))}" } @@ -127,7 +127,7 @@ resource "aws_instance" "k8s-etcd" { tags = "${merge(var.default_tags, map( "Name", "kubernetes-${var.aws_cluster_name}-etcd${count.index}", - "Cluster", "${var.aws_cluster_name}", + "kubernetes.io/cluster/${var.aws_cluster_name}", "member", "Role", "etcd" ))}" @@ -151,7 +151,7 @@ resource "aws_instance" "k8s-worker" { tags = "${merge(var.default_tags, map( "Name", "kubernetes-${var.aws_cluster_name}-worker${count.index}", - "Cluster", "${var.aws_cluster_name}", + "kubernetes.io/cluster/${var.aws_cluster_name}", "member", "Role", "worker" ))}" @@ -175,7 +175,6 @@ data "template_file" "inventory" { list_node = "${join("\n",aws_instance.k8s-worker.*.tags.Name)}" list_etcd = "${join("\n",aws_instance.k8s-etcd.*.tags.Name)}" elb_api_fqdn = "apiserver_loadbalancer_domain_name=\"${module.aws-elb.aws_elb_api_fqdn}\"" - elb_api_server = "loadbalancer_apiserver={\"port\": ${var.aws_elb_api_port}, \"address\": \"${var.loadbalancer_apiserver_address}\"}" } } diff --git a/contrib/terraform/aws/modules/elb/main.tf b/contrib/terraform/aws/modules/elb/main.tf index 991e7be42b8498a2579b0dfdcb2c622280711d5c..a2a6f69a184f05ad614f3a2b69d387b6a2821f05 100644 --- a/contrib/terraform/aws/modules/elb/main.tf +++ b/contrib/terraform/aws/modules/elb/main.tf @@ -43,7 +43,7 @@ resource "aws_elb" "aws-elb-api" { healthy_threshold = 2 unhealthy_threshold = 2 timeout = 3 - target = "HTTP:8080/" + target = "TCP:${var.k8s_secure_api_port}" interval = 30 } diff --git a/contrib/terraform/aws/modules/vpc/main.tf b/contrib/terraform/aws/modules/vpc/main.tf index 4ab078f0ffe3d0d6ea5cfd6d878982e3bb74091a..b267a23a9281b6b8a6cd66f4962e82b4748426f3 100644 --- a/contrib/terraform/aws/modules/vpc/main.tf +++ b/contrib/terraform/aws/modules/vpc/main.tf @@ -34,7 +34,8 @@ resource "aws_subnet" "cluster-vpc-subnets-public" { cidr_block = "${element(var.aws_cidr_subnets_public, count.index)}" tags = "${merge(var.default_tags, map( - "Name", "kubernetes-${var.aws_cluster_name}-${element(var.aws_avail_zones, count.index)}-public" + "Name", "kubernetes-${var.aws_cluster_name}-${element(var.aws_avail_zones, count.index)}-public", + "kubernetes.io/cluster/${var.aws_cluster_name}", "member" ))}" } diff --git a/contrib/terraform/aws/templates/inventory.tpl b/contrib/terraform/aws/templates/inventory.tpl index 8354f6b7f8e16a2c5e2f72349680f1cb69d9a2ba..2bb772549a63269c47e224d0dddf61ac998aa758 100644 --- a/contrib/terraform/aws/templates/inventory.tpl +++ b/contrib/terraform/aws/templates/inventory.tpl @@ -25,4 +25,3 @@ kube-master [k8s-cluster:vars] ${elb_api_fqdn} -${elb_api_server} diff --git a/contrib/terraform/aws/variables.tf b/contrib/terraform/aws/variables.tf index f9d89abab6dae3d836b31744066093ebe6ec360f..58dd3138847bbf1768e810de29f28069e0d09926 100644 --- a/contrib/terraform/aws/variables.tf +++ b/contrib/terraform/aws/variables.tf @@ -99,10 +99,6 @@ variable "k8s_secure_api_port" { description = "Secure Port of K8S API Server" } -variable "loadbalancer_apiserver_address" { - description= "Bind Address for ELB of K8s API Server" -} - variable "default_tags" { description = "Default tags for all resources" type = "map"