From 28d4d6207dc0d263c498eed9f1c6cdae286e43e6 Mon Sep 17 00:00:00 2001 From: Johannes Liebermann Date: Mon, 27 Apr 2020 20:25:57 +0200 Subject: [PATCH] platform/aws: Use autogenerated target group names ELB target group names are limited to 32 characters. Since we easily hit this limit when trying to include the cluster and pool name in the target group name, we move this information to AWS tags and let Terraform generate a target group name automatically. --- .../aws/flatcar-linux/kubernetes/nlb.tf | 5 ++++- .../aws/flatcar-linux/kubernetes/workers/ingress.tf | 12 ++++++++++-- pkg/assets/generated_assets.go | 8 ++++---- 3 files changed, 18 insertions(+), 7 deletions(-) diff --git a/assets/lokomotive-kubernetes/aws/flatcar-linux/kubernetes/nlb.tf b/assets/lokomotive-kubernetes/aws/flatcar-linux/kubernetes/nlb.tf index b5907f5f8..03f1ede0e 100644 --- a/assets/lokomotive-kubernetes/aws/flatcar-linux/kubernetes/nlb.tf +++ b/assets/lokomotive-kubernetes/aws/flatcar-linux/kubernetes/nlb.tf @@ -38,7 +38,6 @@ resource "aws_lb_listener" "apiserver-https" { # Target group of controllers resource "aws_lb_target_group" "controllers" { - name = "${var.cluster_name}-controllers" vpc_id = aws_vpc.network.id target_type = "instance" @@ -57,6 +56,10 @@ resource "aws_lb_target_group" "controllers" { # Interval between health checks required to be 10 or 30 interval = 10 } + + tags = { + ClusterName = var.cluster_name + } } # Attach controller instances to apiserver NLB diff --git a/assets/lokomotive-kubernetes/aws/flatcar-linux/kubernetes/workers/ingress.tf b/assets/lokomotive-kubernetes/aws/flatcar-linux/kubernetes/workers/ingress.tf index b17310e96..16b425764 100644 --- a/assets/lokomotive-kubernetes/aws/flatcar-linux/kubernetes/workers/ingress.tf +++ b/assets/lokomotive-kubernetes/aws/flatcar-linux/kubernetes/workers/ingress.tf @@ -21,7 +21,6 @@ resource "aws_lb_listener" "ingress-https" { } resource "aws_lb_target_group" "workers-http" { - name = "${var.cluster_name}-${var.pool_name}-http" vpc_id = var.vpc_id target_type = "instance" @@ -41,10 +40,14 @@ resource "aws_lb_target_group" "workers-http" { # Interval between health checks required to be 10 or 30 interval = 10 } + + tags = { + ClusterName = var.cluster_name + PoolName = var.pool_name + } } resource "aws_lb_target_group" "workers-https" { - name = "${var.cluster_name}-${var.pool_name}-https" vpc_id = var.vpc_id target_type = "instance" @@ -64,4 +67,9 @@ resource "aws_lb_target_group" "workers-https" { # Interval between health checks required to be 10 or 30 interval = 10 } + + tags = { + ClusterName = var.cluster_name + PoolName = var.pool_name + } } diff --git a/pkg/assets/generated_assets.go b/pkg/assets/generated_assets.go index 3f746f497..bb2d00705 100644 --- a/pkg/assets/generated_assets.go +++ b/pkg/assets/generated_assets.go @@ -3135,9 +3135,9 @@ var vfsgenAssets = func() http.FileSystem { "/lokomotive-kubernetes/aws/flatcar-linux/kubernetes/nlb.tf": &vfsgen۰CompressedFileInfo{ name: "nlb.tf", modTime: time.Date(1970, 1, 1, 0, 0, 1, 0, time.UTC), - uncompressedSize: 1777, + uncompressedSize: 1778, - compressedContent: []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\xa4\x54\x5d\x6b\x2b\x37\x10\x7d\xd7\xaf\x18\x94\x06\xda\x92\x2c\x09\x4e\xfb\xe6\x87\x24\xa5\x50\x08\x26\x34\x81\x3e\x94\x8b\xd0\x6a\xc7\x5e\x11\x59\xda\x3b\xd2\xda\x37\x37\xf8\xbf\x5f\xf4\xb1\xf6\x6e\xec\xe4\xe5\xe6\x21\x60\xcd\x9c\x99\x33\x67\xce\xec\x19\x2c\x30\x6c\x1d\xbd\xc0\x83\x93\x0d\xdc\x49\x23\xad\x42\x82\xbf\x16\x4f\xf0\x2f\x2a\x47\x0d\x23\xf4\xae\x27\x85\xc0\xe5\xd6\x0b\x72\x7d\xc0\x3f\x66\x82\x52\x90\x03\x97\x9d\xf6\x48\x1b\x24\x0e\x6f\x0c\xe0\xbb\xb3\x28\x74\x03\x73\xd8\x48\xaa\x1a\xeb\x45\x79\x61\x0c\xc0\xca\x35\xc2\x1c\x96\x8e\xd6\x32\xfc\xca\xcf\x7d\x75\xee\x2b\x7e\x91\x52\x95\xe9\x7d\x40\x12\x31\xe7\x62\x02\xfe\x8d\x01\x84\xd7\x2e\x22\xf9\x2d\x8f\x75\xce\xe0\xf6\xbf\x27\x88\x14\xd6\x6b\xb4\x8d\x87\xd0\xa2\x26\xf0\x1d\x2a\x2d\x0d\x70\x69\xb4\xf4\x1c\x32\x47\x1f\xfb\xc1\xe2\xe1\xce\x33\x80\x14\x49\x44\x0b\x9b\xe3\xbf\x39\xc4\x39\x4d\x5d\x59\x53\x27\x0e\x31\x2f\x01\x86\xd9\x3e\x03\x0c\xd3\xc6\x00\x6e\xa4\xe9\x65\x40\x11\x24\xad\x30\x88\x16\xa5\x09\x2d\xcc\x21\x50\x1f\x2b\xee\xd8\x8e\xb1\x8f\x36\x10\x49\xef\xb5\xf5\x20\x6d\x03\xda\xae\x08\xbd\x7f\xb7\x11\x53\x73\xe0\x36\xfe\x7f\x63\x27\x87\x9a\x03\xff\xe5\xed\xbd\xc4\xbb\xcb\x08\x61\x00\xc6\xc9\x46\xd4\xa5\xab\x18\x74\xb6\x99\x53\x4c\xd0\x36\x20\x59\x69\x26\x15\x97\xd2\x78\x8c\xab\xf0\x7d\x6d\x31\xf8\x22\x42\xfe\x55\x75\x7d\x6d\xb4\xaa\x7e\xaf\xf2\xda\xd1\xca\xda\xa0\x50\xe4\x7c\xb1\xc3\xa8\xa9\xb6\xab\x41\x91\xa4\xc6\xdf\x8e\xb6\x92\x1a\x78\xbe\x7f\x3c\xcc\x0f\x81\xe4\x72\xa9\x15\x04\x07\xca\xd9\x40\xce\x18\xa4\x63\x25\x84\xd1\x3e\xa0\x8d\x66\x3c\x18\xf3\xb2\x0d\xa1\xf3\x59\x9e\xe9\xb4\x92\xec\x74\x7b\x92\x2c\x03\xe8\xc8\x05\xa7\x9c\x99\x48\xf8\x7c\xff\x18\xd5\xe8\x1c\x85\x23\x79\xff\xbc\xb9\x99\x25\x63\x36\xb8\x94\xbd\x09\x42\xaa\xa0\x9d\x2d\x3e\x4b\x9a\xbe\x43\x2c\xf3\x94\x3c\x27\x64\x7b\xac\xc8\xf5\xdd\x84\x93\x18\x47\xaa\xd1\xe0\x85\x68\x31\xd0\x73\xca\x82\x94\x05\x6e\xf9\xb9\x42\xe3\x92\x1c\xf8\x28\xf7\xd8\x40\x1f\x38\x67\x8c\x61\x00\x9b\x4e\xed\xaf\x22\x33\xdf\x74\xaa\x2a\x0e\xaa\xd2\x2d\x94\xa6\x83\xbb\xb4\xf5\x21\x6e\x20\x69\xb6\x57\xfb\x84\xc8\x73\x88\xd2\xe6\x93\x8f\x86\x28\x17\xa4\x5a\x54\x2f\xd3\x0b\x61\x50\x82\x22\x07\xb3\xf4\x27\x6a\x9f\xac\x1e\xeb\xc7\x2f\x04\x10\x7e\xed\x35\x61\x13\x8d\xd6\x7b\x04\x1f\xd5\xc8\x85\x5f\xd3\x0d\xf6\x76\xf8\x15\x5a\x42\xdf\x3a\xd3\xf8\x54\xa0\x3c\x8b\xfd\x73\x6a\x30\x4b\xb1\x3d\x68\x14\x8d\xb1\xd2\xf9\x9f\x78\x61\x1b\x69\xa0\xc6\xb0\x45\xb4\x93\x31\xa7\x9c\x6a\x84\xeb\x2b\x70\x04\xb3\xab\x04\xd6\x03\x74\x0e\xd7\x57\x07\x47\xdc\x86\x20\x55\x3b\x32\x02\x0c\x92\xfb\x58\xe5\x70\x57\x8b\x87\xbb\xcf\x2d\x22\x64\x2a\xb5\x46\x1b\x4e\xb9\x45\xb9\xde\x86\xf2\xb1\x3f\x04\x45\x7a\x66\xec\x27\xac\x5d\xc2\x87\xaf\x6d\x06\x0e\x63\x8c\x11\xff\xa7\x6e\x95\xb6\x0d\x7e\xfb\x92\xfd\x76\x74\xa5\x65\xd5\x3b\xf6\x23\x00\x00\xff\xff\xa9\x65\x3f\xcc\xf1\x06\x00\x00"), + compressedContent: []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\xa4\x54\x4d\x6b\x2b\x37\x14\xdd\xeb\x57\x5c\x94\x06\xda\x92\x0c\x09\x4e\xbb\xf3\x22\x49\x29\x14\x82\x09\x4d\xa0\x8b\x52\x84\x46\x73\xed\x11\x91\xa5\xe9\x95\xc6\x7e\x79\xc1\xff\xfd\xa1\x8f\xb1\x67\x6c\xbf\x6c\x5e\x16\x01\xeb\x7e\x9d\x7b\xee\x39\x73\x01\x0b\x0c\x5b\x47\x6f\xf0\xe4\x64\x03\x0f\xd2\x48\xab\x90\xe0\x8f\xc5\x0b\xfc\x8d\xca\x51\xc3\x08\xbd\xeb\x49\x21\x70\xb9\xf5\x82\x5c\x1f\xf0\xb7\x99\xa0\x14\xe4\xc0\x65\xa7\x3d\xd2\x06\x89\xc3\x07\x03\xf8\xea\x2c\x0a\xdd\xc0\x1c\x36\x92\xaa\xc6\x7a\x51\x5e\x18\x03\xb0\x72\x8d\x30\x87\xa5\xa3\xb5\x0c\x3f\xf3\x4b\x5f\x5d\xfa\x8a\x5f\xa5\x54\x65\x7a\x1f\x90\x44\xcc\xb9\x9a\x14\xff\xc2\x00\xc2\x7b\x17\x2b\xf9\x3d\x8f\x7d\x2e\xe0\xfe\x9f\x17\x88\x10\xd6\x6b\xb4\x8d\x87\xd0\xa2\x26\xf0\x1d\x2a\x2d\x0d\x70\x69\xb4\xf4\x1c\x32\x46\x1f\xe7\xc1\xe2\xe9\xc1\x33\x80\x14\x49\x40\x0b\x9a\xd3\xbf\x39\xc4\x3d\x4d\x5d\x59\x53\x27\x0c\x31\x2f\x15\x0c\xbb\x7d\x56\x30\x6c\x1b\x03\xb8\x91\xa6\x97\x01\x45\x90\xb4\xc2\x20\x5a\x94\x26\xb4\x30\x87\x40\x7d\xec\xb8\x63\x3b\xc6\xbe\x77\x81\x08\x7a\xcf\xad\x07\x69\x1b\xd0\x76\x45\xe8\xfd\xd1\x45\x4c\xcd\x81\xdb\xf8\xff\x83\x9d\x5d\x6a\x0e\xfc\xa7\x8f\x63\x8a\x77\xd7\xb1\x84\x01\x18\x27\x1b\x51\x97\xa9\x62\xe0\xd9\x66\x4c\x31\x41\xdb\x80\x64\xa5\x99\x74\x5c\x4a\xe3\x31\x9e\xc2\xf7\xb5\xc5\xe0\x0b\x09\xf9\x57\xd5\xf5\xb5\xd1\xaa\xfa\xb5\xca\x67\x47\x2b\x6b\x83\x42\x91\xf3\x45\x0e\xa3\xa1\xda\xae\x06\x46\x12\x1b\x7f\x3a\xda\x4a\x6a\xe0\xf5\xf1\xf9\xb0\x3f\x04\x92\xcb\xa5\x56\x10\x1c\x28\x67\x03\x39\x63\x90\x4e\x99\x10\x46\xfb\x80\x36\x8a\xf1\x20\xcc\xeb\x36\x84\xce\x67\x7a\xa6\xdb\x4a\xb2\xd3\xeb\x49\xb2\x0c\xa0\x23\x17\x9c\x72\x66\x42\xe1\xeb\xe3\x73\x64\xa3\x73\x14\x4e\xe8\xfd\xfd\xee\x6e\x96\x84\xd9\xe0\x52\xf6\x26\x08\xa9\x82\x76\xb6\xe8\x2c\x71\x7a\x54\xb1\xcc\x5b\xf2\x9c\x90\xe5\xb1\x22\xd7\x77\x13\x4c\x62\x1c\xa9\x46\x8b\x17\xa0\x45\x40\xaf\x29\x0b\x52\x16\xb8\xe5\xe7\x0c\x8d\x5b\x72\xe0\xa3\xdc\xcc\xd0\xa6\x53\x7b\x8d\x67\x1c\x9b\x4e\x55\x45\x0f\x55\x52\x76\x69\x31\x68\x45\x5b\x1f\x22\x9f\x89\x81\x3d\x77\x67\x28\x9b\x43\x24\x2a\x1b\x38\x9e\xb7\xf8\x41\xb5\xa8\xde\xa6\x7a\x67\x50\x82\x22\x07\x33\x91\x67\x7a\x9f\xed\x1e\xfb\x47\xbf\x03\xe1\xff\xbd\x26\x6c\xa2\x6c\x7a\x8f\xe0\xa3\x39\x72\xe3\xf7\xe4\xa8\xde\x0e\xbf\x42\x4b\xe8\x5b\x67\x1a\x9f\x1a\x94\x67\xb1\x7f\x4e\x03\x66\x29\xb6\x2f\x1a\x45\x63\xac\x4c\xfe\x2b\xfa\x65\x23\x0d\xd4\x18\xb6\x88\x76\xb2\xe6\x14\x53\x8d\x70\x7b\x03\x8e\x60\x76\x93\x8a\xf5\x50\x3a\x87\xdb\x9b\x74\xdf\xc4\xf6\x2a\xda\x2b\x53\xf0\x98\x2d\xbc\xc8\x1f\xd2\x63\x53\x1f\x24\x71\x1f\x82\x54\xed\x48\x09\x30\x5c\xc9\xc7\xc1\x07\x63\x2d\x9e\x1e\x3e\xd7\x88\x90\xa9\xd5\x1a\x6d\x38\x27\x17\xe5\x7a\x1b\x06\x28\xfb\xa0\x48\xcf\x8c\xfd\x80\xb6\x4b\xf8\xf0\xb9\xcd\x85\xc3\x1a\xe3\x8a\x7f\xd3\xb4\x4a\xdb\x06\xbf\xfc\x97\x25\x7a\x62\xd3\xa2\x8e\x1d\xfb\x16\x00\x00\xff\xff\x0a\x5a\xed\x3e\xf2\x06\x00\x00"), }, "/lokomotive-kubernetes/aws/flatcar-linux/kubernetes/outputs.tf": &vfsgen۰CompressedFileInfo{ name: "outputs.tf", @@ -3199,9 +3199,9 @@ var vfsgenAssets = func() http.FileSystem { "/lokomotive-kubernetes/aws/flatcar-linux/kubernetes/workers/ingress.tf": &vfsgen۰CompressedFileInfo{ name: "ingress.tf", modTime: time.Date(1970, 1, 1, 0, 0, 1, 0, time.UTC), - uncompressedSize: 1589, + uncompressedSize: 1628, - compressedContent: []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\xec\x92\x4f\x8f\xd3\x30\x10\xc5\xef\xfe\x14\x4f\x86\xeb\x96\x2e\x2d\x12\x97\x5e\xe0\x02\x12\x42\x7b\xe8\xdd\x72\x92\x69\x13\xad\xb1\xc3\x78\xd2\x68\x59\xf5\xbb\x23\xc7\x69\xe4\x22\x84\x10\xb0\x9c\xd6\x37\xcf\xf3\x9b\x3f\x3f\x0f\x53\x0c\x03\xd7\x04\x6d\xc7\x68\x5c\x65\x5c\x17\x85\x3c\xb1\x86\xee\xfc\x91\x29\xc6\x9b\x56\xa4\xd7\x78\x54\x80\x0b\xb6\x31\x95\x75\xd6\xd7\xc4\xc6\xb2\xc7\x0e\x27\xcb\x2b\x57\xa5\x8b\x02\x7a\x0e\x12\xea\xe0\xb0\x9c\x1d\xf4\xfe\xfd\x9d\x4e\x5a\x60\xc1\xd5\x59\xcc\xa9\x82\x49\xba\x52\x40\x43\x07\x3b\x38\x31\xb6\x96\x2e\xf8\xa9\x2e\x20\x0f\x3d\xfd\xe0\xd5\x87\xc0\xa3\xe5\x46\xe7\x07\x96\x8f\x24\xe6\xc8\x61\xe8\xe7\xce\xe6\x89\x4a\x65\x35\x06\xbe\x27\xce\x33\xad\x72\xcf\x67\x75\x56\xea\x77\x39\xc4\xa7\x07\x11\xff\x3f\x89\xf8\x4b\x14\xa5\x4d\x43\x97\xc6\x4c\xc3\xdb\x2f\x54\x74\xf3\xf2\x31\x4d\x53\xbb\x21\x0a\xb1\x49\xe2\xf9\x26\xc7\xfa\x10\xdc\x1c\x98\xdc\x0a\x38\xf5\xb5\xe9\x9a\x12\x43\x8e\xa8\x65\x90\x69\xe0\x5d\xfa\x86\x28\x89\xb7\x56\x25\xdf\x9f\x60\xdd\xe1\xed\x3a\xbd\x79\x81\x0f\xfb\xfd\x1d\x5a\xb2\x4e\x5a\xd4\x2d\xd5\xf7\x38\x04\xc6\xfc\x9f\x0a\xb3\x64\xb2\x94\xf1\x96\x89\x93\x3d\x33\x2d\x72\xdf\xae\x5f\xbf\xd9\xe6\xa0\x95\xf6\x32\xf3\xab\x9c\xea\xdb\xd4\x5c\x2a\xfd\xf9\xd3\xbb\x08\xa6\xaf\x43\xc7\xd4\x40\x02\x86\x48\x88\x09\x54\x7e\xf9\x00\xeb\x1b\x0c\xfe\x72\x93\x96\x29\xb6\xc1\x35\x71\x4a\x30\x87\xcd\x12\x9e\xca\x6c\x26\x6d\x31\x15\x6a\xd2\xe6\xca\x1f\xbd\x10\x9f\xac\x43\x45\x32\x12\xf9\x2b\x00\xd7\x3d\x55\x84\xdb\x35\x02\x63\xb3\x9e\xcc\xdd\xc5\x9a\xc6\xfc\x93\x7d\x88\x7f\xb7\x10\xf1\xc9\x36\x62\xbb\xdd\x3c\xaf\xc4\xbf\x5a\x89\xef\x01\x00\x00\xff\xff\x82\x69\x8d\x34\x35\x06\x00\x00"), + compressedContent: []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\xec\x92\x4f\x8f\xd3\x30\x10\xc5\xef\xfe\x14\x4f\xe6\x4c\xe9\xd2\x22\x71\xc9\x85\xbd\x80\x84\x56\x3d\xf4\x6e\x39\xc9\xb4\x89\xd6\xeb\x09\x63\xa7\xd5\x82\xf6\xbb\x23\xdb\x69\x94\x22\x84\xe0\x50\xc4\x81\xdc\x32\xcf\x6f\xfe\xfc\x66\x84\x02\x8f\xd2\x10\xb4\x3d\x07\xe3\x6a\xe3\xfa\x10\xc9\x93\x68\xe8\xde\x1f\x85\x42\x78\xdd\xc5\x38\x68\x7c\x53\x80\x63\xdb\x9a\xda\x3a\xeb\x1b\x12\x63\xc5\xa3\xc2\xc9\xca\xca\xd5\xe9\x47\x01\x83\x70\xe4\x86\x1d\xe6\xaf\x82\xde\xdf\xef\x74\xd2\x58\x22\xae\xbe\xd9\x9c\x2a\x98\xa4\x2b\x05\xb4\x74\xb0\xa3\x8b\xc6\x36\xb1\x67\x9f\xeb\x02\xf1\x79\xa0\x1f\xbc\xfa\xc0\x72\xb6\xd2\xea\xf2\xc0\xca\x91\xa2\x39\x0a\x8f\xc3\xd4\xd9\x34\xd1\x52\x59\x9d\x59\x1e\x49\xca\x4c\xab\xd2\xf3\x8b\x7a\x51\xea\x77\x39\x84\xdb\x83\x08\x7f\x9f\x44\xf8\x25\x8a\xa5\x4d\x43\x2f\x8d\x85\xc6\x69\x68\x4c\xdf\x2e\x47\x29\x11\x35\x37\x93\x9b\xae\x12\xca\x10\x13\x33\xad\x96\x8c\x7e\x82\xa6\xc2\xfb\x75\x7a\xf3\x0a\x1f\xf7\xfb\x1d\x3a\xb2\x2e\x76\x68\x3a\x6a\x1e\x71\x60\xc1\xb4\x13\x85\x49\x32\x45\x2a\x88\x96\x89\x93\xbd\x70\x59\xe4\xbe\x5b\xbf\x7d\xb7\x2d\x41\x1b\xbb\x0b\xc5\x37\x25\xd5\xd7\xdc\x5c\x2a\xfd\xf0\xf9\x43\x80\xd0\x97\xb1\x17\x6a\x11\x19\x63\x20\x04\xfb\x44\x53\xd1\x67\x58\xdf\x62\xf4\x97\xbf\xd8\x09\x85\x8e\x5d\x1b\x72\x82\x29\x6c\xe6\x70\x2e\xb3\xc9\xda\x6c\x5a\xa8\x49\x9b\x2a\x7f\xf2\x91\xe4\x64\x1d\x6a\x8a\x67\x22\x7f\x05\xe0\xba\xa7\x9a\x70\xb7\x06\x0b\x36\xeb\x6c\xee\x2f\xd6\x34\x66\xde\x69\x5e\xc3\x31\xa0\x9a\xf0\xdc\xbb\x31\x44\x92\x87\x34\x48\x59\x57\x53\x22\xc6\xdb\x27\xca\x4f\x76\xcc\x6e\xa1\x0f\xcc\xee\x22\xfe\xf1\x8d\x84\x1b\x1e\xc9\x76\xbb\xf9\x7f\x25\xff\xea\x95\x7c\x0f\x00\x00\xff\xff\x30\x35\x14\xe0\x5c\x06\x00\x00"), }, "/lokomotive-kubernetes/aws/flatcar-linux/kubernetes/workers/outputs.tf": &vfsgen۰CompressedFileInfo{ name: "outputs.tf",