Commit 407bb010 authored by A-Gordon's avatar A-Gordon

Added tags to subnets for cloud-provider option in K8S

parent b5570009
Pipeline #1620 passed with stage
in 16 seconds
...@@ -31,6 +31,10 @@ variable "enable_dns_support" { ...@@ -31,6 +31,10 @@ variable "enable_dns_support" {
default = true default = true
} }
variable "kubernetes_cluster" {
description = "The name of the Kubernetes Cluster to tag the public and private subnets with, this is so that the cloud-provider function in Kubernetes can function."
}
resource "aws_vpc" "mod" { resource "aws_vpc" "mod" {
cidr_block = "${var.cidr}" cidr_block = "${var.cidr}"
enable_dns_hostnames = "${var.enable_dns_hostnames}" enable_dns_hostnames = "${var.enable_dns_hostnames}"
...@@ -51,7 +55,9 @@ resource "aws_subnet" "public" { ...@@ -51,7 +55,9 @@ resource "aws_subnet" "public" {
map_public_ip_on_launch = true map_public_ip_on_launch = true
tags { tags {
Name = "${var.name}.public.${element(var.availability_zones, count.index)}" Name = "${var.name}.public.${element(var.availability_zones, count.index)}"
KubernetesCluster = "${var.kubernetes_cluster}"
"kubernetes.io/role/elb" = "kubernetes.io/role/elb"
} }
} }
...@@ -64,7 +70,9 @@ resource "aws_subnet" "private" { ...@@ -64,7 +70,9 @@ resource "aws_subnet" "private" {
count = "${length(var.private_subnets)}" count = "${length(var.private_subnets)}"
tags { tags {
Name = "${var.name}.private.${element(var.availability_zones, count.index)}" Name = "${var.name}.private.${element(var.availability_zones, count.index)}"
KubernetesCluster = "${var.kubernetes_cluster}"
"kubernetes.io/role/internal-elb" = "kubernetes.io/role/internal-elb"
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment