From e8c4c523e8fc98423116510c072a14f57593b04c Mon Sep 17 00:00:00 2001 From: John Gardiner Myers Date: Tue, 14 Jul 2020 19:28:37 -0700 Subject: [PATCH] update-expected.sh --- .../bastionadditional_user-data/kubernetes.tf | 102 +++++++++---- .../complex/cloudformation.json | 52 +++++++ .../update_cluster/complex/kubernetes.tf | 84 +++++++---- .../cloudformation.json | 52 +++++++ .../update_cluster/existing_iam/kubernetes.tf | 136 ++++++++++++------ .../cloudformation.json | 52 +++++++ .../update_cluster/existing_sg/kubernetes.tf | 136 ++++++++++++------ .../externallb/cloudformation.json | 52 +++++++ .../update_cluster/externallb/kubernetes.tf | 68 ++++++--- .../externalpolicies/kubernetes.tf | 84 +++++++---- .../update_cluster/ha/kubernetes.tf | 136 ++++++++++++------ .../launch_templates/cloudformation.json | 40 ++++++ .../launch_templates/kubernetes.tf | 40 ++++++ .../cloudformation.json | 52 +++++++ .../minimal-json/kubernetes.tf.json | 28 ++++ .../update_cluster/minimal-tf11/kubernetes.tf | 72 +++++++--- .../update_cluster/minimal/kubernetes.tf | 68 ++++++--- .../mixed_instances/cloudformation.json | 104 ++++++++++++++ .../mixed_instances/kubernetes.tf | 136 ++++++++++++------ .../mixed_instances_spot/cloudformation.json | 104 ++++++++++++++ .../mixed_instances_spot/kubernetes.tf | 136 ++++++++++++------ .../private-shared-subnet/kubernetes.tf | 102 +++++++++---- .../privatecalico/cloudformation.json | 78 ++++++++++ .../privatecalico/kubernetes.tf | 102 +++++++++---- .../update_cluster/privatecanal/kubernetes.tf | 102 +++++++++---- .../privatecilium/cloudformation.json | 78 ++++++++++ .../privatecilium/kubernetes.tf | 102 +++++++++---- .../privatecilium2/cloudformation.json | 78 ++++++++++ .../privatecilium2/kubernetes.tf | 102 +++++++++---- .../privateciliumadvanced/cloudformation.json | 78 ++++++++++ .../privateciliumadvanced/kubernetes.tf | 102 +++++++++---- .../update_cluster/privatedns1/kubernetes.tf | 126 ++++++++++------ .../update_cluster/privatedns2/kubernetes.tf | 102 +++++++++---- .../privateflannel/kubernetes.tf | 102 +++++++++---- .../privatekopeio/kubernetes.tf | 102 +++++++++---- .../update_cluster/privateweave/kubernetes.tf | 102 +++++++++---- .../shared_subnet/kubernetes.tf | 68 ++++++--- .../update_cluster/shared_vpc/kubernetes.tf | 68 ++++++--- .../update_cluster/unmanaged/kubernetes.tf | 102 +++++++++---- 39 files changed, 2672 insertions(+), 758 deletions(-) diff --git a/tests/integration/update_cluster/bastionadditional_user-data/kubernetes.tf b/tests/integration/update_cluster/bastionadditional_user-data/kubernetes.tf index 0f6efb7aa0b33..8430aba26e288 100644 --- a/tests/integration/update_cluster/bastionadditional_user-data/kubernetes.tf +++ b/tests/integration/update_cluster/bastionadditional_user-data/kubernetes.tf @@ -140,6 +140,16 @@ resource "aws_autoscaling_group" "bastion-bastionuserdata-example-com" { propagate_at_launch = true value = "bastion.bastionuserdata.example.com" } + tag { + key = "k8s.io/cluster-autoscaler/node-template/label/kubernetes.io/role" + propagate_at_launch = true + value = "node" + } + tag { + key = "k8s.io/cluster-autoscaler/node-template/label/node-role.kubernetes.io/node" + propagate_at_launch = true + value = "" + } tag { key = "k8s.io/role/bastion" propagate_at_launch = true @@ -178,6 +188,16 @@ resource "aws_autoscaling_group" "master-us-test-1a-masters-bastionuserdata-exam propagate_at_launch = true value = "master-us-test-1a.masters.bastionuserdata.example.com" } + tag { + key = "k8s.io/cluster-autoscaler/node-template/label/kubernetes.io/role" + propagate_at_launch = true + value = "master" + } + tag { + key = "k8s.io/cluster-autoscaler/node-template/label/node-role.kubernetes.io/master" + propagate_at_launch = true + value = "" + } tag { key = "k8s.io/role/master" propagate_at_launch = true @@ -216,6 +236,16 @@ resource "aws_autoscaling_group" "nodes-bastionuserdata-example-com" { propagate_at_launch = true value = "nodes.bastionuserdata.example.com" } + tag { + key = "k8s.io/cluster-autoscaler/node-template/label/kubernetes.io/role" + propagate_at_launch = true + value = "node" + } + tag { + key = "k8s.io/cluster-autoscaler/node-template/label/node-role.kubernetes.io/node" + propagate_at_launch = true + value = "" + } tag { key = "k8s.io/role/node" propagate_at_launch = true @@ -418,21 +448,25 @@ resource "aws_launch_template" "bastion-bastionuserdata-example-com" { tag_specifications { resource_type = "instance" tags = { - "KubernetesCluster" = "bastionuserdata.example.com" - "Name" = "bastion.bastionuserdata.example.com" - "k8s.io/role/bastion" = "1" - "kops.k8s.io/instancegroup" = "bastion" - "kubernetes.io/cluster/bastionuserdata.example.com" = "owned" + "KubernetesCluster" = "bastionuserdata.example.com" + "Name" = "bastion.bastionuserdata.example.com" + "k8s.io/cluster-autoscaler/node-template/label/kubernetes.io/role" = "node" + "k8s.io/cluster-autoscaler/node-template/label/node-role.kubernetes.io/node" = "" + "k8s.io/role/bastion" = "1" + "kops.k8s.io/instancegroup" = "bastion" + "kubernetes.io/cluster/bastionuserdata.example.com" = "owned" } } tag_specifications { resource_type = "volume" tags = { - "KubernetesCluster" = "bastionuserdata.example.com" - "Name" = "bastion.bastionuserdata.example.com" - "k8s.io/role/bastion" = "1" - "kops.k8s.io/instancegroup" = "bastion" - "kubernetes.io/cluster/bastionuserdata.example.com" = "owned" + "KubernetesCluster" = "bastionuserdata.example.com" + "Name" = "bastion.bastionuserdata.example.com" + "k8s.io/cluster-autoscaler/node-template/label/kubernetes.io/role" = "node" + "k8s.io/cluster-autoscaler/node-template/label/node-role.kubernetes.io/node" = "" + "k8s.io/role/bastion" = "1" + "kops.k8s.io/instancegroup" = "bastion" + "kubernetes.io/cluster/bastionuserdata.example.com" = "owned" } } user_data = filebase64("${path.module}/data/aws_launch_template_bastion.bastionuserdata.example.com_user_data") @@ -469,21 +503,25 @@ resource "aws_launch_template" "master-us-test-1a-masters-bastionuserdata-exampl tag_specifications { resource_type = "instance" tags = { - "KubernetesCluster" = "bastionuserdata.example.com" - "Name" = "master-us-test-1a.masters.bastionuserdata.example.com" - "k8s.io/role/master" = "1" - "kops.k8s.io/instancegroup" = "master-us-test-1a" - "kubernetes.io/cluster/bastionuserdata.example.com" = "owned" + "KubernetesCluster" = "bastionuserdata.example.com" + "Name" = "master-us-test-1a.masters.bastionuserdata.example.com" + "k8s.io/cluster-autoscaler/node-template/label/kubernetes.io/role" = "master" + "k8s.io/cluster-autoscaler/node-template/label/node-role.kubernetes.io/master" = "" + "k8s.io/role/master" = "1" + "kops.k8s.io/instancegroup" = "master-us-test-1a" + "kubernetes.io/cluster/bastionuserdata.example.com" = "owned" } } tag_specifications { resource_type = "volume" tags = { - "KubernetesCluster" = "bastionuserdata.example.com" - "Name" = "master-us-test-1a.masters.bastionuserdata.example.com" - "k8s.io/role/master" = "1" - "kops.k8s.io/instancegroup" = "master-us-test-1a" - "kubernetes.io/cluster/bastionuserdata.example.com" = "owned" + "KubernetesCluster" = "bastionuserdata.example.com" + "Name" = "master-us-test-1a.masters.bastionuserdata.example.com" + "k8s.io/cluster-autoscaler/node-template/label/kubernetes.io/role" = "master" + "k8s.io/cluster-autoscaler/node-template/label/node-role.kubernetes.io/master" = "" + "k8s.io/role/master" = "1" + "kops.k8s.io/instancegroup" = "master-us-test-1a" + "kubernetes.io/cluster/bastionuserdata.example.com" = "owned" } } user_data = filebase64("${path.module}/data/aws_launch_template_master-us-test-1a.masters.bastionuserdata.example.com_user_data") @@ -516,21 +554,25 @@ resource "aws_launch_template" "nodes-bastionuserdata-example-com" { tag_specifications { resource_type = "instance" tags = { - "KubernetesCluster" = "bastionuserdata.example.com" - "Name" = "nodes.bastionuserdata.example.com" - "k8s.io/role/node" = "1" - "kops.k8s.io/instancegroup" = "nodes" - "kubernetes.io/cluster/bastionuserdata.example.com" = "owned" + "KubernetesCluster" = "bastionuserdata.example.com" + "Name" = "nodes.bastionuserdata.example.com" + "k8s.io/cluster-autoscaler/node-template/label/kubernetes.io/role" = "node" + "k8s.io/cluster-autoscaler/node-template/label/node-role.kubernetes.io/node" = "" + "k8s.io/role/node" = "1" + "kops.k8s.io/instancegroup" = "nodes" + "kubernetes.io/cluster/bastionuserdata.example.com" = "owned" } } tag_specifications { resource_type = "volume" tags = { - "KubernetesCluster" = "bastionuserdata.example.com" - "Name" = "nodes.bastionuserdata.example.com" - "k8s.io/role/node" = "1" - "kops.k8s.io/instancegroup" = "nodes" - "kubernetes.io/cluster/bastionuserdata.example.com" = "owned" + "KubernetesCluster" = "bastionuserdata.example.com" + "Name" = "nodes.bastionuserdata.example.com" + "k8s.io/cluster-autoscaler/node-template/label/kubernetes.io/role" = "node" + "k8s.io/cluster-autoscaler/node-template/label/node-role.kubernetes.io/node" = "" + "k8s.io/role/node" = "1" + "kops.k8s.io/instancegroup" = "nodes" + "kubernetes.io/cluster/bastionuserdata.example.com" = "owned" } } user_data = filebase64("${path.module}/data/aws_launch_template_nodes.bastionuserdata.example.com_user_data") diff --git a/tests/integration/update_cluster/complex/cloudformation.json b/tests/integration/update_cluster/complex/cloudformation.json index fddbb1063473b..068e45fb78bc9 100644 --- a/tests/integration/update_cluster/complex/cloudformation.json +++ b/tests/integration/update_cluster/complex/cloudformation.json @@ -43,6 +43,16 @@ "Value": "fib+baz", "PropagateAtLaunch": true }, + { + "Key": "k8s.io/cluster-autoscaler/node-template/label/kubernetes.io/role", + "Value": "master", + "PropagateAtLaunch": true + }, + { + "Key": "k8s.io/cluster-autoscaler/node-template/label/node-role.kubernetes.io/master", + "Value": "", + "PropagateAtLaunch": true + }, { "Key": "k8s.io/role/master", "Value": "1", @@ -124,6 +134,16 @@ "Value": "fib+baz", "PropagateAtLaunch": true }, + { + "Key": "k8s.io/cluster-autoscaler/node-template/label/kubernetes.io/role", + "Value": "node", + "PropagateAtLaunch": true + }, + { + "Key": "k8s.io/cluster-autoscaler/node-template/label/node-role.kubernetes.io/node", + "Value": "", + "PropagateAtLaunch": true + }, { "Key": "k8s.io/role/node", "Value": "1", @@ -273,6 +293,14 @@ "Key": "foo/bar", "Value": "fib+baz" }, + { + "Key": "k8s.io/cluster-autoscaler/node-template/label/kubernetes.io/role", + "Value": "master" + }, + { + "Key": "k8s.io/cluster-autoscaler/node-template/label/node-role.kubernetes.io/master", + "Value": "" + }, { "Key": "k8s.io/role/master", "Value": "1" @@ -306,6 +334,14 @@ "Key": "foo/bar", "Value": "fib+baz" }, + { + "Key": "k8s.io/cluster-autoscaler/node-template/label/kubernetes.io/role", + "Value": "master" + }, + { + "Key": "k8s.io/cluster-autoscaler/node-template/label/node-role.kubernetes.io/master", + "Value": "" + }, { "Key": "k8s.io/role/master", "Value": "1" @@ -389,6 +425,14 @@ "Key": "foo/bar", "Value": "fib+baz" }, + { + "Key": "k8s.io/cluster-autoscaler/node-template/label/kubernetes.io/role", + "Value": "node" + }, + { + "Key": "k8s.io/cluster-autoscaler/node-template/label/node-role.kubernetes.io/node", + "Value": "" + }, { "Key": "k8s.io/role/node", "Value": "1" @@ -422,6 +466,14 @@ "Key": "foo/bar", "Value": "fib+baz" }, + { + "Key": "k8s.io/cluster-autoscaler/node-template/label/kubernetes.io/role", + "Value": "node" + }, + { + "Key": "k8s.io/cluster-autoscaler/node-template/label/node-role.kubernetes.io/node", + "Value": "" + }, { "Key": "k8s.io/role/node", "Value": "1" diff --git a/tests/integration/update_cluster/complex/kubernetes.tf b/tests/integration/update_cluster/complex/kubernetes.tf index da01a8d420ba3..e425e69293a69 100644 --- a/tests/integration/update_cluster/complex/kubernetes.tf +++ b/tests/integration/update_cluster/complex/kubernetes.tf @@ -115,6 +115,16 @@ resource "aws_autoscaling_group" "master-us-test-1a-masters-complex-example-com" propagate_at_launch = true value = "fib+baz" } + tag { + key = "k8s.io/cluster-autoscaler/node-template/label/kubernetes.io/role" + propagate_at_launch = true + value = "master" + } + tag { + key = "k8s.io/cluster-autoscaler/node-template/label/node-role.kubernetes.io/master" + propagate_at_launch = true + value = "" + } tag { key = "k8s.io/role/master" propagate_at_launch = true @@ -164,6 +174,16 @@ resource "aws_autoscaling_group" "nodes-complex-example-com" { propagate_at_launch = true value = "fib+baz" } + tag { + key = "k8s.io/cluster-autoscaler/node-template/label/kubernetes.io/role" + propagate_at_launch = true + value = "node" + } + tag { + key = "k8s.io/cluster-autoscaler/node-template/label/node-role.kubernetes.io/node" + propagate_at_launch = true + value = "" + } tag { key = "k8s.io/role/node" propagate_at_launch = true @@ -316,25 +336,29 @@ resource "aws_launch_template" "master-us-test-1a-masters-complex-example-com" { tag_specifications { resource_type = "instance" tags = { - "KubernetesCluster" = "complex.example.com" - "Name" = "master-us-test-1a.masters.complex.example.com" - "Owner" = "John Doe" - "foo/bar" = "fib+baz" - "k8s.io/role/master" = "1" - "kops.k8s.io/instancegroup" = "master-us-test-1a" - "kubernetes.io/cluster/complex.example.com" = "owned" + "KubernetesCluster" = "complex.example.com" + "Name" = "master-us-test-1a.masters.complex.example.com" + "Owner" = "John Doe" + "foo/bar" = "fib+baz" + "k8s.io/cluster-autoscaler/node-template/label/kubernetes.io/role" = "master" + "k8s.io/cluster-autoscaler/node-template/label/node-role.kubernetes.io/master" = "" + "k8s.io/role/master" = "1" + "kops.k8s.io/instancegroup" = "master-us-test-1a" + "kubernetes.io/cluster/complex.example.com" = "owned" } } tag_specifications { resource_type = "volume" tags = { - "KubernetesCluster" = "complex.example.com" - "Name" = "master-us-test-1a.masters.complex.example.com" - "Owner" = "John Doe" - "foo/bar" = "fib+baz" - "k8s.io/role/master" = "1" - "kops.k8s.io/instancegroup" = "master-us-test-1a" - "kubernetes.io/cluster/complex.example.com" = "owned" + "KubernetesCluster" = "complex.example.com" + "Name" = "master-us-test-1a.masters.complex.example.com" + "Owner" = "John Doe" + "foo/bar" = "fib+baz" + "k8s.io/cluster-autoscaler/node-template/label/kubernetes.io/role" = "master" + "k8s.io/cluster-autoscaler/node-template/label/node-role.kubernetes.io/master" = "" + "k8s.io/role/master" = "1" + "kops.k8s.io/instancegroup" = "master-us-test-1a" + "kubernetes.io/cluster/complex.example.com" = "owned" } } user_data = filebase64("${path.module}/data/aws_launch_template_master-us-test-1a.masters.complex.example.com_user_data") @@ -374,25 +398,29 @@ resource "aws_launch_template" "nodes-complex-example-com" { tag_specifications { resource_type = "instance" tags = { - "KubernetesCluster" = "complex.example.com" - "Name" = "nodes.complex.example.com" - "Owner" = "John Doe" - "foo/bar" = "fib+baz" - "k8s.io/role/node" = "1" - "kops.k8s.io/instancegroup" = "nodes" - "kubernetes.io/cluster/complex.example.com" = "owned" + "KubernetesCluster" = "complex.example.com" + "Name" = "nodes.complex.example.com" + "Owner" = "John Doe" + "foo/bar" = "fib+baz" + "k8s.io/cluster-autoscaler/node-template/label/kubernetes.io/role" = "node" + "k8s.io/cluster-autoscaler/node-template/label/node-role.kubernetes.io/node" = "" + "k8s.io/role/node" = "1" + "kops.k8s.io/instancegroup" = "nodes" + "kubernetes.io/cluster/complex.example.com" = "owned" } } tag_specifications { resource_type = "volume" tags = { - "KubernetesCluster" = "complex.example.com" - "Name" = "nodes.complex.example.com" - "Owner" = "John Doe" - "foo/bar" = "fib+baz" - "k8s.io/role/node" = "1" - "kops.k8s.io/instancegroup" = "nodes" - "kubernetes.io/cluster/complex.example.com" = "owned" + "KubernetesCluster" = "complex.example.com" + "Name" = "nodes.complex.example.com" + "Owner" = "John Doe" + "foo/bar" = "fib+baz" + "k8s.io/cluster-autoscaler/node-template/label/kubernetes.io/role" = "node" + "k8s.io/cluster-autoscaler/node-template/label/node-role.kubernetes.io/node" = "" + "k8s.io/role/node" = "1" + "kops.k8s.io/instancegroup" = "nodes" + "kubernetes.io/cluster/complex.example.com" = "owned" } } user_data = filebase64("${path.module}/data/aws_launch_template_nodes.complex.example.com_user_data") diff --git a/tests/integration/update_cluster/containerd-cloudformation/cloudformation.json b/tests/integration/update_cluster/containerd-cloudformation/cloudformation.json index e53d37a51b3ac..7b75f11b827cd 100644 --- a/tests/integration/update_cluster/containerd-cloudformation/cloudformation.json +++ b/tests/integration/update_cluster/containerd-cloudformation/cloudformation.json @@ -33,6 +33,16 @@ "Value": "master-us-test-1a.masters.containerd.example.com", "PropagateAtLaunch": true }, + { + "Key": "k8s.io/cluster-autoscaler/node-template/label/kubernetes.io/role", + "Value": "master", + "PropagateAtLaunch": true + }, + { + "Key": "k8s.io/cluster-autoscaler/node-template/label/node-role.kubernetes.io/master", + "Value": "", + "PropagateAtLaunch": true + }, { "Key": "k8s.io/role/master", "Value": "1", @@ -99,6 +109,16 @@ "Value": "nodes.containerd.example.com", "PropagateAtLaunch": true }, + { + "Key": "k8s.io/cluster-autoscaler/node-template/label/kubernetes.io/role", + "Value": "node", + "PropagateAtLaunch": true + }, + { + "Key": "k8s.io/cluster-autoscaler/node-template/label/node-role.kubernetes.io/node", + "Value": "", + "PropagateAtLaunch": true + }, { "Key": "k8s.io/role/node", "Value": "1", @@ -225,6 +245,14 @@ "Key": "Name", "Value": "master-us-test-1a.masters.containerd.example.com" }, + { + "Key": "k8s.io/cluster-autoscaler/node-template/label/kubernetes.io/role", + "Value": "master" + }, + { + "Key": "k8s.io/cluster-autoscaler/node-template/label/node-role.kubernetes.io/master", + "Value": "" + }, { "Key": "k8s.io/role/master", "Value": "1" @@ -250,6 +278,14 @@ "Key": "Name", "Value": "master-us-test-1a.masters.containerd.example.com" }, + { + "Key": "k8s.io/cluster-autoscaler/node-template/label/kubernetes.io/role", + "Value": "master" + }, + { + "Key": "k8s.io/cluster-autoscaler/node-template/label/node-role.kubernetes.io/master", + "Value": "" + }, { "Key": "k8s.io/role/master", "Value": "1" @@ -316,6 +352,14 @@ "Key": "Name", "Value": "nodes.containerd.example.com" }, + { + "Key": "k8s.io/cluster-autoscaler/node-template/label/kubernetes.io/role", + "Value": "node" + }, + { + "Key": "k8s.io/cluster-autoscaler/node-template/label/node-role.kubernetes.io/node", + "Value": "" + }, { "Key": "k8s.io/role/node", "Value": "1" @@ -341,6 +385,14 @@ "Key": "Name", "Value": "nodes.containerd.example.com" }, + { + "Key": "k8s.io/cluster-autoscaler/node-template/label/kubernetes.io/role", + "Value": "node" + }, + { + "Key": "k8s.io/cluster-autoscaler/node-template/label/node-role.kubernetes.io/node", + "Value": "" + }, { "Key": "k8s.io/role/node", "Value": "1" diff --git a/tests/integration/update_cluster/existing_iam/kubernetes.tf b/tests/integration/update_cluster/existing_iam/kubernetes.tf index a3ee186980543..cb83fc5836f1b 100644 --- a/tests/integration/update_cluster/existing_iam/kubernetes.tf +++ b/tests/integration/update_cluster/existing_iam/kubernetes.tf @@ -90,6 +90,16 @@ resource "aws_autoscaling_group" "master-us-test-1a-masters-existing-iam-example propagate_at_launch = true value = "master-us-test-1a.masters.existing-iam.example.com" } + tag { + key = "k8s.io/cluster-autoscaler/node-template/label/kubernetes.io/role" + propagate_at_launch = true + value = "master" + } + tag { + key = "k8s.io/cluster-autoscaler/node-template/label/node-role.kubernetes.io/master" + propagate_at_launch = true + value = "" + } tag { key = "k8s.io/role/master" propagate_at_launch = true @@ -128,6 +138,16 @@ resource "aws_autoscaling_group" "master-us-test-1b-masters-existing-iam-example propagate_at_launch = true value = "master-us-test-1b.masters.existing-iam.example.com" } + tag { + key = "k8s.io/cluster-autoscaler/node-template/label/kubernetes.io/role" + propagate_at_launch = true + value = "master" + } + tag { + key = "k8s.io/cluster-autoscaler/node-template/label/node-role.kubernetes.io/master" + propagate_at_launch = true + value = "" + } tag { key = "k8s.io/role/master" propagate_at_launch = true @@ -166,6 +186,16 @@ resource "aws_autoscaling_group" "master-us-test-1c-masters-existing-iam-example propagate_at_launch = true value = "master-us-test-1c.masters.existing-iam.example.com" } + tag { + key = "k8s.io/cluster-autoscaler/node-template/label/kubernetes.io/role" + propagate_at_launch = true + value = "master" + } + tag { + key = "k8s.io/cluster-autoscaler/node-template/label/node-role.kubernetes.io/master" + propagate_at_launch = true + value = "" + } tag { key = "k8s.io/role/master" propagate_at_launch = true @@ -204,6 +234,16 @@ resource "aws_autoscaling_group" "nodes-existing-iam-example-com" { propagate_at_launch = true value = "nodes.existing-iam.example.com" } + tag { + key = "k8s.io/cluster-autoscaler/node-template/label/kubernetes.io/role" + propagate_at_launch = true + value = "node" + } + tag { + key = "k8s.io/cluster-autoscaler/node-template/label/node-role.kubernetes.io/node" + propagate_at_launch = true + value = "" + } tag { key = "k8s.io/role/node" propagate_at_launch = true @@ -356,21 +396,25 @@ resource "aws_launch_template" "master-us-test-1a-masters-existing-iam-example-c tag_specifications { resource_type = "instance" tags = { - "KubernetesCluster" = "existing-iam.example.com" - "Name" = "master-us-test-1a.masters.existing-iam.example.com" - "k8s.io/role/master" = "1" - "kops.k8s.io/instancegroup" = "master-us-test-1a" - "kubernetes.io/cluster/existing-iam.example.com" = "owned" + "KubernetesCluster" = "existing-iam.example.com" + "Name" = "master-us-test-1a.masters.existing-iam.example.com" + "k8s.io/cluster-autoscaler/node-template/label/kubernetes.io/role" = "master" + "k8s.io/cluster-autoscaler/node-template/label/node-role.kubernetes.io/master" = "" + "k8s.io/role/master" = "1" + "kops.k8s.io/instancegroup" = "master-us-test-1a" + "kubernetes.io/cluster/existing-iam.example.com" = "owned" } } tag_specifications { resource_type = "volume" tags = { - "KubernetesCluster" = "existing-iam.example.com" - "Name" = "master-us-test-1a.masters.existing-iam.example.com" - "k8s.io/role/master" = "1" - "kops.k8s.io/instancegroup" = "master-us-test-1a" - "kubernetes.io/cluster/existing-iam.example.com" = "owned" + "KubernetesCluster" = "existing-iam.example.com" + "Name" = "master-us-test-1a.masters.existing-iam.example.com" + "k8s.io/cluster-autoscaler/node-template/label/kubernetes.io/role" = "master" + "k8s.io/cluster-autoscaler/node-template/label/node-role.kubernetes.io/master" = "" + "k8s.io/role/master" = "1" + "kops.k8s.io/instancegroup" = "master-us-test-1a" + "kubernetes.io/cluster/existing-iam.example.com" = "owned" } } user_data = filebase64("${path.module}/data/aws_launch_template_master-us-test-1a.masters.existing-iam.example.com_user_data") @@ -407,21 +451,25 @@ resource "aws_launch_template" "master-us-test-1b-masters-existing-iam-example-c tag_specifications { resource_type = "instance" tags = { - "KubernetesCluster" = "existing-iam.example.com" - "Name" = "master-us-test-1b.masters.existing-iam.example.com" - "k8s.io/role/master" = "1" - "kops.k8s.io/instancegroup" = "master-us-test-1b" - "kubernetes.io/cluster/existing-iam.example.com" = "owned" + "KubernetesCluster" = "existing-iam.example.com" + "Name" = "master-us-test-1b.masters.existing-iam.example.com" + "k8s.io/cluster-autoscaler/node-template/label/kubernetes.io/role" = "master" + "k8s.io/cluster-autoscaler/node-template/label/node-role.kubernetes.io/master" = "" + "k8s.io/role/master" = "1" + "kops.k8s.io/instancegroup" = "master-us-test-1b" + "kubernetes.io/cluster/existing-iam.example.com" = "owned" } } tag_specifications { resource_type = "volume" tags = { - "KubernetesCluster" = "existing-iam.example.com" - "Name" = "master-us-test-1b.masters.existing-iam.example.com" - "k8s.io/role/master" = "1" - "kops.k8s.io/instancegroup" = "master-us-test-1b" - "kubernetes.io/cluster/existing-iam.example.com" = "owned" + "KubernetesCluster" = "existing-iam.example.com" + "Name" = "master-us-test-1b.masters.existing-iam.example.com" + "k8s.io/cluster-autoscaler/node-template/label/kubernetes.io/role" = "master" + "k8s.io/cluster-autoscaler/node-template/label/node-role.kubernetes.io/master" = "" + "k8s.io/role/master" = "1" + "kops.k8s.io/instancegroup" = "master-us-test-1b" + "kubernetes.io/cluster/existing-iam.example.com" = "owned" } } user_data = filebase64("${path.module}/data/aws_launch_template_master-us-test-1b.masters.existing-iam.example.com_user_data") @@ -458,21 +506,25 @@ resource "aws_launch_template" "master-us-test-1c-masters-existing-iam-example-c tag_specifications { resource_type = "instance" tags = { - "KubernetesCluster" = "existing-iam.example.com" - "Name" = "master-us-test-1c.masters.existing-iam.example.com" - "k8s.io/role/master" = "1" - "kops.k8s.io/instancegroup" = "master-us-test-1c" - "kubernetes.io/cluster/existing-iam.example.com" = "owned" + "KubernetesCluster" = "existing-iam.example.com" + "Name" = "master-us-test-1c.masters.existing-iam.example.com" + "k8s.io/cluster-autoscaler/node-template/label/kubernetes.io/role" = "master" + "k8s.io/cluster-autoscaler/node-template/label/node-role.kubernetes.io/master" = "" + "k8s.io/role/master" = "1" + "kops.k8s.io/instancegroup" = "master-us-test-1c" + "kubernetes.io/cluster/existing-iam.example.com" = "owned" } } tag_specifications { resource_type = "volume" tags = { - "KubernetesCluster" = "existing-iam.example.com" - "Name" = "master-us-test-1c.masters.existing-iam.example.com" - "k8s.io/role/master" = "1" - "kops.k8s.io/instancegroup" = "master-us-test-1c" - "kubernetes.io/cluster/existing-iam.example.com" = "owned" + "KubernetesCluster" = "existing-iam.example.com" + "Name" = "master-us-test-1c.masters.existing-iam.example.com" + "k8s.io/cluster-autoscaler/node-template/label/kubernetes.io/role" = "master" + "k8s.io/cluster-autoscaler/node-template/label/node-role.kubernetes.io/master" = "" + "k8s.io/role/master" = "1" + "kops.k8s.io/instancegroup" = "master-us-test-1c" + "kubernetes.io/cluster/existing-iam.example.com" = "owned" } } user_data = filebase64("${path.module}/data/aws_launch_template_master-us-test-1c.masters.existing-iam.example.com_user_data") @@ -505,21 +557,25 @@ resource "aws_launch_template" "nodes-existing-iam-example-com" { tag_specifications { resource_type = "instance" tags = { - "KubernetesCluster" = "existing-iam.example.com" - "Name" = "nodes.existing-iam.example.com" - "k8s.io/role/node" = "1" - "kops.k8s.io/instancegroup" = "nodes" - "kubernetes.io/cluster/existing-iam.example.com" = "owned" + "KubernetesCluster" = "existing-iam.example.com" + "Name" = "nodes.existing-iam.example.com" + "k8s.io/cluster-autoscaler/node-template/label/kubernetes.io/role" = "node" + "k8s.io/cluster-autoscaler/node-template/label/node-role.kubernetes.io/node" = "" + "k8s.io/role/node" = "1" + "kops.k8s.io/instancegroup" = "nodes" + "kubernetes.io/cluster/existing-iam.example.com" = "owned" } } tag_specifications { resource_type = "volume" tags = { - "KubernetesCluster" = "existing-iam.example.com" - "Name" = "nodes.existing-iam.example.com" - "k8s.io/role/node" = "1" - "kops.k8s.io/instancegroup" = "nodes" - "kubernetes.io/cluster/existing-iam.example.com" = "owned" + "KubernetesCluster" = "existing-iam.example.com" + "Name" = "nodes.existing-iam.example.com" + "k8s.io/cluster-autoscaler/node-template/label/kubernetes.io/role" = "node" + "k8s.io/cluster-autoscaler/node-template/label/node-role.kubernetes.io/node" = "" + "k8s.io/role/node" = "1" + "kops.k8s.io/instancegroup" = "nodes" + "kubernetes.io/cluster/existing-iam.example.com" = "owned" } } user_data = filebase64("${path.module}/data/aws_launch_template_nodes.existing-iam.example.com_user_data") diff --git a/tests/integration/update_cluster/existing_iam_cloudformation/cloudformation.json b/tests/integration/update_cluster/existing_iam_cloudformation/cloudformation.json index ab9f3887c87ff..9c7b1ae98480a 100644 --- a/tests/integration/update_cluster/existing_iam_cloudformation/cloudformation.json +++ b/tests/integration/update_cluster/existing_iam_cloudformation/cloudformation.json @@ -33,6 +33,16 @@ "Value": "master-us-test-1a.masters.minimal.example.com", "PropagateAtLaunch": true }, + { + "Key": "k8s.io/cluster-autoscaler/node-template/label/kubernetes.io/role", + "Value": "master", + "PropagateAtLaunch": true + }, + { + "Key": "k8s.io/cluster-autoscaler/node-template/label/node-role.kubernetes.io/master", + "Value": "", + "PropagateAtLaunch": true + }, { "Key": "k8s.io/role/master", "Value": "1", @@ -99,6 +109,16 @@ "Value": "nodes.minimal.example.com", "PropagateAtLaunch": true }, + { + "Key": "k8s.io/cluster-autoscaler/node-template/label/kubernetes.io/role", + "Value": "node", + "PropagateAtLaunch": true + }, + { + "Key": "k8s.io/cluster-autoscaler/node-template/label/node-role.kubernetes.io/node", + "Value": "", + "PropagateAtLaunch": true + }, { "Key": "k8s.io/role/node", "Value": "1", @@ -223,6 +243,14 @@ "Key": "Name", "Value": "master-us-test-1a.masters.minimal.example.com" }, + { + "Key": "k8s.io/cluster-autoscaler/node-template/label/kubernetes.io/role", + "Value": "master" + }, + { + "Key": "k8s.io/cluster-autoscaler/node-template/label/node-role.kubernetes.io/master", + "Value": "" + }, { "Key": "k8s.io/role/master", "Value": "1" @@ -248,6 +276,14 @@ "Key": "Name", "Value": "master-us-test-1a.masters.minimal.example.com" }, + { + "Key": "k8s.io/cluster-autoscaler/node-template/label/kubernetes.io/role", + "Value": "master" + }, + { + "Key": "k8s.io/cluster-autoscaler/node-template/label/node-role.kubernetes.io/master", + "Value": "" + }, { "Key": "k8s.io/role/master", "Value": "1" @@ -312,6 +348,14 @@ "Key": "Name", "Value": "nodes.minimal.example.com" }, + { + "Key": "k8s.io/cluster-autoscaler/node-template/label/kubernetes.io/role", + "Value": "node" + }, + { + "Key": "k8s.io/cluster-autoscaler/node-template/label/node-role.kubernetes.io/node", + "Value": "" + }, { "Key": "k8s.io/role/node", "Value": "1" @@ -337,6 +381,14 @@ "Key": "Name", "Value": "nodes.minimal.example.com" }, + { + "Key": "k8s.io/cluster-autoscaler/node-template/label/kubernetes.io/role", + "Value": "node" + }, + { + "Key": "k8s.io/cluster-autoscaler/node-template/label/node-role.kubernetes.io/node", + "Value": "" + }, { "Key": "k8s.io/role/node", "Value": "1" diff --git a/tests/integration/update_cluster/existing_sg/kubernetes.tf b/tests/integration/update_cluster/existing_sg/kubernetes.tf index bc84d75be85d5..b1dc7956bcc41 100644 --- a/tests/integration/update_cluster/existing_sg/kubernetes.tf +++ b/tests/integration/update_cluster/existing_sg/kubernetes.tf @@ -125,6 +125,16 @@ resource "aws_autoscaling_group" "master-us-test-1a-masters-existingsg-example-c propagate_at_launch = true value = "master-us-test-1a.masters.existingsg.example.com" } + tag { + key = "k8s.io/cluster-autoscaler/node-template/label/kubernetes.io/role" + propagate_at_launch = true + value = "master" + } + tag { + key = "k8s.io/cluster-autoscaler/node-template/label/node-role.kubernetes.io/master" + propagate_at_launch = true + value = "" + } tag { key = "k8s.io/role/master" propagate_at_launch = true @@ -163,6 +173,16 @@ resource "aws_autoscaling_group" "master-us-test-1b-masters-existingsg-example-c propagate_at_launch = true value = "master-us-test-1b.masters.existingsg.example.com" } + tag { + key = "k8s.io/cluster-autoscaler/node-template/label/kubernetes.io/role" + propagate_at_launch = true + value = "master" + } + tag { + key = "k8s.io/cluster-autoscaler/node-template/label/node-role.kubernetes.io/master" + propagate_at_launch = true + value = "" + } tag { key = "k8s.io/role/master" propagate_at_launch = true @@ -201,6 +221,16 @@ resource "aws_autoscaling_group" "master-us-test-1c-masters-existingsg-example-c propagate_at_launch = true value = "master-us-test-1c.masters.existingsg.example.com" } + tag { + key = "k8s.io/cluster-autoscaler/node-template/label/kubernetes.io/role" + propagate_at_launch = true + value = "master" + } + tag { + key = "k8s.io/cluster-autoscaler/node-template/label/node-role.kubernetes.io/master" + propagate_at_launch = true + value = "" + } tag { key = "k8s.io/role/master" propagate_at_launch = true @@ -239,6 +269,16 @@ resource "aws_autoscaling_group" "nodes-existingsg-example-com" { propagate_at_launch = true value = "nodes.existingsg.example.com" } + tag { + key = "k8s.io/cluster-autoscaler/node-template/label/kubernetes.io/role" + propagate_at_launch = true + value = "node" + } + tag { + key = "k8s.io/cluster-autoscaler/node-template/label/node-role.kubernetes.io/node" + propagate_at_launch = true + value = "" + } tag { key = "k8s.io/role/node" propagate_at_launch = true @@ -450,21 +490,25 @@ resource "aws_launch_template" "master-us-test-1a-masters-existingsg-example-com tag_specifications { resource_type = "instance" tags = { - "KubernetesCluster" = "existingsg.example.com" - "Name" = "master-us-test-1a.masters.existingsg.example.com" - "k8s.io/role/master" = "1" - "kops.k8s.io/instancegroup" = "master-us-test-1a" - "kubernetes.io/cluster/existingsg.example.com" = "owned" + "KubernetesCluster" = "existingsg.example.com" + "Name" = "master-us-test-1a.masters.existingsg.example.com" + "k8s.io/cluster-autoscaler/node-template/label/kubernetes.io/role" = "master" + "k8s.io/cluster-autoscaler/node-template/label/node-role.kubernetes.io/master" = "" + "k8s.io/role/master" = "1" + "kops.k8s.io/instancegroup" = "master-us-test-1a" + "kubernetes.io/cluster/existingsg.example.com" = "owned" } } tag_specifications { resource_type = "volume" tags = { - "KubernetesCluster" = "existingsg.example.com" - "Name" = "master-us-test-1a.masters.existingsg.example.com" - "k8s.io/role/master" = "1" - "kops.k8s.io/instancegroup" = "master-us-test-1a" - "kubernetes.io/cluster/existingsg.example.com" = "owned" + "KubernetesCluster" = "existingsg.example.com" + "Name" = "master-us-test-1a.masters.existingsg.example.com" + "k8s.io/cluster-autoscaler/node-template/label/kubernetes.io/role" = "master" + "k8s.io/cluster-autoscaler/node-template/label/node-role.kubernetes.io/master" = "" + "k8s.io/role/master" = "1" + "kops.k8s.io/instancegroup" = "master-us-test-1a" + "kubernetes.io/cluster/existingsg.example.com" = "owned" } } user_data = filebase64("${path.module}/data/aws_launch_template_master-us-test-1a.masters.existingsg.example.com_user_data") @@ -501,21 +545,25 @@ resource "aws_launch_template" "master-us-test-1b-masters-existingsg-example-com tag_specifications { resource_type = "instance" tags = { - "KubernetesCluster" = "existingsg.example.com" - "Name" = "master-us-test-1b.masters.existingsg.example.com" - "k8s.io/role/master" = "1" - "kops.k8s.io/instancegroup" = "master-us-test-1b" - "kubernetes.io/cluster/existingsg.example.com" = "owned" + "KubernetesCluster" = "existingsg.example.com" + "Name" = "master-us-test-1b.masters.existingsg.example.com" + "k8s.io/cluster-autoscaler/node-template/label/kubernetes.io/role" = "master" + "k8s.io/cluster-autoscaler/node-template/label/node-role.kubernetes.io/master" = "" + "k8s.io/role/master" = "1" + "kops.k8s.io/instancegroup" = "master-us-test-1b" + "kubernetes.io/cluster/existingsg.example.com" = "owned" } } tag_specifications { resource_type = "volume" tags = { - "KubernetesCluster" = "existingsg.example.com" - "Name" = "master-us-test-1b.masters.existingsg.example.com" - "k8s.io/role/master" = "1" - "kops.k8s.io/instancegroup" = "master-us-test-1b" - "kubernetes.io/cluster/existingsg.example.com" = "owned" + "KubernetesCluster" = "existingsg.example.com" + "Name" = "master-us-test-1b.masters.existingsg.example.com" + "k8s.io/cluster-autoscaler/node-template/label/kubernetes.io/role" = "master" + "k8s.io/cluster-autoscaler/node-template/label/node-role.kubernetes.io/master" = "" + "k8s.io/role/master" = "1" + "kops.k8s.io/instancegroup" = "master-us-test-1b" + "kubernetes.io/cluster/existingsg.example.com" = "owned" } } user_data = filebase64("${path.module}/data/aws_launch_template_master-us-test-1b.masters.existingsg.example.com_user_data") @@ -552,21 +600,25 @@ resource "aws_launch_template" "master-us-test-1c-masters-existingsg-example-com tag_specifications { resource_type = "instance" tags = { - "KubernetesCluster" = "existingsg.example.com" - "Name" = "master-us-test-1c.masters.existingsg.example.com" - "k8s.io/role/master" = "1" - "kops.k8s.io/instancegroup" = "master-us-test-1c" - "kubernetes.io/cluster/existingsg.example.com" = "owned" + "KubernetesCluster" = "existingsg.example.com" + "Name" = "master-us-test-1c.masters.existingsg.example.com" + "k8s.io/cluster-autoscaler/node-template/label/kubernetes.io/role" = "master" + "k8s.io/cluster-autoscaler/node-template/label/node-role.kubernetes.io/master" = "" + "k8s.io/role/master" = "1" + "kops.k8s.io/instancegroup" = "master-us-test-1c" + "kubernetes.io/cluster/existingsg.example.com" = "owned" } } tag_specifications { resource_type = "volume" tags = { - "KubernetesCluster" = "existingsg.example.com" - "Name" = "master-us-test-1c.masters.existingsg.example.com" - "k8s.io/role/master" = "1" - "kops.k8s.io/instancegroup" = "master-us-test-1c" - "kubernetes.io/cluster/existingsg.example.com" = "owned" + "KubernetesCluster" = "existingsg.example.com" + "Name" = "master-us-test-1c.masters.existingsg.example.com" + "k8s.io/cluster-autoscaler/node-template/label/kubernetes.io/role" = "master" + "k8s.io/cluster-autoscaler/node-template/label/node-role.kubernetes.io/master" = "" + "k8s.io/role/master" = "1" + "kops.k8s.io/instancegroup" = "master-us-test-1c" + "kubernetes.io/cluster/existingsg.example.com" = "owned" } } user_data = filebase64("${path.module}/data/aws_launch_template_master-us-test-1c.masters.existingsg.example.com_user_data") @@ -599,21 +651,25 @@ resource "aws_launch_template" "nodes-existingsg-example-com" { tag_specifications { resource_type = "instance" tags = { - "KubernetesCluster" = "existingsg.example.com" - "Name" = "nodes.existingsg.example.com" - "k8s.io/role/node" = "1" - "kops.k8s.io/instancegroup" = "nodes" - "kubernetes.io/cluster/existingsg.example.com" = "owned" + "KubernetesCluster" = "existingsg.example.com" + "Name" = "nodes.existingsg.example.com" + "k8s.io/cluster-autoscaler/node-template/label/kubernetes.io/role" = "node" + "k8s.io/cluster-autoscaler/node-template/label/node-role.kubernetes.io/node" = "" + "k8s.io/role/node" = "1" + "kops.k8s.io/instancegroup" = "nodes" + "kubernetes.io/cluster/existingsg.example.com" = "owned" } } tag_specifications { resource_type = "volume" tags = { - "KubernetesCluster" = "existingsg.example.com" - "Name" = "nodes.existingsg.example.com" - "k8s.io/role/node" = "1" - "kops.k8s.io/instancegroup" = "nodes" - "kubernetes.io/cluster/existingsg.example.com" = "owned" + "KubernetesCluster" = "existingsg.example.com" + "Name" = "nodes.existingsg.example.com" + "k8s.io/cluster-autoscaler/node-template/label/kubernetes.io/role" = "node" + "k8s.io/cluster-autoscaler/node-template/label/node-role.kubernetes.io/node" = "" + "k8s.io/role/node" = "1" + "kops.k8s.io/instancegroup" = "nodes" + "kubernetes.io/cluster/existingsg.example.com" = "owned" } } user_data = filebase64("${path.module}/data/aws_launch_template_nodes.existingsg.example.com_user_data") diff --git a/tests/integration/update_cluster/externallb/cloudformation.json b/tests/integration/update_cluster/externallb/cloudformation.json index 862cad65780f4..0dd8e4dce7abd 100644 --- a/tests/integration/update_cluster/externallb/cloudformation.json +++ b/tests/integration/update_cluster/externallb/cloudformation.json @@ -33,6 +33,16 @@ "Value": "master-us-test-1a.masters.externallb.example.com", "PropagateAtLaunch": true }, + { + "Key": "k8s.io/cluster-autoscaler/node-template/label/kubernetes.io/role", + "Value": "master", + "PropagateAtLaunch": true + }, + { + "Key": "k8s.io/cluster-autoscaler/node-template/label/node-role.kubernetes.io/master", + "Value": "", + "PropagateAtLaunch": true + }, { "Key": "k8s.io/role/master", "Value": "1", @@ -105,6 +115,16 @@ "Value": "nodes.externallb.example.com", "PropagateAtLaunch": true }, + { + "Key": "k8s.io/cluster-autoscaler/node-template/label/kubernetes.io/role", + "Value": "node", + "PropagateAtLaunch": true + }, + { + "Key": "k8s.io/cluster-autoscaler/node-template/label/node-role.kubernetes.io/node", + "Value": "", + "PropagateAtLaunch": true + }, { "Key": "k8s.io/role/node", "Value": "1", @@ -234,6 +254,14 @@ "Key": "Name", "Value": "master-us-test-1a.masters.externallb.example.com" }, + { + "Key": "k8s.io/cluster-autoscaler/node-template/label/kubernetes.io/role", + "Value": "master" + }, + { + "Key": "k8s.io/cluster-autoscaler/node-template/label/node-role.kubernetes.io/master", + "Value": "" + }, { "Key": "k8s.io/role/master", "Value": "1" @@ -259,6 +287,14 @@ "Key": "Name", "Value": "master-us-test-1a.masters.externallb.example.com" }, + { + "Key": "k8s.io/cluster-autoscaler/node-template/label/kubernetes.io/role", + "Value": "master" + }, + { + "Key": "k8s.io/cluster-autoscaler/node-template/label/node-role.kubernetes.io/master", + "Value": "" + }, { "Key": "k8s.io/role/master", "Value": "1" @@ -325,6 +361,14 @@ "Key": "Name", "Value": "nodes.externallb.example.com" }, + { + "Key": "k8s.io/cluster-autoscaler/node-template/label/kubernetes.io/role", + "Value": "node" + }, + { + "Key": "k8s.io/cluster-autoscaler/node-template/label/node-role.kubernetes.io/node", + "Value": "" + }, { "Key": "k8s.io/role/node", "Value": "1" @@ -350,6 +394,14 @@ "Key": "Name", "Value": "nodes.externallb.example.com" }, + { + "Key": "k8s.io/cluster-autoscaler/node-template/label/kubernetes.io/role", + "Value": "node" + }, + { + "Key": "k8s.io/cluster-autoscaler/node-template/label/node-role.kubernetes.io/node", + "Value": "" + }, { "Key": "k8s.io/role/node", "Value": "1" diff --git a/tests/integration/update_cluster/externallb/kubernetes.tf b/tests/integration/update_cluster/externallb/kubernetes.tf index 0049a97995013..f65f4e875a20b 100644 --- a/tests/integration/update_cluster/externallb/kubernetes.tf +++ b/tests/integration/update_cluster/externallb/kubernetes.tf @@ -115,6 +115,16 @@ resource "aws_autoscaling_group" "master-us-test-1a-masters-externallb-example-c propagate_at_launch = true value = "master-us-test-1a.masters.externallb.example.com" } + tag { + key = "k8s.io/cluster-autoscaler/node-template/label/kubernetes.io/role" + propagate_at_launch = true + value = "master" + } + tag { + key = "k8s.io/cluster-autoscaler/node-template/label/node-role.kubernetes.io/master" + propagate_at_launch = true + value = "" + } tag { key = "k8s.io/role/master" propagate_at_launch = true @@ -153,6 +163,16 @@ resource "aws_autoscaling_group" "nodes-externallb-example-com" { propagate_at_launch = true value = "nodes.externallb.example.com" } + tag { + key = "k8s.io/cluster-autoscaler/node-template/label/kubernetes.io/role" + propagate_at_launch = true + value = "node" + } + tag { + key = "k8s.io/cluster-autoscaler/node-template/label/node-role.kubernetes.io/node" + propagate_at_launch = true + value = "" + } tag { key = "k8s.io/role/node" propagate_at_launch = true @@ -281,21 +301,25 @@ resource "aws_launch_template" "master-us-test-1a-masters-externallb-example-com tag_specifications { resource_type = "instance" tags = { - "KubernetesCluster" = "externallb.example.com" - "Name" = "master-us-test-1a.masters.externallb.example.com" - "k8s.io/role/master" = "1" - "kops.k8s.io/instancegroup" = "master-us-test-1a" - "kubernetes.io/cluster/externallb.example.com" = "owned" + "KubernetesCluster" = "externallb.example.com" + "Name" = "master-us-test-1a.masters.externallb.example.com" + "k8s.io/cluster-autoscaler/node-template/label/kubernetes.io/role" = "master" + "k8s.io/cluster-autoscaler/node-template/label/node-role.kubernetes.io/master" = "" + "k8s.io/role/master" = "1" + "kops.k8s.io/instancegroup" = "master-us-test-1a" + "kubernetes.io/cluster/externallb.example.com" = "owned" } } tag_specifications { resource_type = "volume" tags = { - "KubernetesCluster" = "externallb.example.com" - "Name" = "master-us-test-1a.masters.externallb.example.com" - "k8s.io/role/master" = "1" - "kops.k8s.io/instancegroup" = "master-us-test-1a" - "kubernetes.io/cluster/externallb.example.com" = "owned" + "KubernetesCluster" = "externallb.example.com" + "Name" = "master-us-test-1a.masters.externallb.example.com" + "k8s.io/cluster-autoscaler/node-template/label/kubernetes.io/role" = "master" + "k8s.io/cluster-autoscaler/node-template/label/node-role.kubernetes.io/master" = "" + "k8s.io/role/master" = "1" + "kops.k8s.io/instancegroup" = "master-us-test-1a" + "kubernetes.io/cluster/externallb.example.com" = "owned" } } user_data = filebase64("${path.module}/data/aws_launch_template_master-us-test-1a.masters.externallb.example.com_user_data") @@ -328,21 +352,25 @@ resource "aws_launch_template" "nodes-externallb-example-com" { tag_specifications { resource_type = "instance" tags = { - "KubernetesCluster" = "externallb.example.com" - "Name" = "nodes.externallb.example.com" - "k8s.io/role/node" = "1" - "kops.k8s.io/instancegroup" = "nodes" - "kubernetes.io/cluster/externallb.example.com" = "owned" + "KubernetesCluster" = "externallb.example.com" + "Name" = "nodes.externallb.example.com" + "k8s.io/cluster-autoscaler/node-template/label/kubernetes.io/role" = "node" + "k8s.io/cluster-autoscaler/node-template/label/node-role.kubernetes.io/node" = "" + "k8s.io/role/node" = "1" + "kops.k8s.io/instancegroup" = "nodes" + "kubernetes.io/cluster/externallb.example.com" = "owned" } } tag_specifications { resource_type = "volume" tags = { - "KubernetesCluster" = "externallb.example.com" - "Name" = "nodes.externallb.example.com" - "k8s.io/role/node" = "1" - "kops.k8s.io/instancegroup" = "nodes" - "kubernetes.io/cluster/externallb.example.com" = "owned" + "KubernetesCluster" = "externallb.example.com" + "Name" = "nodes.externallb.example.com" + "k8s.io/cluster-autoscaler/node-template/label/kubernetes.io/role" = "node" + "k8s.io/cluster-autoscaler/node-template/label/node-role.kubernetes.io/node" = "" + "k8s.io/role/node" = "1" + "kops.k8s.io/instancegroup" = "nodes" + "kubernetes.io/cluster/externallb.example.com" = "owned" } } user_data = filebase64("${path.module}/data/aws_launch_template_nodes.externallb.example.com_user_data") diff --git a/tests/integration/update_cluster/externalpolicies/kubernetes.tf b/tests/integration/update_cluster/externalpolicies/kubernetes.tf index 105c1f4fd8359..7bbb3cac83d50 100644 --- a/tests/integration/update_cluster/externalpolicies/kubernetes.tf +++ b/tests/integration/update_cluster/externalpolicies/kubernetes.tf @@ -115,6 +115,16 @@ resource "aws_autoscaling_group" "master-us-test-1a-masters-externalpolicies-exa propagate_at_launch = true value = "fib+baz" } + tag { + key = "k8s.io/cluster-autoscaler/node-template/label/kubernetes.io/role" + propagate_at_launch = true + value = "master" + } + tag { + key = "k8s.io/cluster-autoscaler/node-template/label/node-role.kubernetes.io/master" + propagate_at_launch = true + value = "" + } tag { key = "k8s.io/role/master" propagate_at_launch = true @@ -164,6 +174,16 @@ resource "aws_autoscaling_group" "nodes-externalpolicies-example-com" { propagate_at_launch = true value = "fib+baz" } + tag { + key = "k8s.io/cluster-autoscaler/node-template/label/kubernetes.io/role" + propagate_at_launch = true + value = "node" + } + tag { + key = "k8s.io/cluster-autoscaler/node-template/label/node-role.kubernetes.io/node" + propagate_at_launch = true + value = "" + } tag { key = "k8s.io/role/node" propagate_at_launch = true @@ -339,25 +359,29 @@ resource "aws_launch_template" "master-us-test-1a-masters-externalpolicies-examp tag_specifications { resource_type = "instance" tags = { - "KubernetesCluster" = "externalpolicies.example.com" - "Name" = "master-us-test-1a.masters.externalpolicies.example.com" - "Owner" = "John Doe" - "foo/bar" = "fib+baz" - "k8s.io/role/master" = "1" - "kops.k8s.io/instancegroup" = "master-us-test-1a" - "kubernetes.io/cluster/externalpolicies.example.com" = "owned" + "KubernetesCluster" = "externalpolicies.example.com" + "Name" = "master-us-test-1a.masters.externalpolicies.example.com" + "Owner" = "John Doe" + "foo/bar" = "fib+baz" + "k8s.io/cluster-autoscaler/node-template/label/kubernetes.io/role" = "master" + "k8s.io/cluster-autoscaler/node-template/label/node-role.kubernetes.io/master" = "" + "k8s.io/role/master" = "1" + "kops.k8s.io/instancegroup" = "master-us-test-1a" + "kubernetes.io/cluster/externalpolicies.example.com" = "owned" } } tag_specifications { resource_type = "volume" tags = { - "KubernetesCluster" = "externalpolicies.example.com" - "Name" = "master-us-test-1a.masters.externalpolicies.example.com" - "Owner" = "John Doe" - "foo/bar" = "fib+baz" - "k8s.io/role/master" = "1" - "kops.k8s.io/instancegroup" = "master-us-test-1a" - "kubernetes.io/cluster/externalpolicies.example.com" = "owned" + "KubernetesCluster" = "externalpolicies.example.com" + "Name" = "master-us-test-1a.masters.externalpolicies.example.com" + "Owner" = "John Doe" + "foo/bar" = "fib+baz" + "k8s.io/cluster-autoscaler/node-template/label/kubernetes.io/role" = "master" + "k8s.io/cluster-autoscaler/node-template/label/node-role.kubernetes.io/master" = "" + "k8s.io/role/master" = "1" + "kops.k8s.io/instancegroup" = "master-us-test-1a" + "kubernetes.io/cluster/externalpolicies.example.com" = "owned" } } user_data = filebase64("${path.module}/data/aws_launch_template_master-us-test-1a.masters.externalpolicies.example.com_user_data") @@ -390,25 +414,29 @@ resource "aws_launch_template" "nodes-externalpolicies-example-com" { tag_specifications { resource_type = "instance" tags = { - "KubernetesCluster" = "externalpolicies.example.com" - "Name" = "nodes.externalpolicies.example.com" - "Owner" = "John Doe" - "foo/bar" = "fib+baz" - "k8s.io/role/node" = "1" - "kops.k8s.io/instancegroup" = "nodes" - "kubernetes.io/cluster/externalpolicies.example.com" = "owned" + "KubernetesCluster" = "externalpolicies.example.com" + "Name" = "nodes.externalpolicies.example.com" + "Owner" = "John Doe" + "foo/bar" = "fib+baz" + "k8s.io/cluster-autoscaler/node-template/label/kubernetes.io/role" = "node" + "k8s.io/cluster-autoscaler/node-template/label/node-role.kubernetes.io/node" = "" + "k8s.io/role/node" = "1" + "kops.k8s.io/instancegroup" = "nodes" + "kubernetes.io/cluster/externalpolicies.example.com" = "owned" } } tag_specifications { resource_type = "volume" tags = { - "KubernetesCluster" = "externalpolicies.example.com" - "Name" = "nodes.externalpolicies.example.com" - "Owner" = "John Doe" - "foo/bar" = "fib+baz" - "k8s.io/role/node" = "1" - "kops.k8s.io/instancegroup" = "nodes" - "kubernetes.io/cluster/externalpolicies.example.com" = "owned" + "KubernetesCluster" = "externalpolicies.example.com" + "Name" = "nodes.externalpolicies.example.com" + "Owner" = "John Doe" + "foo/bar" = "fib+baz" + "k8s.io/cluster-autoscaler/node-template/label/kubernetes.io/role" = "node" + "k8s.io/cluster-autoscaler/node-template/label/node-role.kubernetes.io/node" = "" + "k8s.io/role/node" = "1" + "kops.k8s.io/instancegroup" = "nodes" + "kubernetes.io/cluster/externalpolicies.example.com" = "owned" } } user_data = filebase64("${path.module}/data/aws_launch_template_nodes.externalpolicies.example.com_user_data") diff --git a/tests/integration/update_cluster/ha/kubernetes.tf b/tests/integration/update_cluster/ha/kubernetes.tf index 68a91680d44a0..14e1bc482cbfd 100644 --- a/tests/integration/update_cluster/ha/kubernetes.tf +++ b/tests/integration/update_cluster/ha/kubernetes.tf @@ -110,6 +110,16 @@ resource "aws_autoscaling_group" "master-us-test-1a-masters-ha-example-com" { propagate_at_launch = true value = "master-us-test-1a.masters.ha.example.com" } + tag { + key = "k8s.io/cluster-autoscaler/node-template/label/kubernetes.io/role" + propagate_at_launch = true + value = "master" + } + tag { + key = "k8s.io/cluster-autoscaler/node-template/label/node-role.kubernetes.io/master" + propagate_at_launch = true + value = "" + } tag { key = "k8s.io/role/master" propagate_at_launch = true @@ -148,6 +158,16 @@ resource "aws_autoscaling_group" "master-us-test-1b-masters-ha-example-com" { propagate_at_launch = true value = "master-us-test-1b.masters.ha.example.com" } + tag { + key = "k8s.io/cluster-autoscaler/node-template/label/kubernetes.io/role" + propagate_at_launch = true + value = "master" + } + tag { + key = "k8s.io/cluster-autoscaler/node-template/label/node-role.kubernetes.io/master" + propagate_at_launch = true + value = "" + } tag { key = "k8s.io/role/master" propagate_at_launch = true @@ -186,6 +206,16 @@ resource "aws_autoscaling_group" "master-us-test-1c-masters-ha-example-com" { propagate_at_launch = true value = "master-us-test-1c.masters.ha.example.com" } + tag { + key = "k8s.io/cluster-autoscaler/node-template/label/kubernetes.io/role" + propagate_at_launch = true + value = "master" + } + tag { + key = "k8s.io/cluster-autoscaler/node-template/label/node-role.kubernetes.io/master" + propagate_at_launch = true + value = "" + } tag { key = "k8s.io/role/master" propagate_at_launch = true @@ -224,6 +254,16 @@ resource "aws_autoscaling_group" "nodes-ha-example-com" { propagate_at_launch = true value = "nodes.ha.example.com" } + tag { + key = "k8s.io/cluster-autoscaler/node-template/label/kubernetes.io/role" + propagate_at_launch = true + value = "node" + } + tag { + key = "k8s.io/cluster-autoscaler/node-template/label/node-role.kubernetes.io/node" + propagate_at_launch = true + value = "" + } tag { key = "k8s.io/role/node" propagate_at_launch = true @@ -408,21 +448,25 @@ resource "aws_launch_template" "master-us-test-1a-masters-ha-example-com" { tag_specifications { resource_type = "instance" tags = { - "KubernetesCluster" = "ha.example.com" - "Name" = "master-us-test-1a.masters.ha.example.com" - "k8s.io/role/master" = "1" - "kops.k8s.io/instancegroup" = "master-us-test-1a" - "kubernetes.io/cluster/ha.example.com" = "owned" + "KubernetesCluster" = "ha.example.com" + "Name" = "master-us-test-1a.masters.ha.example.com" + "k8s.io/cluster-autoscaler/node-template/label/kubernetes.io/role" = "master" + "k8s.io/cluster-autoscaler/node-template/label/node-role.kubernetes.io/master" = "" + "k8s.io/role/master" = "1" + "kops.k8s.io/instancegroup" = "master-us-test-1a" + "kubernetes.io/cluster/ha.example.com" = "owned" } } tag_specifications { resource_type = "volume" tags = { - "KubernetesCluster" = "ha.example.com" - "Name" = "master-us-test-1a.masters.ha.example.com" - "k8s.io/role/master" = "1" - "kops.k8s.io/instancegroup" = "master-us-test-1a" - "kubernetes.io/cluster/ha.example.com" = "owned" + "KubernetesCluster" = "ha.example.com" + "Name" = "master-us-test-1a.masters.ha.example.com" + "k8s.io/cluster-autoscaler/node-template/label/kubernetes.io/role" = "master" + "k8s.io/cluster-autoscaler/node-template/label/node-role.kubernetes.io/master" = "" + "k8s.io/role/master" = "1" + "kops.k8s.io/instancegroup" = "master-us-test-1a" + "kubernetes.io/cluster/ha.example.com" = "owned" } } user_data = filebase64("${path.module}/data/aws_launch_template_master-us-test-1a.masters.ha.example.com_user_data") @@ -459,21 +503,25 @@ resource "aws_launch_template" "master-us-test-1b-masters-ha-example-com" { tag_specifications { resource_type = "instance" tags = { - "KubernetesCluster" = "ha.example.com" - "Name" = "master-us-test-1b.masters.ha.example.com" - "k8s.io/role/master" = "1" - "kops.k8s.io/instancegroup" = "master-us-test-1b" - "kubernetes.io/cluster/ha.example.com" = "owned" + "KubernetesCluster" = "ha.example.com" + "Name" = "master-us-test-1b.masters.ha.example.com" + "k8s.io/cluster-autoscaler/node-template/label/kubernetes.io/role" = "master" + "k8s.io/cluster-autoscaler/node-template/label/node-role.kubernetes.io/master" = "" + "k8s.io/role/master" = "1" + "kops.k8s.io/instancegroup" = "master-us-test-1b" + "kubernetes.io/cluster/ha.example.com" = "owned" } } tag_specifications { resource_type = "volume" tags = { - "KubernetesCluster" = "ha.example.com" - "Name" = "master-us-test-1b.masters.ha.example.com" - "k8s.io/role/master" = "1" - "kops.k8s.io/instancegroup" = "master-us-test-1b" - "kubernetes.io/cluster/ha.example.com" = "owned" + "KubernetesCluster" = "ha.example.com" + "Name" = "master-us-test-1b.masters.ha.example.com" + "k8s.io/cluster-autoscaler/node-template/label/kubernetes.io/role" = "master" + "k8s.io/cluster-autoscaler/node-template/label/node-role.kubernetes.io/master" = "" + "k8s.io/role/master" = "1" + "kops.k8s.io/instancegroup" = "master-us-test-1b" + "kubernetes.io/cluster/ha.example.com" = "owned" } } user_data = filebase64("${path.module}/data/aws_launch_template_master-us-test-1b.masters.ha.example.com_user_data") @@ -510,21 +558,25 @@ resource "aws_launch_template" "master-us-test-1c-masters-ha-example-com" { tag_specifications { resource_type = "instance" tags = { - "KubernetesCluster" = "ha.example.com" - "Name" = "master-us-test-1c.masters.ha.example.com" - "k8s.io/role/master" = "1" - "kops.k8s.io/instancegroup" = "master-us-test-1c" - "kubernetes.io/cluster/ha.example.com" = "owned" + "KubernetesCluster" = "ha.example.com" + "Name" = "master-us-test-1c.masters.ha.example.com" + "k8s.io/cluster-autoscaler/node-template/label/kubernetes.io/role" = "master" + "k8s.io/cluster-autoscaler/node-template/label/node-role.kubernetes.io/master" = "" + "k8s.io/role/master" = "1" + "kops.k8s.io/instancegroup" = "master-us-test-1c" + "kubernetes.io/cluster/ha.example.com" = "owned" } } tag_specifications { resource_type = "volume" tags = { - "KubernetesCluster" = "ha.example.com" - "Name" = "master-us-test-1c.masters.ha.example.com" - "k8s.io/role/master" = "1" - "kops.k8s.io/instancegroup" = "master-us-test-1c" - "kubernetes.io/cluster/ha.example.com" = "owned" + "KubernetesCluster" = "ha.example.com" + "Name" = "master-us-test-1c.masters.ha.example.com" + "k8s.io/cluster-autoscaler/node-template/label/kubernetes.io/role" = "master" + "k8s.io/cluster-autoscaler/node-template/label/node-role.kubernetes.io/master" = "" + "k8s.io/role/master" = "1" + "kops.k8s.io/instancegroup" = "master-us-test-1c" + "kubernetes.io/cluster/ha.example.com" = "owned" } } user_data = filebase64("${path.module}/data/aws_launch_template_master-us-test-1c.masters.ha.example.com_user_data") @@ -557,21 +609,25 @@ resource "aws_launch_template" "nodes-ha-example-com" { tag_specifications { resource_type = "instance" tags = { - "KubernetesCluster" = "ha.example.com" - "Name" = "nodes.ha.example.com" - "k8s.io/role/node" = "1" - "kops.k8s.io/instancegroup" = "nodes" - "kubernetes.io/cluster/ha.example.com" = "owned" + "KubernetesCluster" = "ha.example.com" + "Name" = "nodes.ha.example.com" + "k8s.io/cluster-autoscaler/node-template/label/kubernetes.io/role" = "node" + "k8s.io/cluster-autoscaler/node-template/label/node-role.kubernetes.io/node" = "" + "k8s.io/role/node" = "1" + "kops.k8s.io/instancegroup" = "nodes" + "kubernetes.io/cluster/ha.example.com" = "owned" } } tag_specifications { resource_type = "volume" tags = { - "KubernetesCluster" = "ha.example.com" - "Name" = "nodes.ha.example.com" - "k8s.io/role/node" = "1" - "kops.k8s.io/instancegroup" = "nodes" - "kubernetes.io/cluster/ha.example.com" = "owned" + "KubernetesCluster" = "ha.example.com" + "Name" = "nodes.ha.example.com" + "k8s.io/cluster-autoscaler/node-template/label/kubernetes.io/role" = "node" + "k8s.io/cluster-autoscaler/node-template/label/node-role.kubernetes.io/node" = "" + "k8s.io/role/node" = "1" + "kops.k8s.io/instancegroup" = "nodes" + "kubernetes.io/cluster/ha.example.com" = "owned" } } user_data = filebase64("${path.module}/data/aws_launch_template_nodes.ha.example.com_user_data") diff --git a/tests/integration/update_cluster/launch_templates/cloudformation.json b/tests/integration/update_cluster/launch_templates/cloudformation.json index 70083b80f372b..0ac89d1e788be 100644 --- a/tests/integration/update_cluster/launch_templates/cloudformation.json +++ b/tests/integration/update_cluster/launch_templates/cloudformation.json @@ -25,6 +25,16 @@ "Value": "master-us-test-1a.masters.launchtemplates.example.com", "PropagateAtLaunch": true }, + { + "Key": "k8s.io/cluster-autoscaler/node-template/label/kubernetes.io/role", + "Value": "master", + "PropagateAtLaunch": true + }, + { + "Key": "k8s.io/cluster-autoscaler/node-template/label/node-role.kubernetes.io/master", + "Value": "", + "PropagateAtLaunch": true + }, { "Key": "k8s.io/role/master", "Value": "1", @@ -83,6 +93,16 @@ "Value": "master-us-test-1b.masters.launchtemplates.example.com", "PropagateAtLaunch": true }, + { + "Key": "k8s.io/cluster-autoscaler/node-template/label/kubernetes.io/role", + "Value": "master", + "PropagateAtLaunch": true + }, + { + "Key": "k8s.io/cluster-autoscaler/node-template/label/node-role.kubernetes.io/master", + "Value": "", + "PropagateAtLaunch": true + }, { "Key": "k8s.io/role/master", "Value": "1", @@ -141,6 +161,16 @@ "Value": "master-us-test-1c.masters.launchtemplates.example.com", "PropagateAtLaunch": true }, + { + "Key": "k8s.io/cluster-autoscaler/node-template/label/kubernetes.io/role", + "Value": "master", + "PropagateAtLaunch": true + }, + { + "Key": "k8s.io/cluster-autoscaler/node-template/label/node-role.kubernetes.io/master", + "Value": "", + "PropagateAtLaunch": true + }, { "Key": "k8s.io/role/master", "Value": "1", @@ -199,6 +229,16 @@ "Value": "nodes.launchtemplates.example.com", "PropagateAtLaunch": true }, + { + "Key": "k8s.io/cluster-autoscaler/node-template/label/kubernetes.io/role", + "Value": "node", + "PropagateAtLaunch": true + }, + { + "Key": "k8s.io/cluster-autoscaler/node-template/label/node-role.kubernetes.io/node", + "Value": "", + "PropagateAtLaunch": true + }, { "Key": "k8s.io/role/node", "Value": "1", diff --git a/tests/integration/update_cluster/launch_templates/kubernetes.tf b/tests/integration/update_cluster/launch_templates/kubernetes.tf index c7b80b45daa5d..53b11aa0d5708 100644 --- a/tests/integration/update_cluster/launch_templates/kubernetes.tf +++ b/tests/integration/update_cluster/launch_templates/kubernetes.tf @@ -107,6 +107,16 @@ resource "aws_autoscaling_group" "master-us-test-1a-masters-launchtemplates-exam propagate_at_launch = true value = "master-us-test-1a.masters.launchtemplates.example.com" } + tag { + key = "k8s.io/cluster-autoscaler/node-template/label/kubernetes.io/role" + propagate_at_launch = true + value = "master" + } + tag { + key = "k8s.io/cluster-autoscaler/node-template/label/node-role.kubernetes.io/master" + propagate_at_launch = true + value = "" + } tag { key = "k8s.io/role/master" propagate_at_launch = true @@ -142,6 +152,16 @@ resource "aws_autoscaling_group" "master-us-test-1b-masters-launchtemplates-exam propagate_at_launch = true value = "master-us-test-1b.masters.launchtemplates.example.com" } + tag { + key = "k8s.io/cluster-autoscaler/node-template/label/kubernetes.io/role" + propagate_at_launch = true + value = "master" + } + tag { + key = "k8s.io/cluster-autoscaler/node-template/label/node-role.kubernetes.io/master" + propagate_at_launch = true + value = "" + } tag { key = "k8s.io/role/master" propagate_at_launch = true @@ -177,6 +197,16 @@ resource "aws_autoscaling_group" "master-us-test-1c-masters-launchtemplates-exam propagate_at_launch = true value = "master-us-test-1c.masters.launchtemplates.example.com" } + tag { + key = "k8s.io/cluster-autoscaler/node-template/label/kubernetes.io/role" + propagate_at_launch = true + value = "master" + } + tag { + key = "k8s.io/cluster-autoscaler/node-template/label/node-role.kubernetes.io/master" + propagate_at_launch = true + value = "" + } tag { key = "k8s.io/role/master" propagate_at_launch = true @@ -213,6 +243,16 @@ resource "aws_autoscaling_group" "nodes-launchtemplates-example-com" { propagate_at_launch = true value = "nodes.launchtemplates.example.com" } + tag { + key = "k8s.io/cluster-autoscaler/node-template/label/kubernetes.io/role" + propagate_at_launch = true + value = "node" + } + tag { + key = "k8s.io/cluster-autoscaler/node-template/label/node-role.kubernetes.io/node" + propagate_at_launch = true + value = "" + } tag { key = "k8s.io/role/node" propagate_at_launch = true diff --git a/tests/integration/update_cluster/minimal-cloudformation/cloudformation.json b/tests/integration/update_cluster/minimal-cloudformation/cloudformation.json index 826b827f502a8..1f86c60b4ba18 100644 --- a/tests/integration/update_cluster/minimal-cloudformation/cloudformation.json +++ b/tests/integration/update_cluster/minimal-cloudformation/cloudformation.json @@ -33,6 +33,16 @@ "Value": "master-us-test-1a.masters.minimal.example.com", "PropagateAtLaunch": true }, + { + "Key": "k8s.io/cluster-autoscaler/node-template/label/kubernetes.io/role", + "Value": "master", + "PropagateAtLaunch": true + }, + { + "Key": "k8s.io/cluster-autoscaler/node-template/label/node-role.kubernetes.io/master", + "Value": "", + "PropagateAtLaunch": true + }, { "Key": "k8s.io/role/master", "Value": "1", @@ -99,6 +109,16 @@ "Value": "nodes.minimal.example.com", "PropagateAtLaunch": true }, + { + "Key": "k8s.io/cluster-autoscaler/node-template/label/kubernetes.io/role", + "Value": "node", + "PropagateAtLaunch": true + }, + { + "Key": "k8s.io/cluster-autoscaler/node-template/label/node-role.kubernetes.io/node", + "Value": "", + "PropagateAtLaunch": true + }, { "Key": "k8s.io/role/node", "Value": "1", @@ -225,6 +245,14 @@ "Key": "Name", "Value": "master-us-test-1a.masters.minimal.example.com" }, + { + "Key": "k8s.io/cluster-autoscaler/node-template/label/kubernetes.io/role", + "Value": "master" + }, + { + "Key": "k8s.io/cluster-autoscaler/node-template/label/node-role.kubernetes.io/master", + "Value": "" + }, { "Key": "k8s.io/role/master", "Value": "1" @@ -250,6 +278,14 @@ "Key": "Name", "Value": "master-us-test-1a.masters.minimal.example.com" }, + { + "Key": "k8s.io/cluster-autoscaler/node-template/label/kubernetes.io/role", + "Value": "master" + }, + { + "Key": "k8s.io/cluster-autoscaler/node-template/label/node-role.kubernetes.io/master", + "Value": "" + }, { "Key": "k8s.io/role/master", "Value": "1" @@ -316,6 +352,14 @@ "Key": "Name", "Value": "nodes.minimal.example.com" }, + { + "Key": "k8s.io/cluster-autoscaler/node-template/label/kubernetes.io/role", + "Value": "node" + }, + { + "Key": "k8s.io/cluster-autoscaler/node-template/label/node-role.kubernetes.io/node", + "Value": "" + }, { "Key": "k8s.io/role/node", "Value": "1" @@ -341,6 +385,14 @@ "Key": "Name", "Value": "nodes.minimal.example.com" }, + { + "Key": "k8s.io/cluster-autoscaler/node-template/label/kubernetes.io/role", + "Value": "node" + }, + { + "Key": "k8s.io/cluster-autoscaler/node-template/label/node-role.kubernetes.io/node", + "Value": "" + }, { "Key": "k8s.io/role/node", "Value": "1" diff --git a/tests/integration/update_cluster/minimal-json/kubernetes.tf.json b/tests/integration/update_cluster/minimal-json/kubernetes.tf.json index 1fa00beecda88..47d64667f1c74 100644 --- a/tests/integration/update_cluster/minimal-json/kubernetes.tf.json +++ b/tests/integration/update_cluster/minimal-json/kubernetes.tf.json @@ -112,6 +112,16 @@ "value": "master-us-test-1a.masters.minimal-json.example.com", "propagate_at_launch": true }, + { + "key": "k8s.io/cluster-autoscaler/node-template/label/kubernetes.io/role", + "value": "master", + "propagate_at_launch": true + }, + { + "key": "k8s.io/cluster-autoscaler/node-template/label/node-role.kubernetes.io/master", + "value": "", + "propagate_at_launch": true + }, { "key": "k8s.io/role/master", "value": "1", @@ -162,6 +172,16 @@ "value": "nodes.minimal-json.example.com", "propagate_at_launch": true }, + { + "key": "k8s.io/cluster-autoscaler/node-template/label/kubernetes.io/role", + "value": "node", + "propagate_at_launch": true + }, + { + "key": "k8s.io/cluster-autoscaler/node-template/label/node-role.kubernetes.io/node", + "value": "", + "propagate_at_launch": true + }, { "key": "k8s.io/role/node", "value": "1", @@ -317,6 +337,8 @@ "tags": { "KubernetesCluster": "minimal-json.example.com", "Name": "master-us-test-1a.masters.minimal-json.example.com", + "k8s.io/cluster-autoscaler/node-template/label/kubernetes.io/role": "master", + "k8s.io/cluster-autoscaler/node-template/label/node-role.kubernetes.io/master": "", "k8s.io/role/master": "1", "kops.k8s.io/instancegroup": "master-us-test-1a", "kubernetes.io/cluster/minimal-json.example.com": "owned" @@ -327,6 +349,8 @@ "tags": { "KubernetesCluster": "minimal-json.example.com", "Name": "master-us-test-1a.masters.minimal-json.example.com", + "k8s.io/cluster-autoscaler/node-template/label/kubernetes.io/role": "master", + "k8s.io/cluster-autoscaler/node-template/label/node-role.kubernetes.io/master": "", "k8s.io/role/master": "1", "kops.k8s.io/instancegroup": "master-us-test-1a", "kubernetes.io/cluster/minimal-json.example.com": "owned" @@ -375,6 +399,8 @@ "tags": { "KubernetesCluster": "minimal-json.example.com", "Name": "nodes.minimal-json.example.com", + "k8s.io/cluster-autoscaler/node-template/label/kubernetes.io/role": "node", + "k8s.io/cluster-autoscaler/node-template/label/node-role.kubernetes.io/node": "", "k8s.io/role/node": "1", "kops.k8s.io/instancegroup": "nodes", "kubernetes.io/cluster/minimal-json.example.com": "owned" @@ -385,6 +411,8 @@ "tags": { "KubernetesCluster": "minimal-json.example.com", "Name": "nodes.minimal-json.example.com", + "k8s.io/cluster-autoscaler/node-template/label/kubernetes.io/role": "node", + "k8s.io/cluster-autoscaler/node-template/label/node-role.kubernetes.io/node": "", "k8s.io/role/node": "1", "kops.k8s.io/instancegroup": "nodes", "kubernetes.io/cluster/minimal-json.example.com": "owned" diff --git a/tests/integration/update_cluster/minimal-tf11/kubernetes.tf b/tests/integration/update_cluster/minimal-tf11/kubernetes.tf index 322505c0a58be..cd71d549744ca 100644 --- a/tests/integration/update_cluster/minimal-tf11/kubernetes.tf +++ b/tests/integration/update_cluster/minimal-tf11/kubernetes.tf @@ -104,6 +104,18 @@ resource "aws_autoscaling_group" "master-us-test-1a-masters-minimal-tf11-example propagate_at_launch = true } + tag = { + key = "k8s.io/cluster-autoscaler/node-template/label/kubernetes.io/role" + value = "master" + propagate_at_launch = true + } + + tag = { + key = "k8s.io/cluster-autoscaler/node-template/label/node-role.kubernetes.io/master" + value = "" + propagate_at_launch = true + } + tag = { key = "k8s.io/role/master" value = "1" @@ -150,6 +162,18 @@ resource "aws_autoscaling_group" "nodes-minimal-tf11-example-com" { propagate_at_launch = true } + tag = { + key = "k8s.io/cluster-autoscaler/node-template/label/kubernetes.io/role" + value = "node" + propagate_at_launch = true + } + + tag = { + key = "k8s.io/cluster-autoscaler/node-template/label/node-role.kubernetes.io/node" + value = "" + propagate_at_launch = true + } + tag = { key = "k8s.io/role/node" value = "1" @@ -295,11 +319,13 @@ resource "aws_launch_template" "master-us-test-1a-masters-minimal-tf11-example-c resource_type = "instance" tags = { - KubernetesCluster = "minimal-tf11.example.com" - Name = "master-us-test-1a.masters.minimal-tf11.example.com" - "k8s.io/role/master" = "1" - "kops.k8s.io/instancegroup" = "master-us-test-1a" - "kubernetes.io/cluster/minimal-tf11.example.com" = "owned" + KubernetesCluster = "minimal-tf11.example.com" + Name = "master-us-test-1a.masters.minimal-tf11.example.com" + "k8s.io/cluster-autoscaler/node-template/label/kubernetes.io/role" = "master" + "k8s.io/cluster-autoscaler/node-template/label/node-role.kubernetes.io/master" = "" + "k8s.io/role/master" = "1" + "kops.k8s.io/instancegroup" = "master-us-test-1a" + "kubernetes.io/cluster/minimal-tf11.example.com" = "owned" } } @@ -307,11 +333,13 @@ resource "aws_launch_template" "master-us-test-1a-masters-minimal-tf11-example-c resource_type = "volume" tags = { - KubernetesCluster = "minimal-tf11.example.com" - Name = "master-us-test-1a.masters.minimal-tf11.example.com" - "k8s.io/role/master" = "1" - "kops.k8s.io/instancegroup" = "master-us-test-1a" - "kubernetes.io/cluster/minimal-tf11.example.com" = "owned" + KubernetesCluster = "minimal-tf11.example.com" + Name = "master-us-test-1a.masters.minimal-tf11.example.com" + "k8s.io/cluster-autoscaler/node-template/label/kubernetes.io/role" = "master" + "k8s.io/cluster-autoscaler/node-template/label/node-role.kubernetes.io/master" = "" + "k8s.io/role/master" = "1" + "kops.k8s.io/instancegroup" = "master-us-test-1a" + "kubernetes.io/cluster/minimal-tf11.example.com" = "owned" } } @@ -353,11 +381,13 @@ resource "aws_launch_template" "nodes-minimal-tf11-example-com" { resource_type = "instance" tags = { - KubernetesCluster = "minimal-tf11.example.com" - Name = "nodes.minimal-tf11.example.com" - "k8s.io/role/node" = "1" - "kops.k8s.io/instancegroup" = "nodes" - "kubernetes.io/cluster/minimal-tf11.example.com" = "owned" + KubernetesCluster = "minimal-tf11.example.com" + Name = "nodes.minimal-tf11.example.com" + "k8s.io/cluster-autoscaler/node-template/label/kubernetes.io/role" = "node" + "k8s.io/cluster-autoscaler/node-template/label/node-role.kubernetes.io/node" = "" + "k8s.io/role/node" = "1" + "kops.k8s.io/instancegroup" = "nodes" + "kubernetes.io/cluster/minimal-tf11.example.com" = "owned" } } @@ -365,11 +395,13 @@ resource "aws_launch_template" "nodes-minimal-tf11-example-com" { resource_type = "volume" tags = { - KubernetesCluster = "minimal-tf11.example.com" - Name = "nodes.minimal-tf11.example.com" - "k8s.io/role/node" = "1" - "kops.k8s.io/instancegroup" = "nodes" - "kubernetes.io/cluster/minimal-tf11.example.com" = "owned" + KubernetesCluster = "minimal-tf11.example.com" + Name = "nodes.minimal-tf11.example.com" + "k8s.io/cluster-autoscaler/node-template/label/kubernetes.io/role" = "node" + "k8s.io/cluster-autoscaler/node-template/label/node-role.kubernetes.io/node" = "" + "k8s.io/role/node" = "1" + "kops.k8s.io/instancegroup" = "nodes" + "kubernetes.io/cluster/minimal-tf11.example.com" = "owned" } } diff --git a/tests/integration/update_cluster/minimal/kubernetes.tf b/tests/integration/update_cluster/minimal/kubernetes.tf index e36dc7eed41db..b8cde55a44acc 100644 --- a/tests/integration/update_cluster/minimal/kubernetes.tf +++ b/tests/integration/update_cluster/minimal/kubernetes.tf @@ -100,6 +100,16 @@ resource "aws_autoscaling_group" "master-us-test-1a-masters-minimal-example-com" propagate_at_launch = true value = "master-us-test-1a.masters.minimal.example.com" } + tag { + key = "k8s.io/cluster-autoscaler/node-template/label/kubernetes.io/role" + propagate_at_launch = true + value = "master" + } + tag { + key = "k8s.io/cluster-autoscaler/node-template/label/node-role.kubernetes.io/master" + propagate_at_launch = true + value = "" + } tag { key = "k8s.io/role/master" propagate_at_launch = true @@ -138,6 +148,16 @@ resource "aws_autoscaling_group" "nodes-minimal-example-com" { propagate_at_launch = true value = "nodes.minimal.example.com" } + tag { + key = "k8s.io/cluster-autoscaler/node-template/label/kubernetes.io/role" + propagate_at_launch = true + value = "node" + } + tag { + key = "k8s.io/cluster-autoscaler/node-template/label/node-role.kubernetes.io/node" + propagate_at_launch = true + value = "" + } tag { key = "k8s.io/role/node" propagate_at_launch = true @@ -266,21 +286,25 @@ resource "aws_launch_template" "master-us-test-1a-masters-minimal-example-com" { tag_specifications { resource_type = "instance" tags = { - "KubernetesCluster" = "minimal.example.com" - "Name" = "master-us-test-1a.masters.minimal.example.com" - "k8s.io/role/master" = "1" - "kops.k8s.io/instancegroup" = "master-us-test-1a" - "kubernetes.io/cluster/minimal.example.com" = "owned" + "KubernetesCluster" = "minimal.example.com" + "Name" = "master-us-test-1a.masters.minimal.example.com" + "k8s.io/cluster-autoscaler/node-template/label/kubernetes.io/role" = "master" + "k8s.io/cluster-autoscaler/node-template/label/node-role.kubernetes.io/master" = "" + "k8s.io/role/master" = "1" + "kops.k8s.io/instancegroup" = "master-us-test-1a" + "kubernetes.io/cluster/minimal.example.com" = "owned" } } tag_specifications { resource_type = "volume" tags = { - "KubernetesCluster" = "minimal.example.com" - "Name" = "master-us-test-1a.masters.minimal.example.com" - "k8s.io/role/master" = "1" - "kops.k8s.io/instancegroup" = "master-us-test-1a" - "kubernetes.io/cluster/minimal.example.com" = "owned" + "KubernetesCluster" = "minimal.example.com" + "Name" = "master-us-test-1a.masters.minimal.example.com" + "k8s.io/cluster-autoscaler/node-template/label/kubernetes.io/role" = "master" + "k8s.io/cluster-autoscaler/node-template/label/node-role.kubernetes.io/master" = "" + "k8s.io/role/master" = "1" + "kops.k8s.io/instancegroup" = "master-us-test-1a" + "kubernetes.io/cluster/minimal.example.com" = "owned" } } user_data = filebase64("${path.module}/data/aws_launch_template_master-us-test-1a.masters.minimal.example.com_user_data") @@ -313,21 +337,25 @@ resource "aws_launch_template" "nodes-minimal-example-com" { tag_specifications { resource_type = "instance" tags = { - "KubernetesCluster" = "minimal.example.com" - "Name" = "nodes.minimal.example.com" - "k8s.io/role/node" = "1" - "kops.k8s.io/instancegroup" = "nodes" - "kubernetes.io/cluster/minimal.example.com" = "owned" + "KubernetesCluster" = "minimal.example.com" + "Name" = "nodes.minimal.example.com" + "k8s.io/cluster-autoscaler/node-template/label/kubernetes.io/role" = "node" + "k8s.io/cluster-autoscaler/node-template/label/node-role.kubernetes.io/node" = "" + "k8s.io/role/node" = "1" + "kops.k8s.io/instancegroup" = "nodes" + "kubernetes.io/cluster/minimal.example.com" = "owned" } } tag_specifications { resource_type = "volume" tags = { - "KubernetesCluster" = "minimal.example.com" - "Name" = "nodes.minimal.example.com" - "k8s.io/role/node" = "1" - "kops.k8s.io/instancegroup" = "nodes" - "kubernetes.io/cluster/minimal.example.com" = "owned" + "KubernetesCluster" = "minimal.example.com" + "Name" = "nodes.minimal.example.com" + "k8s.io/cluster-autoscaler/node-template/label/kubernetes.io/role" = "node" + "k8s.io/cluster-autoscaler/node-template/label/node-role.kubernetes.io/node" = "" + "k8s.io/role/node" = "1" + "kops.k8s.io/instancegroup" = "nodes" + "kubernetes.io/cluster/minimal.example.com" = "owned" } } user_data = filebase64("${path.module}/data/aws_launch_template_nodes.minimal.example.com_user_data") diff --git a/tests/integration/update_cluster/mixed_instances/cloudformation.json b/tests/integration/update_cluster/mixed_instances/cloudformation.json index 18ea84b147aba..bfa39b6d29339 100644 --- a/tests/integration/update_cluster/mixed_instances/cloudformation.json +++ b/tests/integration/update_cluster/mixed_instances/cloudformation.json @@ -33,6 +33,16 @@ "Value": "master-us-test-1a.masters.mixedinstances.example.com", "PropagateAtLaunch": true }, + { + "Key": "k8s.io/cluster-autoscaler/node-template/label/kubernetes.io/role", + "Value": "master", + "PropagateAtLaunch": true + }, + { + "Key": "k8s.io/cluster-autoscaler/node-template/label/node-role.kubernetes.io/master", + "Value": "", + "PropagateAtLaunch": true + }, { "Key": "k8s.io/role/master", "Value": "1", @@ -99,6 +109,16 @@ "Value": "master-us-test-1b.masters.mixedinstances.example.com", "PropagateAtLaunch": true }, + { + "Key": "k8s.io/cluster-autoscaler/node-template/label/kubernetes.io/role", + "Value": "master", + "PropagateAtLaunch": true + }, + { + "Key": "k8s.io/cluster-autoscaler/node-template/label/node-role.kubernetes.io/master", + "Value": "", + "PropagateAtLaunch": true + }, { "Key": "k8s.io/role/master", "Value": "1", @@ -165,6 +185,16 @@ "Value": "master-us-test-1c.masters.mixedinstances.example.com", "PropagateAtLaunch": true }, + { + "Key": "k8s.io/cluster-autoscaler/node-template/label/kubernetes.io/role", + "Value": "master", + "PropagateAtLaunch": true + }, + { + "Key": "k8s.io/cluster-autoscaler/node-template/label/node-role.kubernetes.io/master", + "Value": "", + "PropagateAtLaunch": true + }, { "Key": "k8s.io/role/master", "Value": "1", @@ -220,6 +250,16 @@ "Value": "nodes.mixedinstances.example.com", "PropagateAtLaunch": true }, + { + "Key": "k8s.io/cluster-autoscaler/node-template/label/kubernetes.io/role", + "Value": "node", + "PropagateAtLaunch": true + }, + { + "Key": "k8s.io/cluster-autoscaler/node-template/label/node-role.kubernetes.io/node", + "Value": "", + "PropagateAtLaunch": true + }, { "Key": "k8s.io/role/node", "Value": "1", @@ -376,6 +416,14 @@ "Key": "Name", "Value": "master-us-test-1a.masters.mixedinstances.example.com" }, + { + "Key": "k8s.io/cluster-autoscaler/node-template/label/kubernetes.io/role", + "Value": "master" + }, + { + "Key": "k8s.io/cluster-autoscaler/node-template/label/node-role.kubernetes.io/master", + "Value": "" + }, { "Key": "k8s.io/role/master", "Value": "1" @@ -401,6 +449,14 @@ "Key": "Name", "Value": "master-us-test-1a.masters.mixedinstances.example.com" }, + { + "Key": "k8s.io/cluster-autoscaler/node-template/label/kubernetes.io/role", + "Value": "master" + }, + { + "Key": "k8s.io/cluster-autoscaler/node-template/label/node-role.kubernetes.io/master", + "Value": "" + }, { "Key": "k8s.io/role/master", "Value": "1" @@ -471,6 +527,14 @@ "Key": "Name", "Value": "master-us-test-1b.masters.mixedinstances.example.com" }, + { + "Key": "k8s.io/cluster-autoscaler/node-template/label/kubernetes.io/role", + "Value": "master" + }, + { + "Key": "k8s.io/cluster-autoscaler/node-template/label/node-role.kubernetes.io/master", + "Value": "" + }, { "Key": "k8s.io/role/master", "Value": "1" @@ -496,6 +560,14 @@ "Key": "Name", "Value": "master-us-test-1b.masters.mixedinstances.example.com" }, + { + "Key": "k8s.io/cluster-autoscaler/node-template/label/kubernetes.io/role", + "Value": "master" + }, + { + "Key": "k8s.io/cluster-autoscaler/node-template/label/node-role.kubernetes.io/master", + "Value": "" + }, { "Key": "k8s.io/role/master", "Value": "1" @@ -566,6 +638,14 @@ "Key": "Name", "Value": "master-us-test-1c.masters.mixedinstances.example.com" }, + { + "Key": "k8s.io/cluster-autoscaler/node-template/label/kubernetes.io/role", + "Value": "master" + }, + { + "Key": "k8s.io/cluster-autoscaler/node-template/label/node-role.kubernetes.io/master", + "Value": "" + }, { "Key": "k8s.io/role/master", "Value": "1" @@ -591,6 +671,14 @@ "Key": "Name", "Value": "master-us-test-1c.masters.mixedinstances.example.com" }, + { + "Key": "k8s.io/cluster-autoscaler/node-template/label/kubernetes.io/role", + "Value": "master" + }, + { + "Key": "k8s.io/cluster-autoscaler/node-template/label/node-role.kubernetes.io/master", + "Value": "" + }, { "Key": "k8s.io/role/master", "Value": "1" @@ -657,6 +745,14 @@ "Key": "Name", "Value": "nodes.mixedinstances.example.com" }, + { + "Key": "k8s.io/cluster-autoscaler/node-template/label/kubernetes.io/role", + "Value": "node" + }, + { + "Key": "k8s.io/cluster-autoscaler/node-template/label/node-role.kubernetes.io/node", + "Value": "" + }, { "Key": "k8s.io/role/node", "Value": "1" @@ -682,6 +778,14 @@ "Key": "Name", "Value": "nodes.mixedinstances.example.com" }, + { + "Key": "k8s.io/cluster-autoscaler/node-template/label/kubernetes.io/role", + "Value": "node" + }, + { + "Key": "k8s.io/cluster-autoscaler/node-template/label/node-role.kubernetes.io/node", + "Value": "" + }, { "Key": "k8s.io/role/node", "Value": "1" diff --git a/tests/integration/update_cluster/mixed_instances/kubernetes.tf b/tests/integration/update_cluster/mixed_instances/kubernetes.tf index 58c46ec43ebe8..1705e8a7c84d2 100644 --- a/tests/integration/update_cluster/mixed_instances/kubernetes.tf +++ b/tests/integration/update_cluster/mixed_instances/kubernetes.tf @@ -110,6 +110,16 @@ resource "aws_autoscaling_group" "master-us-test-1a-masters-mixedinstances-examp propagate_at_launch = true value = "master-us-test-1a.masters.mixedinstances.example.com" } + tag { + key = "k8s.io/cluster-autoscaler/node-template/label/kubernetes.io/role" + propagate_at_launch = true + value = "master" + } + tag { + key = "k8s.io/cluster-autoscaler/node-template/label/node-role.kubernetes.io/master" + propagate_at_launch = true + value = "" + } tag { key = "k8s.io/role/master" propagate_at_launch = true @@ -148,6 +158,16 @@ resource "aws_autoscaling_group" "master-us-test-1b-masters-mixedinstances-examp propagate_at_launch = true value = "master-us-test-1b.masters.mixedinstances.example.com" } + tag { + key = "k8s.io/cluster-autoscaler/node-template/label/kubernetes.io/role" + propagate_at_launch = true + value = "master" + } + tag { + key = "k8s.io/cluster-autoscaler/node-template/label/node-role.kubernetes.io/master" + propagate_at_launch = true + value = "" + } tag { key = "k8s.io/role/master" propagate_at_launch = true @@ -186,6 +206,16 @@ resource "aws_autoscaling_group" "master-us-test-1c-masters-mixedinstances-examp propagate_at_launch = true value = "master-us-test-1c.masters.mixedinstances.example.com" } + tag { + key = "k8s.io/cluster-autoscaler/node-template/label/kubernetes.io/role" + propagate_at_launch = true + value = "master" + } + tag { + key = "k8s.io/cluster-autoscaler/node-template/label/node-role.kubernetes.io/master" + propagate_at_launch = true + value = "" + } tag { key = "k8s.io/role/master" propagate_at_launch = true @@ -242,6 +272,16 @@ resource "aws_autoscaling_group" "nodes-mixedinstances-example-com" { propagate_at_launch = true value = "nodes.mixedinstances.example.com" } + tag { + key = "k8s.io/cluster-autoscaler/node-template/label/kubernetes.io/role" + propagate_at_launch = true + value = "node" + } + tag { + key = "k8s.io/cluster-autoscaler/node-template/label/node-role.kubernetes.io/node" + propagate_at_launch = true + value = "" + } tag { key = "k8s.io/role/node" propagate_at_launch = true @@ -426,21 +466,25 @@ resource "aws_launch_template" "master-us-test-1a-masters-mixedinstances-example tag_specifications { resource_type = "instance" tags = { - "KubernetesCluster" = "mixedinstances.example.com" - "Name" = "master-us-test-1a.masters.mixedinstances.example.com" - "k8s.io/role/master" = "1" - "kops.k8s.io/instancegroup" = "master-us-test-1a" - "kubernetes.io/cluster/mixedinstances.example.com" = "owned" + "KubernetesCluster" = "mixedinstances.example.com" + "Name" = "master-us-test-1a.masters.mixedinstances.example.com" + "k8s.io/cluster-autoscaler/node-template/label/kubernetes.io/role" = "master" + "k8s.io/cluster-autoscaler/node-template/label/node-role.kubernetes.io/master" = "" + "k8s.io/role/master" = "1" + "kops.k8s.io/instancegroup" = "master-us-test-1a" + "kubernetes.io/cluster/mixedinstances.example.com" = "owned" } } tag_specifications { resource_type = "volume" tags = { - "KubernetesCluster" = "mixedinstances.example.com" - "Name" = "master-us-test-1a.masters.mixedinstances.example.com" - "k8s.io/role/master" = "1" - "kops.k8s.io/instancegroup" = "master-us-test-1a" - "kubernetes.io/cluster/mixedinstances.example.com" = "owned" + "KubernetesCluster" = "mixedinstances.example.com" + "Name" = "master-us-test-1a.masters.mixedinstances.example.com" + "k8s.io/cluster-autoscaler/node-template/label/kubernetes.io/role" = "master" + "k8s.io/cluster-autoscaler/node-template/label/node-role.kubernetes.io/master" = "" + "k8s.io/role/master" = "1" + "kops.k8s.io/instancegroup" = "master-us-test-1a" + "kubernetes.io/cluster/mixedinstances.example.com" = "owned" } } user_data = filebase64("${path.module}/data/aws_launch_template_master-us-test-1a.masters.mixedinstances.example.com_user_data") @@ -477,21 +521,25 @@ resource "aws_launch_template" "master-us-test-1b-masters-mixedinstances-example tag_specifications { resource_type = "instance" tags = { - "KubernetesCluster" = "mixedinstances.example.com" - "Name" = "master-us-test-1b.masters.mixedinstances.example.com" - "k8s.io/role/master" = "1" - "kops.k8s.io/instancegroup" = "master-us-test-1b" - "kubernetes.io/cluster/mixedinstances.example.com" = "owned" + "KubernetesCluster" = "mixedinstances.example.com" + "Name" = "master-us-test-1b.masters.mixedinstances.example.com" + "k8s.io/cluster-autoscaler/node-template/label/kubernetes.io/role" = "master" + "k8s.io/cluster-autoscaler/node-template/label/node-role.kubernetes.io/master" = "" + "k8s.io/role/master" = "1" + "kops.k8s.io/instancegroup" = "master-us-test-1b" + "kubernetes.io/cluster/mixedinstances.example.com" = "owned" } } tag_specifications { resource_type = "volume" tags = { - "KubernetesCluster" = "mixedinstances.example.com" - "Name" = "master-us-test-1b.masters.mixedinstances.example.com" - "k8s.io/role/master" = "1" - "kops.k8s.io/instancegroup" = "master-us-test-1b" - "kubernetes.io/cluster/mixedinstances.example.com" = "owned" + "KubernetesCluster" = "mixedinstances.example.com" + "Name" = "master-us-test-1b.masters.mixedinstances.example.com" + "k8s.io/cluster-autoscaler/node-template/label/kubernetes.io/role" = "master" + "k8s.io/cluster-autoscaler/node-template/label/node-role.kubernetes.io/master" = "" + "k8s.io/role/master" = "1" + "kops.k8s.io/instancegroup" = "master-us-test-1b" + "kubernetes.io/cluster/mixedinstances.example.com" = "owned" } } user_data = filebase64("${path.module}/data/aws_launch_template_master-us-test-1b.masters.mixedinstances.example.com_user_data") @@ -528,21 +576,25 @@ resource "aws_launch_template" "master-us-test-1c-masters-mixedinstances-example tag_specifications { resource_type = "instance" tags = { - "KubernetesCluster" = "mixedinstances.example.com" - "Name" = "master-us-test-1c.masters.mixedinstances.example.com" - "k8s.io/role/master" = "1" - "kops.k8s.io/instancegroup" = "master-us-test-1c" - "kubernetes.io/cluster/mixedinstances.example.com" = "owned" + "KubernetesCluster" = "mixedinstances.example.com" + "Name" = "master-us-test-1c.masters.mixedinstances.example.com" + "k8s.io/cluster-autoscaler/node-template/label/kubernetes.io/role" = "master" + "k8s.io/cluster-autoscaler/node-template/label/node-role.kubernetes.io/master" = "" + "k8s.io/role/master" = "1" + "kops.k8s.io/instancegroup" = "master-us-test-1c" + "kubernetes.io/cluster/mixedinstances.example.com" = "owned" } } tag_specifications { resource_type = "volume" tags = { - "KubernetesCluster" = "mixedinstances.example.com" - "Name" = "master-us-test-1c.masters.mixedinstances.example.com" - "k8s.io/role/master" = "1" - "kops.k8s.io/instancegroup" = "master-us-test-1c" - "kubernetes.io/cluster/mixedinstances.example.com" = "owned" + "KubernetesCluster" = "mixedinstances.example.com" + "Name" = "master-us-test-1c.masters.mixedinstances.example.com" + "k8s.io/cluster-autoscaler/node-template/label/kubernetes.io/role" = "master" + "k8s.io/cluster-autoscaler/node-template/label/node-role.kubernetes.io/master" = "" + "k8s.io/role/master" = "1" + "kops.k8s.io/instancegroup" = "master-us-test-1c" + "kubernetes.io/cluster/mixedinstances.example.com" = "owned" } } user_data = filebase64("${path.module}/data/aws_launch_template_master-us-test-1c.masters.mixedinstances.example.com_user_data") @@ -575,21 +627,25 @@ resource "aws_launch_template" "nodes-mixedinstances-example-com" { tag_specifications { resource_type = "instance" tags = { - "KubernetesCluster" = "mixedinstances.example.com" - "Name" = "nodes.mixedinstances.example.com" - "k8s.io/role/node" = "1" - "kops.k8s.io/instancegroup" = "nodes" - "kubernetes.io/cluster/mixedinstances.example.com" = "owned" + "KubernetesCluster" = "mixedinstances.example.com" + "Name" = "nodes.mixedinstances.example.com" + "k8s.io/cluster-autoscaler/node-template/label/kubernetes.io/role" = "node" + "k8s.io/cluster-autoscaler/node-template/label/node-role.kubernetes.io/node" = "" + "k8s.io/role/node" = "1" + "kops.k8s.io/instancegroup" = "nodes" + "kubernetes.io/cluster/mixedinstances.example.com" = "owned" } } tag_specifications { resource_type = "volume" tags = { - "KubernetesCluster" = "mixedinstances.example.com" - "Name" = "nodes.mixedinstances.example.com" - "k8s.io/role/node" = "1" - "kops.k8s.io/instancegroup" = "nodes" - "kubernetes.io/cluster/mixedinstances.example.com" = "owned" + "KubernetesCluster" = "mixedinstances.example.com" + "Name" = "nodes.mixedinstances.example.com" + "k8s.io/cluster-autoscaler/node-template/label/kubernetes.io/role" = "node" + "k8s.io/cluster-autoscaler/node-template/label/node-role.kubernetes.io/node" = "" + "k8s.io/role/node" = "1" + "kops.k8s.io/instancegroup" = "nodes" + "kubernetes.io/cluster/mixedinstances.example.com" = "owned" } } user_data = filebase64("${path.module}/data/aws_launch_template_nodes.mixedinstances.example.com_user_data") diff --git a/tests/integration/update_cluster/mixed_instances_spot/cloudformation.json b/tests/integration/update_cluster/mixed_instances_spot/cloudformation.json index 3c844342fead7..3a93f2ec94555 100644 --- a/tests/integration/update_cluster/mixed_instances_spot/cloudformation.json +++ b/tests/integration/update_cluster/mixed_instances_spot/cloudformation.json @@ -33,6 +33,16 @@ "Value": "master-us-test-1a.masters.mixedinstances.example.com", "PropagateAtLaunch": true }, + { + "Key": "k8s.io/cluster-autoscaler/node-template/label/kubernetes.io/role", + "Value": "master", + "PropagateAtLaunch": true + }, + { + "Key": "k8s.io/cluster-autoscaler/node-template/label/node-role.kubernetes.io/master", + "Value": "", + "PropagateAtLaunch": true + }, { "Key": "k8s.io/role/master", "Value": "1", @@ -99,6 +109,16 @@ "Value": "master-us-test-1b.masters.mixedinstances.example.com", "PropagateAtLaunch": true }, + { + "Key": "k8s.io/cluster-autoscaler/node-template/label/kubernetes.io/role", + "Value": "master", + "PropagateAtLaunch": true + }, + { + "Key": "k8s.io/cluster-autoscaler/node-template/label/node-role.kubernetes.io/master", + "Value": "", + "PropagateAtLaunch": true + }, { "Key": "k8s.io/role/master", "Value": "1", @@ -165,6 +185,16 @@ "Value": "master-us-test-1c.masters.mixedinstances.example.com", "PropagateAtLaunch": true }, + { + "Key": "k8s.io/cluster-autoscaler/node-template/label/kubernetes.io/role", + "Value": "master", + "PropagateAtLaunch": true + }, + { + "Key": "k8s.io/cluster-autoscaler/node-template/label/node-role.kubernetes.io/master", + "Value": "", + "PropagateAtLaunch": true + }, { "Key": "k8s.io/role/master", "Value": "1", @@ -220,6 +250,16 @@ "Value": "nodes.mixedinstances.example.com", "PropagateAtLaunch": true }, + { + "Key": "k8s.io/cluster-autoscaler/node-template/label/kubernetes.io/role", + "Value": "node", + "PropagateAtLaunch": true + }, + { + "Key": "k8s.io/cluster-autoscaler/node-template/label/node-role.kubernetes.io/node", + "Value": "", + "PropagateAtLaunch": true + }, { "Key": "k8s.io/role/node", "Value": "1", @@ -377,6 +417,14 @@ "Key": "Name", "Value": "master-us-test-1a.masters.mixedinstances.example.com" }, + { + "Key": "k8s.io/cluster-autoscaler/node-template/label/kubernetes.io/role", + "Value": "master" + }, + { + "Key": "k8s.io/cluster-autoscaler/node-template/label/node-role.kubernetes.io/master", + "Value": "" + }, { "Key": "k8s.io/role/master", "Value": "1" @@ -402,6 +450,14 @@ "Key": "Name", "Value": "master-us-test-1a.masters.mixedinstances.example.com" }, + { + "Key": "k8s.io/cluster-autoscaler/node-template/label/kubernetes.io/role", + "Value": "master" + }, + { + "Key": "k8s.io/cluster-autoscaler/node-template/label/node-role.kubernetes.io/master", + "Value": "" + }, { "Key": "k8s.io/role/master", "Value": "1" @@ -472,6 +528,14 @@ "Key": "Name", "Value": "master-us-test-1b.masters.mixedinstances.example.com" }, + { + "Key": "k8s.io/cluster-autoscaler/node-template/label/kubernetes.io/role", + "Value": "master" + }, + { + "Key": "k8s.io/cluster-autoscaler/node-template/label/node-role.kubernetes.io/master", + "Value": "" + }, { "Key": "k8s.io/role/master", "Value": "1" @@ -497,6 +561,14 @@ "Key": "Name", "Value": "master-us-test-1b.masters.mixedinstances.example.com" }, + { + "Key": "k8s.io/cluster-autoscaler/node-template/label/kubernetes.io/role", + "Value": "master" + }, + { + "Key": "k8s.io/cluster-autoscaler/node-template/label/node-role.kubernetes.io/master", + "Value": "" + }, { "Key": "k8s.io/role/master", "Value": "1" @@ -567,6 +639,14 @@ "Key": "Name", "Value": "master-us-test-1c.masters.mixedinstances.example.com" }, + { + "Key": "k8s.io/cluster-autoscaler/node-template/label/kubernetes.io/role", + "Value": "master" + }, + { + "Key": "k8s.io/cluster-autoscaler/node-template/label/node-role.kubernetes.io/master", + "Value": "" + }, { "Key": "k8s.io/role/master", "Value": "1" @@ -592,6 +672,14 @@ "Key": "Name", "Value": "master-us-test-1c.masters.mixedinstances.example.com" }, + { + "Key": "k8s.io/cluster-autoscaler/node-template/label/kubernetes.io/role", + "Value": "master" + }, + { + "Key": "k8s.io/cluster-autoscaler/node-template/label/node-role.kubernetes.io/master", + "Value": "" + }, { "Key": "k8s.io/role/master", "Value": "1" @@ -658,6 +746,14 @@ "Key": "Name", "Value": "nodes.mixedinstances.example.com" }, + { + "Key": "k8s.io/cluster-autoscaler/node-template/label/kubernetes.io/role", + "Value": "node" + }, + { + "Key": "k8s.io/cluster-autoscaler/node-template/label/node-role.kubernetes.io/node", + "Value": "" + }, { "Key": "k8s.io/role/node", "Value": "1" @@ -683,6 +779,14 @@ "Key": "Name", "Value": "nodes.mixedinstances.example.com" }, + { + "Key": "k8s.io/cluster-autoscaler/node-template/label/kubernetes.io/role", + "Value": "node" + }, + { + "Key": "k8s.io/cluster-autoscaler/node-template/label/node-role.kubernetes.io/node", + "Value": "" + }, { "Key": "k8s.io/role/node", "Value": "1" diff --git a/tests/integration/update_cluster/mixed_instances_spot/kubernetes.tf b/tests/integration/update_cluster/mixed_instances_spot/kubernetes.tf index f430a7a9b0157..403bf1c21399b 100644 --- a/tests/integration/update_cluster/mixed_instances_spot/kubernetes.tf +++ b/tests/integration/update_cluster/mixed_instances_spot/kubernetes.tf @@ -110,6 +110,16 @@ resource "aws_autoscaling_group" "master-us-test-1a-masters-mixedinstances-examp propagate_at_launch = true value = "master-us-test-1a.masters.mixedinstances.example.com" } + tag { + key = "k8s.io/cluster-autoscaler/node-template/label/kubernetes.io/role" + propagate_at_launch = true + value = "master" + } + tag { + key = "k8s.io/cluster-autoscaler/node-template/label/node-role.kubernetes.io/master" + propagate_at_launch = true + value = "" + } tag { key = "k8s.io/role/master" propagate_at_launch = true @@ -148,6 +158,16 @@ resource "aws_autoscaling_group" "master-us-test-1b-masters-mixedinstances-examp propagate_at_launch = true value = "master-us-test-1b.masters.mixedinstances.example.com" } + tag { + key = "k8s.io/cluster-autoscaler/node-template/label/kubernetes.io/role" + propagate_at_launch = true + value = "master" + } + tag { + key = "k8s.io/cluster-autoscaler/node-template/label/node-role.kubernetes.io/master" + propagate_at_launch = true + value = "" + } tag { key = "k8s.io/role/master" propagate_at_launch = true @@ -186,6 +206,16 @@ resource "aws_autoscaling_group" "master-us-test-1c-masters-mixedinstances-examp propagate_at_launch = true value = "master-us-test-1c.masters.mixedinstances.example.com" } + tag { + key = "k8s.io/cluster-autoscaler/node-template/label/kubernetes.io/role" + propagate_at_launch = true + value = "master" + } + tag { + key = "k8s.io/cluster-autoscaler/node-template/label/node-role.kubernetes.io/master" + propagate_at_launch = true + value = "" + } tag { key = "k8s.io/role/master" propagate_at_launch = true @@ -242,6 +272,16 @@ resource "aws_autoscaling_group" "nodes-mixedinstances-example-com" { propagate_at_launch = true value = "nodes.mixedinstances.example.com" } + tag { + key = "k8s.io/cluster-autoscaler/node-template/label/kubernetes.io/role" + propagate_at_launch = true + value = "node" + } + tag { + key = "k8s.io/cluster-autoscaler/node-template/label/node-role.kubernetes.io/node" + propagate_at_launch = true + value = "" + } tag { key = "k8s.io/role/node" propagate_at_launch = true @@ -426,21 +466,25 @@ resource "aws_launch_template" "master-us-test-1a-masters-mixedinstances-example tag_specifications { resource_type = "instance" tags = { - "KubernetesCluster" = "mixedinstances.example.com" - "Name" = "master-us-test-1a.masters.mixedinstances.example.com" - "k8s.io/role/master" = "1" - "kops.k8s.io/instancegroup" = "master-us-test-1a" - "kubernetes.io/cluster/mixedinstances.example.com" = "owned" + "KubernetesCluster" = "mixedinstances.example.com" + "Name" = "master-us-test-1a.masters.mixedinstances.example.com" + "k8s.io/cluster-autoscaler/node-template/label/kubernetes.io/role" = "master" + "k8s.io/cluster-autoscaler/node-template/label/node-role.kubernetes.io/master" = "" + "k8s.io/role/master" = "1" + "kops.k8s.io/instancegroup" = "master-us-test-1a" + "kubernetes.io/cluster/mixedinstances.example.com" = "owned" } } tag_specifications { resource_type = "volume" tags = { - "KubernetesCluster" = "mixedinstances.example.com" - "Name" = "master-us-test-1a.masters.mixedinstances.example.com" - "k8s.io/role/master" = "1" - "kops.k8s.io/instancegroup" = "master-us-test-1a" - "kubernetes.io/cluster/mixedinstances.example.com" = "owned" + "KubernetesCluster" = "mixedinstances.example.com" + "Name" = "master-us-test-1a.masters.mixedinstances.example.com" + "k8s.io/cluster-autoscaler/node-template/label/kubernetes.io/role" = "master" + "k8s.io/cluster-autoscaler/node-template/label/node-role.kubernetes.io/master" = "" + "k8s.io/role/master" = "1" + "kops.k8s.io/instancegroup" = "master-us-test-1a" + "kubernetes.io/cluster/mixedinstances.example.com" = "owned" } } user_data = filebase64("${path.module}/data/aws_launch_template_master-us-test-1a.masters.mixedinstances.example.com_user_data") @@ -477,21 +521,25 @@ resource "aws_launch_template" "master-us-test-1b-masters-mixedinstances-example tag_specifications { resource_type = "instance" tags = { - "KubernetesCluster" = "mixedinstances.example.com" - "Name" = "master-us-test-1b.masters.mixedinstances.example.com" - "k8s.io/role/master" = "1" - "kops.k8s.io/instancegroup" = "master-us-test-1b" - "kubernetes.io/cluster/mixedinstances.example.com" = "owned" + "KubernetesCluster" = "mixedinstances.example.com" + "Name" = "master-us-test-1b.masters.mixedinstances.example.com" + "k8s.io/cluster-autoscaler/node-template/label/kubernetes.io/role" = "master" + "k8s.io/cluster-autoscaler/node-template/label/node-role.kubernetes.io/master" = "" + "k8s.io/role/master" = "1" + "kops.k8s.io/instancegroup" = "master-us-test-1b" + "kubernetes.io/cluster/mixedinstances.example.com" = "owned" } } tag_specifications { resource_type = "volume" tags = { - "KubernetesCluster" = "mixedinstances.example.com" - "Name" = "master-us-test-1b.masters.mixedinstances.example.com" - "k8s.io/role/master" = "1" - "kops.k8s.io/instancegroup" = "master-us-test-1b" - "kubernetes.io/cluster/mixedinstances.example.com" = "owned" + "KubernetesCluster" = "mixedinstances.example.com" + "Name" = "master-us-test-1b.masters.mixedinstances.example.com" + "k8s.io/cluster-autoscaler/node-template/label/kubernetes.io/role" = "master" + "k8s.io/cluster-autoscaler/node-template/label/node-role.kubernetes.io/master" = "" + "k8s.io/role/master" = "1" + "kops.k8s.io/instancegroup" = "master-us-test-1b" + "kubernetes.io/cluster/mixedinstances.example.com" = "owned" } } user_data = filebase64("${path.module}/data/aws_launch_template_master-us-test-1b.masters.mixedinstances.example.com_user_data") @@ -528,21 +576,25 @@ resource "aws_launch_template" "master-us-test-1c-masters-mixedinstances-example tag_specifications { resource_type = "instance" tags = { - "KubernetesCluster" = "mixedinstances.example.com" - "Name" = "master-us-test-1c.masters.mixedinstances.example.com" - "k8s.io/role/master" = "1" - "kops.k8s.io/instancegroup" = "master-us-test-1c" - "kubernetes.io/cluster/mixedinstances.example.com" = "owned" + "KubernetesCluster" = "mixedinstances.example.com" + "Name" = "master-us-test-1c.masters.mixedinstances.example.com" + "k8s.io/cluster-autoscaler/node-template/label/kubernetes.io/role" = "master" + "k8s.io/cluster-autoscaler/node-template/label/node-role.kubernetes.io/master" = "" + "k8s.io/role/master" = "1" + "kops.k8s.io/instancegroup" = "master-us-test-1c" + "kubernetes.io/cluster/mixedinstances.example.com" = "owned" } } tag_specifications { resource_type = "volume" tags = { - "KubernetesCluster" = "mixedinstances.example.com" - "Name" = "master-us-test-1c.masters.mixedinstances.example.com" - "k8s.io/role/master" = "1" - "kops.k8s.io/instancegroup" = "master-us-test-1c" - "kubernetes.io/cluster/mixedinstances.example.com" = "owned" + "KubernetesCluster" = "mixedinstances.example.com" + "Name" = "master-us-test-1c.masters.mixedinstances.example.com" + "k8s.io/cluster-autoscaler/node-template/label/kubernetes.io/role" = "master" + "k8s.io/cluster-autoscaler/node-template/label/node-role.kubernetes.io/master" = "" + "k8s.io/role/master" = "1" + "kops.k8s.io/instancegroup" = "master-us-test-1c" + "kubernetes.io/cluster/mixedinstances.example.com" = "owned" } } user_data = filebase64("${path.module}/data/aws_launch_template_master-us-test-1c.masters.mixedinstances.example.com_user_data") @@ -575,21 +627,25 @@ resource "aws_launch_template" "nodes-mixedinstances-example-com" { tag_specifications { resource_type = "instance" tags = { - "KubernetesCluster" = "mixedinstances.example.com" - "Name" = "nodes.mixedinstances.example.com" - "k8s.io/role/node" = "1" - "kops.k8s.io/instancegroup" = "nodes" - "kubernetes.io/cluster/mixedinstances.example.com" = "owned" + "KubernetesCluster" = "mixedinstances.example.com" + "Name" = "nodes.mixedinstances.example.com" + "k8s.io/cluster-autoscaler/node-template/label/kubernetes.io/role" = "node" + "k8s.io/cluster-autoscaler/node-template/label/node-role.kubernetes.io/node" = "" + "k8s.io/role/node" = "1" + "kops.k8s.io/instancegroup" = "nodes" + "kubernetes.io/cluster/mixedinstances.example.com" = "owned" } } tag_specifications { resource_type = "volume" tags = { - "KubernetesCluster" = "mixedinstances.example.com" - "Name" = "nodes.mixedinstances.example.com" - "k8s.io/role/node" = "1" - "kops.k8s.io/instancegroup" = "nodes" - "kubernetes.io/cluster/mixedinstances.example.com" = "owned" + "KubernetesCluster" = "mixedinstances.example.com" + "Name" = "nodes.mixedinstances.example.com" + "k8s.io/cluster-autoscaler/node-template/label/kubernetes.io/role" = "node" + "k8s.io/cluster-autoscaler/node-template/label/node-role.kubernetes.io/node" = "" + "k8s.io/role/node" = "1" + "kops.k8s.io/instancegroup" = "nodes" + "kubernetes.io/cluster/mixedinstances.example.com" = "owned" } } user_data = filebase64("${path.module}/data/aws_launch_template_nodes.mixedinstances.example.com_user_data") diff --git a/tests/integration/update_cluster/private-shared-subnet/kubernetes.tf b/tests/integration/update_cluster/private-shared-subnet/kubernetes.tf index bd5743d4f9d6a..9f7931b26c350 100644 --- a/tests/integration/update_cluster/private-shared-subnet/kubernetes.tf +++ b/tests/integration/update_cluster/private-shared-subnet/kubernetes.tf @@ -130,6 +130,16 @@ resource "aws_autoscaling_group" "bastion-private-shared-subnet-example-com" { propagate_at_launch = true value = "bastion.private-shared-subnet.example.com" } + tag { + key = "k8s.io/cluster-autoscaler/node-template/label/kubernetes.io/role" + propagate_at_launch = true + value = "node" + } + tag { + key = "k8s.io/cluster-autoscaler/node-template/label/node-role.kubernetes.io/node" + propagate_at_launch = true + value = "" + } tag { key = "k8s.io/role/bastion" propagate_at_launch = true @@ -168,6 +178,16 @@ resource "aws_autoscaling_group" "master-us-test-1a-masters-private-shared-subne propagate_at_launch = true value = "master-us-test-1a.masters.private-shared-subnet.example.com" } + tag { + key = "k8s.io/cluster-autoscaler/node-template/label/kubernetes.io/role" + propagate_at_launch = true + value = "master" + } + tag { + key = "k8s.io/cluster-autoscaler/node-template/label/node-role.kubernetes.io/master" + propagate_at_launch = true + value = "" + } tag { key = "k8s.io/role/master" propagate_at_launch = true @@ -206,6 +226,16 @@ resource "aws_autoscaling_group" "nodes-private-shared-subnet-example-com" { propagate_at_launch = true value = "nodes.private-shared-subnet.example.com" } + tag { + key = "k8s.io/cluster-autoscaler/node-template/label/kubernetes.io/role" + propagate_at_launch = true + value = "node" + } + tag { + key = "k8s.io/cluster-autoscaler/node-template/label/node-role.kubernetes.io/node" + propagate_at_launch = true + value = "" + } tag { key = "k8s.io/role/node" propagate_at_launch = true @@ -390,21 +420,25 @@ resource "aws_launch_template" "bastion-private-shared-subnet-example-com" { tag_specifications { resource_type = "instance" tags = { - "KubernetesCluster" = "private-shared-subnet.example.com" - "Name" = "bastion.private-shared-subnet.example.com" - "k8s.io/role/bastion" = "1" - "kops.k8s.io/instancegroup" = "bastion" - "kubernetes.io/cluster/private-shared-subnet.example.com" = "owned" + "KubernetesCluster" = "private-shared-subnet.example.com" + "Name" = "bastion.private-shared-subnet.example.com" + "k8s.io/cluster-autoscaler/node-template/label/kubernetes.io/role" = "node" + "k8s.io/cluster-autoscaler/node-template/label/node-role.kubernetes.io/node" = "" + "k8s.io/role/bastion" = "1" + "kops.k8s.io/instancegroup" = "bastion" + "kubernetes.io/cluster/private-shared-subnet.example.com" = "owned" } } tag_specifications { resource_type = "volume" tags = { - "KubernetesCluster" = "private-shared-subnet.example.com" - "Name" = "bastion.private-shared-subnet.example.com" - "k8s.io/role/bastion" = "1" - "kops.k8s.io/instancegroup" = "bastion" - "kubernetes.io/cluster/private-shared-subnet.example.com" = "owned" + "KubernetesCluster" = "private-shared-subnet.example.com" + "Name" = "bastion.private-shared-subnet.example.com" + "k8s.io/cluster-autoscaler/node-template/label/kubernetes.io/role" = "node" + "k8s.io/cluster-autoscaler/node-template/label/node-role.kubernetes.io/node" = "" + "k8s.io/role/bastion" = "1" + "kops.k8s.io/instancegroup" = "bastion" + "kubernetes.io/cluster/private-shared-subnet.example.com" = "owned" } } } @@ -440,21 +474,25 @@ resource "aws_launch_template" "master-us-test-1a-masters-private-shared-subnet- tag_specifications { resource_type = "instance" tags = { - "KubernetesCluster" = "private-shared-subnet.example.com" - "Name" = "master-us-test-1a.masters.private-shared-subnet.example.com" - "k8s.io/role/master" = "1" - "kops.k8s.io/instancegroup" = "master-us-test-1a" - "kubernetes.io/cluster/private-shared-subnet.example.com" = "owned" + "KubernetesCluster" = "private-shared-subnet.example.com" + "Name" = "master-us-test-1a.masters.private-shared-subnet.example.com" + "k8s.io/cluster-autoscaler/node-template/label/kubernetes.io/role" = "master" + "k8s.io/cluster-autoscaler/node-template/label/node-role.kubernetes.io/master" = "" + "k8s.io/role/master" = "1" + "kops.k8s.io/instancegroup" = "master-us-test-1a" + "kubernetes.io/cluster/private-shared-subnet.example.com" = "owned" } } tag_specifications { resource_type = "volume" tags = { - "KubernetesCluster" = "private-shared-subnet.example.com" - "Name" = "master-us-test-1a.masters.private-shared-subnet.example.com" - "k8s.io/role/master" = "1" - "kops.k8s.io/instancegroup" = "master-us-test-1a" - "kubernetes.io/cluster/private-shared-subnet.example.com" = "owned" + "KubernetesCluster" = "private-shared-subnet.example.com" + "Name" = "master-us-test-1a.masters.private-shared-subnet.example.com" + "k8s.io/cluster-autoscaler/node-template/label/kubernetes.io/role" = "master" + "k8s.io/cluster-autoscaler/node-template/label/node-role.kubernetes.io/master" = "" + "k8s.io/role/master" = "1" + "kops.k8s.io/instancegroup" = "master-us-test-1a" + "kubernetes.io/cluster/private-shared-subnet.example.com" = "owned" } } user_data = filebase64("${path.module}/data/aws_launch_template_master-us-test-1a.masters.private-shared-subnet.example.com_user_data") @@ -487,21 +525,25 @@ resource "aws_launch_template" "nodes-private-shared-subnet-example-com" { tag_specifications { resource_type = "instance" tags = { - "KubernetesCluster" = "private-shared-subnet.example.com" - "Name" = "nodes.private-shared-subnet.example.com" - "k8s.io/role/node" = "1" - "kops.k8s.io/instancegroup" = "nodes" - "kubernetes.io/cluster/private-shared-subnet.example.com" = "owned" + "KubernetesCluster" = "private-shared-subnet.example.com" + "Name" = "nodes.private-shared-subnet.example.com" + "k8s.io/cluster-autoscaler/node-template/label/kubernetes.io/role" = "node" + "k8s.io/cluster-autoscaler/node-template/label/node-role.kubernetes.io/node" = "" + "k8s.io/role/node" = "1" + "kops.k8s.io/instancegroup" = "nodes" + "kubernetes.io/cluster/private-shared-subnet.example.com" = "owned" } } tag_specifications { resource_type = "volume" tags = { - "KubernetesCluster" = "private-shared-subnet.example.com" - "Name" = "nodes.private-shared-subnet.example.com" - "k8s.io/role/node" = "1" - "kops.k8s.io/instancegroup" = "nodes" - "kubernetes.io/cluster/private-shared-subnet.example.com" = "owned" + "KubernetesCluster" = "private-shared-subnet.example.com" + "Name" = "nodes.private-shared-subnet.example.com" + "k8s.io/cluster-autoscaler/node-template/label/kubernetes.io/role" = "node" + "k8s.io/cluster-autoscaler/node-template/label/node-role.kubernetes.io/node" = "" + "k8s.io/role/node" = "1" + "kops.k8s.io/instancegroup" = "nodes" + "kubernetes.io/cluster/private-shared-subnet.example.com" = "owned" } } user_data = filebase64("${path.module}/data/aws_launch_template_nodes.private-shared-subnet.example.com_user_data") diff --git a/tests/integration/update_cluster/privatecalico/cloudformation.json b/tests/integration/update_cluster/privatecalico/cloudformation.json index c9cdba0c12866..15e66c365d989 100644 --- a/tests/integration/update_cluster/privatecalico/cloudformation.json +++ b/tests/integration/update_cluster/privatecalico/cloudformation.json @@ -33,6 +33,16 @@ "Value": "bastion.privatecalico.example.com", "PropagateAtLaunch": true }, + { + "Key": "k8s.io/cluster-autoscaler/node-template/label/kubernetes.io/role", + "Value": "node", + "PropagateAtLaunch": true + }, + { + "Key": "k8s.io/cluster-autoscaler/node-template/label/node-role.kubernetes.io/node", + "Value": "", + "PropagateAtLaunch": true + }, { "Key": "k8s.io/role/bastion", "Value": "1", @@ -104,6 +114,16 @@ "Value": "master-us-test-1a.masters.privatecalico.example.com", "PropagateAtLaunch": true }, + { + "Key": "k8s.io/cluster-autoscaler/node-template/label/kubernetes.io/role", + "Value": "master", + "PropagateAtLaunch": true + }, + { + "Key": "k8s.io/cluster-autoscaler/node-template/label/node-role.kubernetes.io/master", + "Value": "", + "PropagateAtLaunch": true + }, { "Key": "k8s.io/role/master", "Value": "1", @@ -175,6 +195,16 @@ "Value": "nodes.privatecalico.example.com", "PropagateAtLaunch": true }, + { + "Key": "k8s.io/cluster-autoscaler/node-template/label/kubernetes.io/role", + "Value": "node", + "PropagateAtLaunch": true + }, + { + "Key": "k8s.io/cluster-autoscaler/node-template/label/node-role.kubernetes.io/node", + "Value": "", + "PropagateAtLaunch": true + }, { "Key": "k8s.io/role/node", "Value": "1", @@ -317,6 +347,14 @@ "Key": "Name", "Value": "bastion.privatecalico.example.com" }, + { + "Key": "k8s.io/cluster-autoscaler/node-template/label/kubernetes.io/role", + "Value": "node" + }, + { + "Key": "k8s.io/cluster-autoscaler/node-template/label/node-role.kubernetes.io/node", + "Value": "" + }, { "Key": "k8s.io/role/bastion", "Value": "1" @@ -342,6 +380,14 @@ "Key": "Name", "Value": "bastion.privatecalico.example.com" }, + { + "Key": "k8s.io/cluster-autoscaler/node-template/label/kubernetes.io/role", + "Value": "node" + }, + { + "Key": "k8s.io/cluster-autoscaler/node-template/label/node-role.kubernetes.io/node", + "Value": "" + }, { "Key": "k8s.io/role/bastion", "Value": "1" @@ -412,6 +458,14 @@ "Key": "Name", "Value": "master-us-test-1a.masters.privatecalico.example.com" }, + { + "Key": "k8s.io/cluster-autoscaler/node-template/label/kubernetes.io/role", + "Value": "master" + }, + { + "Key": "k8s.io/cluster-autoscaler/node-template/label/node-role.kubernetes.io/master", + "Value": "" + }, { "Key": "k8s.io/role/master", "Value": "1" @@ -437,6 +491,14 @@ "Key": "Name", "Value": "master-us-test-1a.masters.privatecalico.example.com" }, + { + "Key": "k8s.io/cluster-autoscaler/node-template/label/kubernetes.io/role", + "Value": "master" + }, + { + "Key": "k8s.io/cluster-autoscaler/node-template/label/node-role.kubernetes.io/master", + "Value": "" + }, { "Key": "k8s.io/role/master", "Value": "1" @@ -503,6 +565,14 @@ "Key": "Name", "Value": "nodes.privatecalico.example.com" }, + { + "Key": "k8s.io/cluster-autoscaler/node-template/label/kubernetes.io/role", + "Value": "node" + }, + { + "Key": "k8s.io/cluster-autoscaler/node-template/label/node-role.kubernetes.io/node", + "Value": "" + }, { "Key": "k8s.io/role/node", "Value": "1" @@ -528,6 +598,14 @@ "Key": "Name", "Value": "nodes.privatecalico.example.com" }, + { + "Key": "k8s.io/cluster-autoscaler/node-template/label/kubernetes.io/role", + "Value": "node" + }, + { + "Key": "k8s.io/cluster-autoscaler/node-template/label/node-role.kubernetes.io/node", + "Value": "" + }, { "Key": "k8s.io/role/node", "Value": "1" diff --git a/tests/integration/update_cluster/privatecalico/kubernetes.tf b/tests/integration/update_cluster/privatecalico/kubernetes.tf index fa8e0c35d72e3..89fa03c96689f 100644 --- a/tests/integration/update_cluster/privatecalico/kubernetes.tf +++ b/tests/integration/update_cluster/privatecalico/kubernetes.tf @@ -140,6 +140,16 @@ resource "aws_autoscaling_group" "bastion-privatecalico-example-com" { propagate_at_launch = true value = "bastion.privatecalico.example.com" } + tag { + key = "k8s.io/cluster-autoscaler/node-template/label/kubernetes.io/role" + propagate_at_launch = true + value = "node" + } + tag { + key = "k8s.io/cluster-autoscaler/node-template/label/node-role.kubernetes.io/node" + propagate_at_launch = true + value = "" + } tag { key = "k8s.io/role/bastion" propagate_at_launch = true @@ -178,6 +188,16 @@ resource "aws_autoscaling_group" "master-us-test-1a-masters-privatecalico-exampl propagate_at_launch = true value = "master-us-test-1a.masters.privatecalico.example.com" } + tag { + key = "k8s.io/cluster-autoscaler/node-template/label/kubernetes.io/role" + propagate_at_launch = true + value = "master" + } + tag { + key = "k8s.io/cluster-autoscaler/node-template/label/node-role.kubernetes.io/master" + propagate_at_launch = true + value = "" + } tag { key = "k8s.io/role/master" propagate_at_launch = true @@ -216,6 +236,16 @@ resource "aws_autoscaling_group" "nodes-privatecalico-example-com" { propagate_at_launch = true value = "nodes.privatecalico.example.com" } + tag { + key = "k8s.io/cluster-autoscaler/node-template/label/kubernetes.io/role" + propagate_at_launch = true + value = "node" + } + tag { + key = "k8s.io/cluster-autoscaler/node-template/label/node-role.kubernetes.io/node" + propagate_at_launch = true + value = "" + } tag { key = "k8s.io/role/node" propagate_at_launch = true @@ -418,21 +448,25 @@ resource "aws_launch_template" "bastion-privatecalico-example-com" { tag_specifications { resource_type = "instance" tags = { - "KubernetesCluster" = "privatecalico.example.com" - "Name" = "bastion.privatecalico.example.com" - "k8s.io/role/bastion" = "1" - "kops.k8s.io/instancegroup" = "bastion" - "kubernetes.io/cluster/privatecalico.example.com" = "owned" + "KubernetesCluster" = "privatecalico.example.com" + "Name" = "bastion.privatecalico.example.com" + "k8s.io/cluster-autoscaler/node-template/label/kubernetes.io/role" = "node" + "k8s.io/cluster-autoscaler/node-template/label/node-role.kubernetes.io/node" = "" + "k8s.io/role/bastion" = "1" + "kops.k8s.io/instancegroup" = "bastion" + "kubernetes.io/cluster/privatecalico.example.com" = "owned" } } tag_specifications { resource_type = "volume" tags = { - "KubernetesCluster" = "privatecalico.example.com" - "Name" = "bastion.privatecalico.example.com" - "k8s.io/role/bastion" = "1" - "kops.k8s.io/instancegroup" = "bastion" - "kubernetes.io/cluster/privatecalico.example.com" = "owned" + "KubernetesCluster" = "privatecalico.example.com" + "Name" = "bastion.privatecalico.example.com" + "k8s.io/cluster-autoscaler/node-template/label/kubernetes.io/role" = "node" + "k8s.io/cluster-autoscaler/node-template/label/node-role.kubernetes.io/node" = "" + "k8s.io/role/bastion" = "1" + "kops.k8s.io/instancegroup" = "bastion" + "kubernetes.io/cluster/privatecalico.example.com" = "owned" } } } @@ -468,21 +502,25 @@ resource "aws_launch_template" "master-us-test-1a-masters-privatecalico-example- tag_specifications { resource_type = "instance" tags = { - "KubernetesCluster" = "privatecalico.example.com" - "Name" = "master-us-test-1a.masters.privatecalico.example.com" - "k8s.io/role/master" = "1" - "kops.k8s.io/instancegroup" = "master-us-test-1a" - "kubernetes.io/cluster/privatecalico.example.com" = "owned" + "KubernetesCluster" = "privatecalico.example.com" + "Name" = "master-us-test-1a.masters.privatecalico.example.com" + "k8s.io/cluster-autoscaler/node-template/label/kubernetes.io/role" = "master" + "k8s.io/cluster-autoscaler/node-template/label/node-role.kubernetes.io/master" = "" + "k8s.io/role/master" = "1" + "kops.k8s.io/instancegroup" = "master-us-test-1a" + "kubernetes.io/cluster/privatecalico.example.com" = "owned" } } tag_specifications { resource_type = "volume" tags = { - "KubernetesCluster" = "privatecalico.example.com" - "Name" = "master-us-test-1a.masters.privatecalico.example.com" - "k8s.io/role/master" = "1" - "kops.k8s.io/instancegroup" = "master-us-test-1a" - "kubernetes.io/cluster/privatecalico.example.com" = "owned" + "KubernetesCluster" = "privatecalico.example.com" + "Name" = "master-us-test-1a.masters.privatecalico.example.com" + "k8s.io/cluster-autoscaler/node-template/label/kubernetes.io/role" = "master" + "k8s.io/cluster-autoscaler/node-template/label/node-role.kubernetes.io/master" = "" + "k8s.io/role/master" = "1" + "kops.k8s.io/instancegroup" = "master-us-test-1a" + "kubernetes.io/cluster/privatecalico.example.com" = "owned" } } user_data = filebase64("${path.module}/data/aws_launch_template_master-us-test-1a.masters.privatecalico.example.com_user_data") @@ -515,21 +553,25 @@ resource "aws_launch_template" "nodes-privatecalico-example-com" { tag_specifications { resource_type = "instance" tags = { - "KubernetesCluster" = "privatecalico.example.com" - "Name" = "nodes.privatecalico.example.com" - "k8s.io/role/node" = "1" - "kops.k8s.io/instancegroup" = "nodes" - "kubernetes.io/cluster/privatecalico.example.com" = "owned" + "KubernetesCluster" = "privatecalico.example.com" + "Name" = "nodes.privatecalico.example.com" + "k8s.io/cluster-autoscaler/node-template/label/kubernetes.io/role" = "node" + "k8s.io/cluster-autoscaler/node-template/label/node-role.kubernetes.io/node" = "" + "k8s.io/role/node" = "1" + "kops.k8s.io/instancegroup" = "nodes" + "kubernetes.io/cluster/privatecalico.example.com" = "owned" } } tag_specifications { resource_type = "volume" tags = { - "KubernetesCluster" = "privatecalico.example.com" - "Name" = "nodes.privatecalico.example.com" - "k8s.io/role/node" = "1" - "kops.k8s.io/instancegroup" = "nodes" - "kubernetes.io/cluster/privatecalico.example.com" = "owned" + "KubernetesCluster" = "privatecalico.example.com" + "Name" = "nodes.privatecalico.example.com" + "k8s.io/cluster-autoscaler/node-template/label/kubernetes.io/role" = "node" + "k8s.io/cluster-autoscaler/node-template/label/node-role.kubernetes.io/node" = "" + "k8s.io/role/node" = "1" + "kops.k8s.io/instancegroup" = "nodes" + "kubernetes.io/cluster/privatecalico.example.com" = "owned" } } user_data = filebase64("${path.module}/data/aws_launch_template_nodes.privatecalico.example.com_user_data") diff --git a/tests/integration/update_cluster/privatecanal/kubernetes.tf b/tests/integration/update_cluster/privatecanal/kubernetes.tf index f680918082525..180b58d100069 100644 --- a/tests/integration/update_cluster/privatecanal/kubernetes.tf +++ b/tests/integration/update_cluster/privatecanal/kubernetes.tf @@ -140,6 +140,16 @@ resource "aws_autoscaling_group" "bastion-privatecanal-example-com" { propagate_at_launch = true value = "bastion.privatecanal.example.com" } + tag { + key = "k8s.io/cluster-autoscaler/node-template/label/kubernetes.io/role" + propagate_at_launch = true + value = "node" + } + tag { + key = "k8s.io/cluster-autoscaler/node-template/label/node-role.kubernetes.io/node" + propagate_at_launch = true + value = "" + } tag { key = "k8s.io/role/bastion" propagate_at_launch = true @@ -178,6 +188,16 @@ resource "aws_autoscaling_group" "master-us-test-1a-masters-privatecanal-example propagate_at_launch = true value = "master-us-test-1a.masters.privatecanal.example.com" } + tag { + key = "k8s.io/cluster-autoscaler/node-template/label/kubernetes.io/role" + propagate_at_launch = true + value = "master" + } + tag { + key = "k8s.io/cluster-autoscaler/node-template/label/node-role.kubernetes.io/master" + propagate_at_launch = true + value = "" + } tag { key = "k8s.io/role/master" propagate_at_launch = true @@ -216,6 +236,16 @@ resource "aws_autoscaling_group" "nodes-privatecanal-example-com" { propagate_at_launch = true value = "nodes.privatecanal.example.com" } + tag { + key = "k8s.io/cluster-autoscaler/node-template/label/kubernetes.io/role" + propagate_at_launch = true + value = "node" + } + tag { + key = "k8s.io/cluster-autoscaler/node-template/label/node-role.kubernetes.io/node" + propagate_at_launch = true + value = "" + } tag { key = "k8s.io/role/node" propagate_at_launch = true @@ -418,21 +448,25 @@ resource "aws_launch_template" "bastion-privatecanal-example-com" { tag_specifications { resource_type = "instance" tags = { - "KubernetesCluster" = "privatecanal.example.com" - "Name" = "bastion.privatecanal.example.com" - "k8s.io/role/bastion" = "1" - "kops.k8s.io/instancegroup" = "bastion" - "kubernetes.io/cluster/privatecanal.example.com" = "owned" + "KubernetesCluster" = "privatecanal.example.com" + "Name" = "bastion.privatecanal.example.com" + "k8s.io/cluster-autoscaler/node-template/label/kubernetes.io/role" = "node" + "k8s.io/cluster-autoscaler/node-template/label/node-role.kubernetes.io/node" = "" + "k8s.io/role/bastion" = "1" + "kops.k8s.io/instancegroup" = "bastion" + "kubernetes.io/cluster/privatecanal.example.com" = "owned" } } tag_specifications { resource_type = "volume" tags = { - "KubernetesCluster" = "privatecanal.example.com" - "Name" = "bastion.privatecanal.example.com" - "k8s.io/role/bastion" = "1" - "kops.k8s.io/instancegroup" = "bastion" - "kubernetes.io/cluster/privatecanal.example.com" = "owned" + "KubernetesCluster" = "privatecanal.example.com" + "Name" = "bastion.privatecanal.example.com" + "k8s.io/cluster-autoscaler/node-template/label/kubernetes.io/role" = "node" + "k8s.io/cluster-autoscaler/node-template/label/node-role.kubernetes.io/node" = "" + "k8s.io/role/bastion" = "1" + "kops.k8s.io/instancegroup" = "bastion" + "kubernetes.io/cluster/privatecanal.example.com" = "owned" } } } @@ -468,21 +502,25 @@ resource "aws_launch_template" "master-us-test-1a-masters-privatecanal-example-c tag_specifications { resource_type = "instance" tags = { - "KubernetesCluster" = "privatecanal.example.com" - "Name" = "master-us-test-1a.masters.privatecanal.example.com" - "k8s.io/role/master" = "1" - "kops.k8s.io/instancegroup" = "master-us-test-1a" - "kubernetes.io/cluster/privatecanal.example.com" = "owned" + "KubernetesCluster" = "privatecanal.example.com" + "Name" = "master-us-test-1a.masters.privatecanal.example.com" + "k8s.io/cluster-autoscaler/node-template/label/kubernetes.io/role" = "master" + "k8s.io/cluster-autoscaler/node-template/label/node-role.kubernetes.io/master" = "" + "k8s.io/role/master" = "1" + "kops.k8s.io/instancegroup" = "master-us-test-1a" + "kubernetes.io/cluster/privatecanal.example.com" = "owned" } } tag_specifications { resource_type = "volume" tags = { - "KubernetesCluster" = "privatecanal.example.com" - "Name" = "master-us-test-1a.masters.privatecanal.example.com" - "k8s.io/role/master" = "1" - "kops.k8s.io/instancegroup" = "master-us-test-1a" - "kubernetes.io/cluster/privatecanal.example.com" = "owned" + "KubernetesCluster" = "privatecanal.example.com" + "Name" = "master-us-test-1a.masters.privatecanal.example.com" + "k8s.io/cluster-autoscaler/node-template/label/kubernetes.io/role" = "master" + "k8s.io/cluster-autoscaler/node-template/label/node-role.kubernetes.io/master" = "" + "k8s.io/role/master" = "1" + "kops.k8s.io/instancegroup" = "master-us-test-1a" + "kubernetes.io/cluster/privatecanal.example.com" = "owned" } } user_data = filebase64("${path.module}/data/aws_launch_template_master-us-test-1a.masters.privatecanal.example.com_user_data") @@ -515,21 +553,25 @@ resource "aws_launch_template" "nodes-privatecanal-example-com" { tag_specifications { resource_type = "instance" tags = { - "KubernetesCluster" = "privatecanal.example.com" - "Name" = "nodes.privatecanal.example.com" - "k8s.io/role/node" = "1" - "kops.k8s.io/instancegroup" = "nodes" - "kubernetes.io/cluster/privatecanal.example.com" = "owned" + "KubernetesCluster" = "privatecanal.example.com" + "Name" = "nodes.privatecanal.example.com" + "k8s.io/cluster-autoscaler/node-template/label/kubernetes.io/role" = "node" + "k8s.io/cluster-autoscaler/node-template/label/node-role.kubernetes.io/node" = "" + "k8s.io/role/node" = "1" + "kops.k8s.io/instancegroup" = "nodes" + "kubernetes.io/cluster/privatecanal.example.com" = "owned" } } tag_specifications { resource_type = "volume" tags = { - "KubernetesCluster" = "privatecanal.example.com" - "Name" = "nodes.privatecanal.example.com" - "k8s.io/role/node" = "1" - "kops.k8s.io/instancegroup" = "nodes" - "kubernetes.io/cluster/privatecanal.example.com" = "owned" + "KubernetesCluster" = "privatecanal.example.com" + "Name" = "nodes.privatecanal.example.com" + "k8s.io/cluster-autoscaler/node-template/label/kubernetes.io/role" = "node" + "k8s.io/cluster-autoscaler/node-template/label/node-role.kubernetes.io/node" = "" + "k8s.io/role/node" = "1" + "kops.k8s.io/instancegroup" = "nodes" + "kubernetes.io/cluster/privatecanal.example.com" = "owned" } } user_data = filebase64("${path.module}/data/aws_launch_template_nodes.privatecanal.example.com_user_data") diff --git a/tests/integration/update_cluster/privatecilium/cloudformation.json b/tests/integration/update_cluster/privatecilium/cloudformation.json index 1054792f20414..4c1c6f696c847 100644 --- a/tests/integration/update_cluster/privatecilium/cloudformation.json +++ b/tests/integration/update_cluster/privatecilium/cloudformation.json @@ -33,6 +33,16 @@ "Value": "bastion.privatecilium.example.com", "PropagateAtLaunch": true }, + { + "Key": "k8s.io/cluster-autoscaler/node-template/label/kubernetes.io/role", + "Value": "node", + "PropagateAtLaunch": true + }, + { + "Key": "k8s.io/cluster-autoscaler/node-template/label/node-role.kubernetes.io/node", + "Value": "", + "PropagateAtLaunch": true + }, { "Key": "k8s.io/role/bastion", "Value": "1", @@ -104,6 +114,16 @@ "Value": "master-us-test-1a.masters.privatecilium.example.com", "PropagateAtLaunch": true }, + { + "Key": "k8s.io/cluster-autoscaler/node-template/label/kubernetes.io/role", + "Value": "master", + "PropagateAtLaunch": true + }, + { + "Key": "k8s.io/cluster-autoscaler/node-template/label/node-role.kubernetes.io/master", + "Value": "", + "PropagateAtLaunch": true + }, { "Key": "k8s.io/role/master", "Value": "1", @@ -175,6 +195,16 @@ "Value": "nodes.privatecilium.example.com", "PropagateAtLaunch": true }, + { + "Key": "k8s.io/cluster-autoscaler/node-template/label/kubernetes.io/role", + "Value": "node", + "PropagateAtLaunch": true + }, + { + "Key": "k8s.io/cluster-autoscaler/node-template/label/node-role.kubernetes.io/node", + "Value": "", + "PropagateAtLaunch": true + }, { "Key": "k8s.io/role/node", "Value": "1", @@ -317,6 +347,14 @@ "Key": "Name", "Value": "bastion.privatecilium.example.com" }, + { + "Key": "k8s.io/cluster-autoscaler/node-template/label/kubernetes.io/role", + "Value": "node" + }, + { + "Key": "k8s.io/cluster-autoscaler/node-template/label/node-role.kubernetes.io/node", + "Value": "" + }, { "Key": "k8s.io/role/bastion", "Value": "1" @@ -342,6 +380,14 @@ "Key": "Name", "Value": "bastion.privatecilium.example.com" }, + { + "Key": "k8s.io/cluster-autoscaler/node-template/label/kubernetes.io/role", + "Value": "node" + }, + { + "Key": "k8s.io/cluster-autoscaler/node-template/label/node-role.kubernetes.io/node", + "Value": "" + }, { "Key": "k8s.io/role/bastion", "Value": "1" @@ -412,6 +458,14 @@ "Key": "Name", "Value": "master-us-test-1a.masters.privatecilium.example.com" }, + { + "Key": "k8s.io/cluster-autoscaler/node-template/label/kubernetes.io/role", + "Value": "master" + }, + { + "Key": "k8s.io/cluster-autoscaler/node-template/label/node-role.kubernetes.io/master", + "Value": "" + }, { "Key": "k8s.io/role/master", "Value": "1" @@ -437,6 +491,14 @@ "Key": "Name", "Value": "master-us-test-1a.masters.privatecilium.example.com" }, + { + "Key": "k8s.io/cluster-autoscaler/node-template/label/kubernetes.io/role", + "Value": "master" + }, + { + "Key": "k8s.io/cluster-autoscaler/node-template/label/node-role.kubernetes.io/master", + "Value": "" + }, { "Key": "k8s.io/role/master", "Value": "1" @@ -503,6 +565,14 @@ "Key": "Name", "Value": "nodes.privatecilium.example.com" }, + { + "Key": "k8s.io/cluster-autoscaler/node-template/label/kubernetes.io/role", + "Value": "node" + }, + { + "Key": "k8s.io/cluster-autoscaler/node-template/label/node-role.kubernetes.io/node", + "Value": "" + }, { "Key": "k8s.io/role/node", "Value": "1" @@ -528,6 +598,14 @@ "Key": "Name", "Value": "nodes.privatecilium.example.com" }, + { + "Key": "k8s.io/cluster-autoscaler/node-template/label/kubernetes.io/role", + "Value": "node" + }, + { + "Key": "k8s.io/cluster-autoscaler/node-template/label/node-role.kubernetes.io/node", + "Value": "" + }, { "Key": "k8s.io/role/node", "Value": "1" diff --git a/tests/integration/update_cluster/privatecilium/kubernetes.tf b/tests/integration/update_cluster/privatecilium/kubernetes.tf index f2d01dc1ccd08..b853e0d5f7edc 100644 --- a/tests/integration/update_cluster/privatecilium/kubernetes.tf +++ b/tests/integration/update_cluster/privatecilium/kubernetes.tf @@ -140,6 +140,16 @@ resource "aws_autoscaling_group" "bastion-privatecilium-example-com" { propagate_at_launch = true value = "bastion.privatecilium.example.com" } + tag { + key = "k8s.io/cluster-autoscaler/node-template/label/kubernetes.io/role" + propagate_at_launch = true + value = "node" + } + tag { + key = "k8s.io/cluster-autoscaler/node-template/label/node-role.kubernetes.io/node" + propagate_at_launch = true + value = "" + } tag { key = "k8s.io/role/bastion" propagate_at_launch = true @@ -178,6 +188,16 @@ resource "aws_autoscaling_group" "master-us-test-1a-masters-privatecilium-exampl propagate_at_launch = true value = "master-us-test-1a.masters.privatecilium.example.com" } + tag { + key = "k8s.io/cluster-autoscaler/node-template/label/kubernetes.io/role" + propagate_at_launch = true + value = "master" + } + tag { + key = "k8s.io/cluster-autoscaler/node-template/label/node-role.kubernetes.io/master" + propagate_at_launch = true + value = "" + } tag { key = "k8s.io/role/master" propagate_at_launch = true @@ -216,6 +236,16 @@ resource "aws_autoscaling_group" "nodes-privatecilium-example-com" { propagate_at_launch = true value = "nodes.privatecilium.example.com" } + tag { + key = "k8s.io/cluster-autoscaler/node-template/label/kubernetes.io/role" + propagate_at_launch = true + value = "node" + } + tag { + key = "k8s.io/cluster-autoscaler/node-template/label/node-role.kubernetes.io/node" + propagate_at_launch = true + value = "" + } tag { key = "k8s.io/role/node" propagate_at_launch = true @@ -418,21 +448,25 @@ resource "aws_launch_template" "bastion-privatecilium-example-com" { tag_specifications { resource_type = "instance" tags = { - "KubernetesCluster" = "privatecilium.example.com" - "Name" = "bastion.privatecilium.example.com" - "k8s.io/role/bastion" = "1" - "kops.k8s.io/instancegroup" = "bastion" - "kubernetes.io/cluster/privatecilium.example.com" = "owned" + "KubernetesCluster" = "privatecilium.example.com" + "Name" = "bastion.privatecilium.example.com" + "k8s.io/cluster-autoscaler/node-template/label/kubernetes.io/role" = "node" + "k8s.io/cluster-autoscaler/node-template/label/node-role.kubernetes.io/node" = "" + "k8s.io/role/bastion" = "1" + "kops.k8s.io/instancegroup" = "bastion" + "kubernetes.io/cluster/privatecilium.example.com" = "owned" } } tag_specifications { resource_type = "volume" tags = { - "KubernetesCluster" = "privatecilium.example.com" - "Name" = "bastion.privatecilium.example.com" - "k8s.io/role/bastion" = "1" - "kops.k8s.io/instancegroup" = "bastion" - "kubernetes.io/cluster/privatecilium.example.com" = "owned" + "KubernetesCluster" = "privatecilium.example.com" + "Name" = "bastion.privatecilium.example.com" + "k8s.io/cluster-autoscaler/node-template/label/kubernetes.io/role" = "node" + "k8s.io/cluster-autoscaler/node-template/label/node-role.kubernetes.io/node" = "" + "k8s.io/role/bastion" = "1" + "kops.k8s.io/instancegroup" = "bastion" + "kubernetes.io/cluster/privatecilium.example.com" = "owned" } } } @@ -468,21 +502,25 @@ resource "aws_launch_template" "master-us-test-1a-masters-privatecilium-example- tag_specifications { resource_type = "instance" tags = { - "KubernetesCluster" = "privatecilium.example.com" - "Name" = "master-us-test-1a.masters.privatecilium.example.com" - "k8s.io/role/master" = "1" - "kops.k8s.io/instancegroup" = "master-us-test-1a" - "kubernetes.io/cluster/privatecilium.example.com" = "owned" + "KubernetesCluster" = "privatecilium.example.com" + "Name" = "master-us-test-1a.masters.privatecilium.example.com" + "k8s.io/cluster-autoscaler/node-template/label/kubernetes.io/role" = "master" + "k8s.io/cluster-autoscaler/node-template/label/node-role.kubernetes.io/master" = "" + "k8s.io/role/master" = "1" + "kops.k8s.io/instancegroup" = "master-us-test-1a" + "kubernetes.io/cluster/privatecilium.example.com" = "owned" } } tag_specifications { resource_type = "volume" tags = { - "KubernetesCluster" = "privatecilium.example.com" - "Name" = "master-us-test-1a.masters.privatecilium.example.com" - "k8s.io/role/master" = "1" - "kops.k8s.io/instancegroup" = "master-us-test-1a" - "kubernetes.io/cluster/privatecilium.example.com" = "owned" + "KubernetesCluster" = "privatecilium.example.com" + "Name" = "master-us-test-1a.masters.privatecilium.example.com" + "k8s.io/cluster-autoscaler/node-template/label/kubernetes.io/role" = "master" + "k8s.io/cluster-autoscaler/node-template/label/node-role.kubernetes.io/master" = "" + "k8s.io/role/master" = "1" + "kops.k8s.io/instancegroup" = "master-us-test-1a" + "kubernetes.io/cluster/privatecilium.example.com" = "owned" } } user_data = filebase64("${path.module}/data/aws_launch_template_master-us-test-1a.masters.privatecilium.example.com_user_data") @@ -515,21 +553,25 @@ resource "aws_launch_template" "nodes-privatecilium-example-com" { tag_specifications { resource_type = "instance" tags = { - "KubernetesCluster" = "privatecilium.example.com" - "Name" = "nodes.privatecilium.example.com" - "k8s.io/role/node" = "1" - "kops.k8s.io/instancegroup" = "nodes" - "kubernetes.io/cluster/privatecilium.example.com" = "owned" + "KubernetesCluster" = "privatecilium.example.com" + "Name" = "nodes.privatecilium.example.com" + "k8s.io/cluster-autoscaler/node-template/label/kubernetes.io/role" = "node" + "k8s.io/cluster-autoscaler/node-template/label/node-role.kubernetes.io/node" = "" + "k8s.io/role/node" = "1" + "kops.k8s.io/instancegroup" = "nodes" + "kubernetes.io/cluster/privatecilium.example.com" = "owned" } } tag_specifications { resource_type = "volume" tags = { - "KubernetesCluster" = "privatecilium.example.com" - "Name" = "nodes.privatecilium.example.com" - "k8s.io/role/node" = "1" - "kops.k8s.io/instancegroup" = "nodes" - "kubernetes.io/cluster/privatecilium.example.com" = "owned" + "KubernetesCluster" = "privatecilium.example.com" + "Name" = "nodes.privatecilium.example.com" + "k8s.io/cluster-autoscaler/node-template/label/kubernetes.io/role" = "node" + "k8s.io/cluster-autoscaler/node-template/label/node-role.kubernetes.io/node" = "" + "k8s.io/role/node" = "1" + "kops.k8s.io/instancegroup" = "nodes" + "kubernetes.io/cluster/privatecilium.example.com" = "owned" } } user_data = filebase64("${path.module}/data/aws_launch_template_nodes.privatecilium.example.com_user_data") diff --git a/tests/integration/update_cluster/privatecilium2/cloudformation.json b/tests/integration/update_cluster/privatecilium2/cloudformation.json index 1054792f20414..4c1c6f696c847 100644 --- a/tests/integration/update_cluster/privatecilium2/cloudformation.json +++ b/tests/integration/update_cluster/privatecilium2/cloudformation.json @@ -33,6 +33,16 @@ "Value": "bastion.privatecilium.example.com", "PropagateAtLaunch": true }, + { + "Key": "k8s.io/cluster-autoscaler/node-template/label/kubernetes.io/role", + "Value": "node", + "PropagateAtLaunch": true + }, + { + "Key": "k8s.io/cluster-autoscaler/node-template/label/node-role.kubernetes.io/node", + "Value": "", + "PropagateAtLaunch": true + }, { "Key": "k8s.io/role/bastion", "Value": "1", @@ -104,6 +114,16 @@ "Value": "master-us-test-1a.masters.privatecilium.example.com", "PropagateAtLaunch": true }, + { + "Key": "k8s.io/cluster-autoscaler/node-template/label/kubernetes.io/role", + "Value": "master", + "PropagateAtLaunch": true + }, + { + "Key": "k8s.io/cluster-autoscaler/node-template/label/node-role.kubernetes.io/master", + "Value": "", + "PropagateAtLaunch": true + }, { "Key": "k8s.io/role/master", "Value": "1", @@ -175,6 +195,16 @@ "Value": "nodes.privatecilium.example.com", "PropagateAtLaunch": true }, + { + "Key": "k8s.io/cluster-autoscaler/node-template/label/kubernetes.io/role", + "Value": "node", + "PropagateAtLaunch": true + }, + { + "Key": "k8s.io/cluster-autoscaler/node-template/label/node-role.kubernetes.io/node", + "Value": "", + "PropagateAtLaunch": true + }, { "Key": "k8s.io/role/node", "Value": "1", @@ -317,6 +347,14 @@ "Key": "Name", "Value": "bastion.privatecilium.example.com" }, + { + "Key": "k8s.io/cluster-autoscaler/node-template/label/kubernetes.io/role", + "Value": "node" + }, + { + "Key": "k8s.io/cluster-autoscaler/node-template/label/node-role.kubernetes.io/node", + "Value": "" + }, { "Key": "k8s.io/role/bastion", "Value": "1" @@ -342,6 +380,14 @@ "Key": "Name", "Value": "bastion.privatecilium.example.com" }, + { + "Key": "k8s.io/cluster-autoscaler/node-template/label/kubernetes.io/role", + "Value": "node" + }, + { + "Key": "k8s.io/cluster-autoscaler/node-template/label/node-role.kubernetes.io/node", + "Value": "" + }, { "Key": "k8s.io/role/bastion", "Value": "1" @@ -412,6 +458,14 @@ "Key": "Name", "Value": "master-us-test-1a.masters.privatecilium.example.com" }, + { + "Key": "k8s.io/cluster-autoscaler/node-template/label/kubernetes.io/role", + "Value": "master" + }, + { + "Key": "k8s.io/cluster-autoscaler/node-template/label/node-role.kubernetes.io/master", + "Value": "" + }, { "Key": "k8s.io/role/master", "Value": "1" @@ -437,6 +491,14 @@ "Key": "Name", "Value": "master-us-test-1a.masters.privatecilium.example.com" }, + { + "Key": "k8s.io/cluster-autoscaler/node-template/label/kubernetes.io/role", + "Value": "master" + }, + { + "Key": "k8s.io/cluster-autoscaler/node-template/label/node-role.kubernetes.io/master", + "Value": "" + }, { "Key": "k8s.io/role/master", "Value": "1" @@ -503,6 +565,14 @@ "Key": "Name", "Value": "nodes.privatecilium.example.com" }, + { + "Key": "k8s.io/cluster-autoscaler/node-template/label/kubernetes.io/role", + "Value": "node" + }, + { + "Key": "k8s.io/cluster-autoscaler/node-template/label/node-role.kubernetes.io/node", + "Value": "" + }, { "Key": "k8s.io/role/node", "Value": "1" @@ -528,6 +598,14 @@ "Key": "Name", "Value": "nodes.privatecilium.example.com" }, + { + "Key": "k8s.io/cluster-autoscaler/node-template/label/kubernetes.io/role", + "Value": "node" + }, + { + "Key": "k8s.io/cluster-autoscaler/node-template/label/node-role.kubernetes.io/node", + "Value": "" + }, { "Key": "k8s.io/role/node", "Value": "1" diff --git a/tests/integration/update_cluster/privatecilium2/kubernetes.tf b/tests/integration/update_cluster/privatecilium2/kubernetes.tf index f2d01dc1ccd08..b853e0d5f7edc 100644 --- a/tests/integration/update_cluster/privatecilium2/kubernetes.tf +++ b/tests/integration/update_cluster/privatecilium2/kubernetes.tf @@ -140,6 +140,16 @@ resource "aws_autoscaling_group" "bastion-privatecilium-example-com" { propagate_at_launch = true value = "bastion.privatecilium.example.com" } + tag { + key = "k8s.io/cluster-autoscaler/node-template/label/kubernetes.io/role" + propagate_at_launch = true + value = "node" + } + tag { + key = "k8s.io/cluster-autoscaler/node-template/label/node-role.kubernetes.io/node" + propagate_at_launch = true + value = "" + } tag { key = "k8s.io/role/bastion" propagate_at_launch = true @@ -178,6 +188,16 @@ resource "aws_autoscaling_group" "master-us-test-1a-masters-privatecilium-exampl propagate_at_launch = true value = "master-us-test-1a.masters.privatecilium.example.com" } + tag { + key = "k8s.io/cluster-autoscaler/node-template/label/kubernetes.io/role" + propagate_at_launch = true + value = "master" + } + tag { + key = "k8s.io/cluster-autoscaler/node-template/label/node-role.kubernetes.io/master" + propagate_at_launch = true + value = "" + } tag { key = "k8s.io/role/master" propagate_at_launch = true @@ -216,6 +236,16 @@ resource "aws_autoscaling_group" "nodes-privatecilium-example-com" { propagate_at_launch = true value = "nodes.privatecilium.example.com" } + tag { + key = "k8s.io/cluster-autoscaler/node-template/label/kubernetes.io/role" + propagate_at_launch = true + value = "node" + } + tag { + key = "k8s.io/cluster-autoscaler/node-template/label/node-role.kubernetes.io/node" + propagate_at_launch = true + value = "" + } tag { key = "k8s.io/role/node" propagate_at_launch = true @@ -418,21 +448,25 @@ resource "aws_launch_template" "bastion-privatecilium-example-com" { tag_specifications { resource_type = "instance" tags = { - "KubernetesCluster" = "privatecilium.example.com" - "Name" = "bastion.privatecilium.example.com" - "k8s.io/role/bastion" = "1" - "kops.k8s.io/instancegroup" = "bastion" - "kubernetes.io/cluster/privatecilium.example.com" = "owned" + "KubernetesCluster" = "privatecilium.example.com" + "Name" = "bastion.privatecilium.example.com" + "k8s.io/cluster-autoscaler/node-template/label/kubernetes.io/role" = "node" + "k8s.io/cluster-autoscaler/node-template/label/node-role.kubernetes.io/node" = "" + "k8s.io/role/bastion" = "1" + "kops.k8s.io/instancegroup" = "bastion" + "kubernetes.io/cluster/privatecilium.example.com" = "owned" } } tag_specifications { resource_type = "volume" tags = { - "KubernetesCluster" = "privatecilium.example.com" - "Name" = "bastion.privatecilium.example.com" - "k8s.io/role/bastion" = "1" - "kops.k8s.io/instancegroup" = "bastion" - "kubernetes.io/cluster/privatecilium.example.com" = "owned" + "KubernetesCluster" = "privatecilium.example.com" + "Name" = "bastion.privatecilium.example.com" + "k8s.io/cluster-autoscaler/node-template/label/kubernetes.io/role" = "node" + "k8s.io/cluster-autoscaler/node-template/label/node-role.kubernetes.io/node" = "" + "k8s.io/role/bastion" = "1" + "kops.k8s.io/instancegroup" = "bastion" + "kubernetes.io/cluster/privatecilium.example.com" = "owned" } } } @@ -468,21 +502,25 @@ resource "aws_launch_template" "master-us-test-1a-masters-privatecilium-example- tag_specifications { resource_type = "instance" tags = { - "KubernetesCluster" = "privatecilium.example.com" - "Name" = "master-us-test-1a.masters.privatecilium.example.com" - "k8s.io/role/master" = "1" - "kops.k8s.io/instancegroup" = "master-us-test-1a" - "kubernetes.io/cluster/privatecilium.example.com" = "owned" + "KubernetesCluster" = "privatecilium.example.com" + "Name" = "master-us-test-1a.masters.privatecilium.example.com" + "k8s.io/cluster-autoscaler/node-template/label/kubernetes.io/role" = "master" + "k8s.io/cluster-autoscaler/node-template/label/node-role.kubernetes.io/master" = "" + "k8s.io/role/master" = "1" + "kops.k8s.io/instancegroup" = "master-us-test-1a" + "kubernetes.io/cluster/privatecilium.example.com" = "owned" } } tag_specifications { resource_type = "volume" tags = { - "KubernetesCluster" = "privatecilium.example.com" - "Name" = "master-us-test-1a.masters.privatecilium.example.com" - "k8s.io/role/master" = "1" - "kops.k8s.io/instancegroup" = "master-us-test-1a" - "kubernetes.io/cluster/privatecilium.example.com" = "owned" + "KubernetesCluster" = "privatecilium.example.com" + "Name" = "master-us-test-1a.masters.privatecilium.example.com" + "k8s.io/cluster-autoscaler/node-template/label/kubernetes.io/role" = "master" + "k8s.io/cluster-autoscaler/node-template/label/node-role.kubernetes.io/master" = "" + "k8s.io/role/master" = "1" + "kops.k8s.io/instancegroup" = "master-us-test-1a" + "kubernetes.io/cluster/privatecilium.example.com" = "owned" } } user_data = filebase64("${path.module}/data/aws_launch_template_master-us-test-1a.masters.privatecilium.example.com_user_data") @@ -515,21 +553,25 @@ resource "aws_launch_template" "nodes-privatecilium-example-com" { tag_specifications { resource_type = "instance" tags = { - "KubernetesCluster" = "privatecilium.example.com" - "Name" = "nodes.privatecilium.example.com" - "k8s.io/role/node" = "1" - "kops.k8s.io/instancegroup" = "nodes" - "kubernetes.io/cluster/privatecilium.example.com" = "owned" + "KubernetesCluster" = "privatecilium.example.com" + "Name" = "nodes.privatecilium.example.com" + "k8s.io/cluster-autoscaler/node-template/label/kubernetes.io/role" = "node" + "k8s.io/cluster-autoscaler/node-template/label/node-role.kubernetes.io/node" = "" + "k8s.io/role/node" = "1" + "kops.k8s.io/instancegroup" = "nodes" + "kubernetes.io/cluster/privatecilium.example.com" = "owned" } } tag_specifications { resource_type = "volume" tags = { - "KubernetesCluster" = "privatecilium.example.com" - "Name" = "nodes.privatecilium.example.com" - "k8s.io/role/node" = "1" - "kops.k8s.io/instancegroup" = "nodes" - "kubernetes.io/cluster/privatecilium.example.com" = "owned" + "KubernetesCluster" = "privatecilium.example.com" + "Name" = "nodes.privatecilium.example.com" + "k8s.io/cluster-autoscaler/node-template/label/kubernetes.io/role" = "node" + "k8s.io/cluster-autoscaler/node-template/label/node-role.kubernetes.io/node" = "" + "k8s.io/role/node" = "1" + "kops.k8s.io/instancegroup" = "nodes" + "kubernetes.io/cluster/privatecilium.example.com" = "owned" } } user_data = filebase64("${path.module}/data/aws_launch_template_nodes.privatecilium.example.com_user_data") diff --git a/tests/integration/update_cluster/privateciliumadvanced/cloudformation.json b/tests/integration/update_cluster/privateciliumadvanced/cloudformation.json index d06802b8ea14d..184fbb93d06f3 100644 --- a/tests/integration/update_cluster/privateciliumadvanced/cloudformation.json +++ b/tests/integration/update_cluster/privateciliumadvanced/cloudformation.json @@ -33,6 +33,16 @@ "Value": "bastion.privateciliumadvanced.example.com", "PropagateAtLaunch": true }, + { + "Key": "k8s.io/cluster-autoscaler/node-template/label/kubernetes.io/role", + "Value": "node", + "PropagateAtLaunch": true + }, + { + "Key": "k8s.io/cluster-autoscaler/node-template/label/node-role.kubernetes.io/node", + "Value": "", + "PropagateAtLaunch": true + }, { "Key": "k8s.io/role/bastion", "Value": "1", @@ -104,6 +114,16 @@ "Value": "master-us-test-1a.masters.privateciliumadvanced.example.com", "PropagateAtLaunch": true }, + { + "Key": "k8s.io/cluster-autoscaler/node-template/label/kubernetes.io/role", + "Value": "master", + "PropagateAtLaunch": true + }, + { + "Key": "k8s.io/cluster-autoscaler/node-template/label/node-role.kubernetes.io/master", + "Value": "", + "PropagateAtLaunch": true + }, { "Key": "k8s.io/role/master", "Value": "1", @@ -175,6 +195,16 @@ "Value": "nodes.privateciliumadvanced.example.com", "PropagateAtLaunch": true }, + { + "Key": "k8s.io/cluster-autoscaler/node-template/label/kubernetes.io/role", + "Value": "node", + "PropagateAtLaunch": true + }, + { + "Key": "k8s.io/cluster-autoscaler/node-template/label/node-role.kubernetes.io/node", + "Value": "", + "PropagateAtLaunch": true + }, { "Key": "k8s.io/role/node", "Value": "1", @@ -317,6 +347,14 @@ "Key": "Name", "Value": "bastion.privateciliumadvanced.example.com" }, + { + "Key": "k8s.io/cluster-autoscaler/node-template/label/kubernetes.io/role", + "Value": "node" + }, + { + "Key": "k8s.io/cluster-autoscaler/node-template/label/node-role.kubernetes.io/node", + "Value": "" + }, { "Key": "k8s.io/role/bastion", "Value": "1" @@ -342,6 +380,14 @@ "Key": "Name", "Value": "bastion.privateciliumadvanced.example.com" }, + { + "Key": "k8s.io/cluster-autoscaler/node-template/label/kubernetes.io/role", + "Value": "node" + }, + { + "Key": "k8s.io/cluster-autoscaler/node-template/label/node-role.kubernetes.io/node", + "Value": "" + }, { "Key": "k8s.io/role/bastion", "Value": "1" @@ -412,6 +458,14 @@ "Key": "Name", "Value": "master-us-test-1a.masters.privateciliumadvanced.example.com" }, + { + "Key": "k8s.io/cluster-autoscaler/node-template/label/kubernetes.io/role", + "Value": "master" + }, + { + "Key": "k8s.io/cluster-autoscaler/node-template/label/node-role.kubernetes.io/master", + "Value": "" + }, { "Key": "k8s.io/role/master", "Value": "1" @@ -437,6 +491,14 @@ "Key": "Name", "Value": "master-us-test-1a.masters.privateciliumadvanced.example.com" }, + { + "Key": "k8s.io/cluster-autoscaler/node-template/label/kubernetes.io/role", + "Value": "master" + }, + { + "Key": "k8s.io/cluster-autoscaler/node-template/label/node-role.kubernetes.io/master", + "Value": "" + }, { "Key": "k8s.io/role/master", "Value": "1" @@ -503,6 +565,14 @@ "Key": "Name", "Value": "nodes.privateciliumadvanced.example.com" }, + { + "Key": "k8s.io/cluster-autoscaler/node-template/label/kubernetes.io/role", + "Value": "node" + }, + { + "Key": "k8s.io/cluster-autoscaler/node-template/label/node-role.kubernetes.io/node", + "Value": "" + }, { "Key": "k8s.io/role/node", "Value": "1" @@ -528,6 +598,14 @@ "Key": "Name", "Value": "nodes.privateciliumadvanced.example.com" }, + { + "Key": "k8s.io/cluster-autoscaler/node-template/label/kubernetes.io/role", + "Value": "node" + }, + { + "Key": "k8s.io/cluster-autoscaler/node-template/label/node-role.kubernetes.io/node", + "Value": "" + }, { "Key": "k8s.io/role/node", "Value": "1" diff --git a/tests/integration/update_cluster/privateciliumadvanced/kubernetes.tf b/tests/integration/update_cluster/privateciliumadvanced/kubernetes.tf index 80e12b587285b..a924a5ee97156 100644 --- a/tests/integration/update_cluster/privateciliumadvanced/kubernetes.tf +++ b/tests/integration/update_cluster/privateciliumadvanced/kubernetes.tf @@ -140,6 +140,16 @@ resource "aws_autoscaling_group" "bastion-privateciliumadvanced-example-com" { propagate_at_launch = true value = "bastion.privateciliumadvanced.example.com" } + tag { + key = "k8s.io/cluster-autoscaler/node-template/label/kubernetes.io/role" + propagate_at_launch = true + value = "node" + } + tag { + key = "k8s.io/cluster-autoscaler/node-template/label/node-role.kubernetes.io/node" + propagate_at_launch = true + value = "" + } tag { key = "k8s.io/role/bastion" propagate_at_launch = true @@ -178,6 +188,16 @@ resource "aws_autoscaling_group" "master-us-test-1a-masters-privateciliumadvance propagate_at_launch = true value = "master-us-test-1a.masters.privateciliumadvanced.example.com" } + tag { + key = "k8s.io/cluster-autoscaler/node-template/label/kubernetes.io/role" + propagate_at_launch = true + value = "master" + } + tag { + key = "k8s.io/cluster-autoscaler/node-template/label/node-role.kubernetes.io/master" + propagate_at_launch = true + value = "" + } tag { key = "k8s.io/role/master" propagate_at_launch = true @@ -216,6 +236,16 @@ resource "aws_autoscaling_group" "nodes-privateciliumadvanced-example-com" { propagate_at_launch = true value = "nodes.privateciliumadvanced.example.com" } + tag { + key = "k8s.io/cluster-autoscaler/node-template/label/kubernetes.io/role" + propagate_at_launch = true + value = "node" + } + tag { + key = "k8s.io/cluster-autoscaler/node-template/label/node-role.kubernetes.io/node" + propagate_at_launch = true + value = "" + } tag { key = "k8s.io/role/node" propagate_at_launch = true @@ -432,21 +462,25 @@ resource "aws_launch_template" "bastion-privateciliumadvanced-example-com" { tag_specifications { resource_type = "instance" tags = { - "KubernetesCluster" = "privateciliumadvanced.example.com" - "Name" = "bastion.privateciliumadvanced.example.com" - "k8s.io/role/bastion" = "1" - "kops.k8s.io/instancegroup" = "bastion" - "kubernetes.io/cluster/privateciliumadvanced.example.com" = "owned" + "KubernetesCluster" = "privateciliumadvanced.example.com" + "Name" = "bastion.privateciliumadvanced.example.com" + "k8s.io/cluster-autoscaler/node-template/label/kubernetes.io/role" = "node" + "k8s.io/cluster-autoscaler/node-template/label/node-role.kubernetes.io/node" = "" + "k8s.io/role/bastion" = "1" + "kops.k8s.io/instancegroup" = "bastion" + "kubernetes.io/cluster/privateciliumadvanced.example.com" = "owned" } } tag_specifications { resource_type = "volume" tags = { - "KubernetesCluster" = "privateciliumadvanced.example.com" - "Name" = "bastion.privateciliumadvanced.example.com" - "k8s.io/role/bastion" = "1" - "kops.k8s.io/instancegroup" = "bastion" - "kubernetes.io/cluster/privateciliumadvanced.example.com" = "owned" + "KubernetesCluster" = "privateciliumadvanced.example.com" + "Name" = "bastion.privateciliumadvanced.example.com" + "k8s.io/cluster-autoscaler/node-template/label/kubernetes.io/role" = "node" + "k8s.io/cluster-autoscaler/node-template/label/node-role.kubernetes.io/node" = "" + "k8s.io/role/bastion" = "1" + "kops.k8s.io/instancegroup" = "bastion" + "kubernetes.io/cluster/privateciliumadvanced.example.com" = "owned" } } } @@ -482,21 +516,25 @@ resource "aws_launch_template" "master-us-test-1a-masters-privateciliumadvanced- tag_specifications { resource_type = "instance" tags = { - "KubernetesCluster" = "privateciliumadvanced.example.com" - "Name" = "master-us-test-1a.masters.privateciliumadvanced.example.com" - "k8s.io/role/master" = "1" - "kops.k8s.io/instancegroup" = "master-us-test-1a" - "kubernetes.io/cluster/privateciliumadvanced.example.com" = "owned" + "KubernetesCluster" = "privateciliumadvanced.example.com" + "Name" = "master-us-test-1a.masters.privateciliumadvanced.example.com" + "k8s.io/cluster-autoscaler/node-template/label/kubernetes.io/role" = "master" + "k8s.io/cluster-autoscaler/node-template/label/node-role.kubernetes.io/master" = "" + "k8s.io/role/master" = "1" + "kops.k8s.io/instancegroup" = "master-us-test-1a" + "kubernetes.io/cluster/privateciliumadvanced.example.com" = "owned" } } tag_specifications { resource_type = "volume" tags = { - "KubernetesCluster" = "privateciliumadvanced.example.com" - "Name" = "master-us-test-1a.masters.privateciliumadvanced.example.com" - "k8s.io/role/master" = "1" - "kops.k8s.io/instancegroup" = "master-us-test-1a" - "kubernetes.io/cluster/privateciliumadvanced.example.com" = "owned" + "KubernetesCluster" = "privateciliumadvanced.example.com" + "Name" = "master-us-test-1a.masters.privateciliumadvanced.example.com" + "k8s.io/cluster-autoscaler/node-template/label/kubernetes.io/role" = "master" + "k8s.io/cluster-autoscaler/node-template/label/node-role.kubernetes.io/master" = "" + "k8s.io/role/master" = "1" + "kops.k8s.io/instancegroup" = "master-us-test-1a" + "kubernetes.io/cluster/privateciliumadvanced.example.com" = "owned" } } user_data = filebase64("${path.module}/data/aws_launch_template_master-us-test-1a.masters.privateciliumadvanced.example.com_user_data") @@ -529,21 +567,25 @@ resource "aws_launch_template" "nodes-privateciliumadvanced-example-com" { tag_specifications { resource_type = "instance" tags = { - "KubernetesCluster" = "privateciliumadvanced.example.com" - "Name" = "nodes.privateciliumadvanced.example.com" - "k8s.io/role/node" = "1" - "kops.k8s.io/instancegroup" = "nodes" - "kubernetes.io/cluster/privateciliumadvanced.example.com" = "owned" + "KubernetesCluster" = "privateciliumadvanced.example.com" + "Name" = "nodes.privateciliumadvanced.example.com" + "k8s.io/cluster-autoscaler/node-template/label/kubernetes.io/role" = "node" + "k8s.io/cluster-autoscaler/node-template/label/node-role.kubernetes.io/node" = "" + "k8s.io/role/node" = "1" + "kops.k8s.io/instancegroup" = "nodes" + "kubernetes.io/cluster/privateciliumadvanced.example.com" = "owned" } } tag_specifications { resource_type = "volume" tags = { - "KubernetesCluster" = "privateciliumadvanced.example.com" - "Name" = "nodes.privateciliumadvanced.example.com" - "k8s.io/role/node" = "1" - "kops.k8s.io/instancegroup" = "nodes" - "kubernetes.io/cluster/privateciliumadvanced.example.com" = "owned" + "KubernetesCluster" = "privateciliumadvanced.example.com" + "Name" = "nodes.privateciliumadvanced.example.com" + "k8s.io/cluster-autoscaler/node-template/label/kubernetes.io/role" = "node" + "k8s.io/cluster-autoscaler/node-template/label/node-role.kubernetes.io/node" = "" + "k8s.io/role/node" = "1" + "kops.k8s.io/instancegroup" = "nodes" + "kubernetes.io/cluster/privateciliumadvanced.example.com" = "owned" } } user_data = filebase64("${path.module}/data/aws_launch_template_nodes.privateciliumadvanced.example.com_user_data") diff --git a/tests/integration/update_cluster/privatedns1/kubernetes.tf b/tests/integration/update_cluster/privatedns1/kubernetes.tf index 64d1a8c2c5ded..06c6a156b7d07 100644 --- a/tests/integration/update_cluster/privatedns1/kubernetes.tf +++ b/tests/integration/update_cluster/privatedns1/kubernetes.tf @@ -150,6 +150,16 @@ resource "aws_autoscaling_group" "bastion-privatedns1-example-com" { propagate_at_launch = true value = "fib+baz" } + tag { + key = "k8s.io/cluster-autoscaler/node-template/label/kubernetes.io/role" + propagate_at_launch = true + value = "node" + } + tag { + key = "k8s.io/cluster-autoscaler/node-template/label/node-role.kubernetes.io/node" + propagate_at_launch = true + value = "" + } tag { key = "k8s.io/role/bastion" propagate_at_launch = true @@ -198,6 +208,16 @@ resource "aws_autoscaling_group" "master-us-test-1a-masters-privatedns1-example- propagate_at_launch = true value = "fib+baz" } + tag { + key = "k8s.io/cluster-autoscaler/node-template/label/kubernetes.io/role" + propagate_at_launch = true + value = "master" + } + tag { + key = "k8s.io/cluster-autoscaler/node-template/label/node-role.kubernetes.io/master" + propagate_at_launch = true + value = "" + } tag { key = "k8s.io/role/master" propagate_at_launch = true @@ -246,6 +266,16 @@ resource "aws_autoscaling_group" "nodes-privatedns1-example-com" { propagate_at_launch = true value = "fib+baz" } + tag { + key = "k8s.io/cluster-autoscaler/node-template/label/kubernetes.io/role" + propagate_at_launch = true + value = "node" + } + tag { + key = "k8s.io/cluster-autoscaler/node-template/label/node-role.kubernetes.io/node" + propagate_at_launch = true + value = "" + } tag { key = "k8s.io/role/node" propagate_at_launch = true @@ -462,25 +492,29 @@ resource "aws_launch_template" "bastion-privatedns1-example-com" { tag_specifications { resource_type = "instance" tags = { - "KubernetesCluster" = "privatedns1.example.com" - "Name" = "bastion.privatedns1.example.com" - "Owner" = "John Doe" - "foo/bar" = "fib+baz" - "k8s.io/role/bastion" = "1" - "kops.k8s.io/instancegroup" = "bastion" - "kubernetes.io/cluster/privatedns1.example.com" = "owned" + "KubernetesCluster" = "privatedns1.example.com" + "Name" = "bastion.privatedns1.example.com" + "Owner" = "John Doe" + "foo/bar" = "fib+baz" + "k8s.io/cluster-autoscaler/node-template/label/kubernetes.io/role" = "node" + "k8s.io/cluster-autoscaler/node-template/label/node-role.kubernetes.io/node" = "" + "k8s.io/role/bastion" = "1" + "kops.k8s.io/instancegroup" = "bastion" + "kubernetes.io/cluster/privatedns1.example.com" = "owned" } } tag_specifications { resource_type = "volume" tags = { - "KubernetesCluster" = "privatedns1.example.com" - "Name" = "bastion.privatedns1.example.com" - "Owner" = "John Doe" - "foo/bar" = "fib+baz" - "k8s.io/role/bastion" = "1" - "kops.k8s.io/instancegroup" = "bastion" - "kubernetes.io/cluster/privatedns1.example.com" = "owned" + "KubernetesCluster" = "privatedns1.example.com" + "Name" = "bastion.privatedns1.example.com" + "Owner" = "John Doe" + "foo/bar" = "fib+baz" + "k8s.io/cluster-autoscaler/node-template/label/kubernetes.io/role" = "node" + "k8s.io/cluster-autoscaler/node-template/label/node-role.kubernetes.io/node" = "" + "k8s.io/role/bastion" = "1" + "kops.k8s.io/instancegroup" = "bastion" + "kubernetes.io/cluster/privatedns1.example.com" = "owned" } } } @@ -516,25 +550,29 @@ resource "aws_launch_template" "master-us-test-1a-masters-privatedns1-example-co tag_specifications { resource_type = "instance" tags = { - "KubernetesCluster" = "privatedns1.example.com" - "Name" = "master-us-test-1a.masters.privatedns1.example.com" - "Owner" = "John Doe" - "foo/bar" = "fib+baz" - "k8s.io/role/master" = "1" - "kops.k8s.io/instancegroup" = "master-us-test-1a" - "kubernetes.io/cluster/privatedns1.example.com" = "owned" + "KubernetesCluster" = "privatedns1.example.com" + "Name" = "master-us-test-1a.masters.privatedns1.example.com" + "Owner" = "John Doe" + "foo/bar" = "fib+baz" + "k8s.io/cluster-autoscaler/node-template/label/kubernetes.io/role" = "master" + "k8s.io/cluster-autoscaler/node-template/label/node-role.kubernetes.io/master" = "" + "k8s.io/role/master" = "1" + "kops.k8s.io/instancegroup" = "master-us-test-1a" + "kubernetes.io/cluster/privatedns1.example.com" = "owned" } } tag_specifications { resource_type = "volume" tags = { - "KubernetesCluster" = "privatedns1.example.com" - "Name" = "master-us-test-1a.masters.privatedns1.example.com" - "Owner" = "John Doe" - "foo/bar" = "fib+baz" - "k8s.io/role/master" = "1" - "kops.k8s.io/instancegroup" = "master-us-test-1a" - "kubernetes.io/cluster/privatedns1.example.com" = "owned" + "KubernetesCluster" = "privatedns1.example.com" + "Name" = "master-us-test-1a.masters.privatedns1.example.com" + "Owner" = "John Doe" + "foo/bar" = "fib+baz" + "k8s.io/cluster-autoscaler/node-template/label/kubernetes.io/role" = "master" + "k8s.io/cluster-autoscaler/node-template/label/node-role.kubernetes.io/master" = "" + "k8s.io/role/master" = "1" + "kops.k8s.io/instancegroup" = "master-us-test-1a" + "kubernetes.io/cluster/privatedns1.example.com" = "owned" } } user_data = filebase64("${path.module}/data/aws_launch_template_master-us-test-1a.masters.privatedns1.example.com_user_data") @@ -567,25 +605,29 @@ resource "aws_launch_template" "nodes-privatedns1-example-com" { tag_specifications { resource_type = "instance" tags = { - "KubernetesCluster" = "privatedns1.example.com" - "Name" = "nodes.privatedns1.example.com" - "Owner" = "John Doe" - "foo/bar" = "fib+baz" - "k8s.io/role/node" = "1" - "kops.k8s.io/instancegroup" = "nodes" - "kubernetes.io/cluster/privatedns1.example.com" = "owned" + "KubernetesCluster" = "privatedns1.example.com" + "Name" = "nodes.privatedns1.example.com" + "Owner" = "John Doe" + "foo/bar" = "fib+baz" + "k8s.io/cluster-autoscaler/node-template/label/kubernetes.io/role" = "node" + "k8s.io/cluster-autoscaler/node-template/label/node-role.kubernetes.io/node" = "" + "k8s.io/role/node" = "1" + "kops.k8s.io/instancegroup" = "nodes" + "kubernetes.io/cluster/privatedns1.example.com" = "owned" } } tag_specifications { resource_type = "volume" tags = { - "KubernetesCluster" = "privatedns1.example.com" - "Name" = "nodes.privatedns1.example.com" - "Owner" = "John Doe" - "foo/bar" = "fib+baz" - "k8s.io/role/node" = "1" - "kops.k8s.io/instancegroup" = "nodes" - "kubernetes.io/cluster/privatedns1.example.com" = "owned" + "KubernetesCluster" = "privatedns1.example.com" + "Name" = "nodes.privatedns1.example.com" + "Owner" = "John Doe" + "foo/bar" = "fib+baz" + "k8s.io/cluster-autoscaler/node-template/label/kubernetes.io/role" = "node" + "k8s.io/cluster-autoscaler/node-template/label/node-role.kubernetes.io/node" = "" + "k8s.io/role/node" = "1" + "kops.k8s.io/instancegroup" = "nodes" + "kubernetes.io/cluster/privatedns1.example.com" = "owned" } } user_data = filebase64("${path.module}/data/aws_launch_template_nodes.privatedns1.example.com_user_data") diff --git a/tests/integration/update_cluster/privatedns2/kubernetes.tf b/tests/integration/update_cluster/privatedns2/kubernetes.tf index ce84f2830701f..53c2afb774d8b 100644 --- a/tests/integration/update_cluster/privatedns2/kubernetes.tf +++ b/tests/integration/update_cluster/privatedns2/kubernetes.tf @@ -135,6 +135,16 @@ resource "aws_autoscaling_group" "bastion-privatedns2-example-com" { propagate_at_launch = true value = "bastion.privatedns2.example.com" } + tag { + key = "k8s.io/cluster-autoscaler/node-template/label/kubernetes.io/role" + propagate_at_launch = true + value = "node" + } + tag { + key = "k8s.io/cluster-autoscaler/node-template/label/node-role.kubernetes.io/node" + propagate_at_launch = true + value = "" + } tag { key = "k8s.io/role/bastion" propagate_at_launch = true @@ -173,6 +183,16 @@ resource "aws_autoscaling_group" "master-us-test-1a-masters-privatedns2-example- propagate_at_launch = true value = "master-us-test-1a.masters.privatedns2.example.com" } + tag { + key = "k8s.io/cluster-autoscaler/node-template/label/kubernetes.io/role" + propagate_at_launch = true + value = "master" + } + tag { + key = "k8s.io/cluster-autoscaler/node-template/label/node-role.kubernetes.io/master" + propagate_at_launch = true + value = "" + } tag { key = "k8s.io/role/master" propagate_at_launch = true @@ -211,6 +231,16 @@ resource "aws_autoscaling_group" "nodes-privatedns2-example-com" { propagate_at_launch = true value = "nodes.privatedns2.example.com" } + tag { + key = "k8s.io/cluster-autoscaler/node-template/label/kubernetes.io/role" + propagate_at_launch = true + value = "node" + } + tag { + key = "k8s.io/cluster-autoscaler/node-template/label/node-role.kubernetes.io/node" + propagate_at_launch = true + value = "" + } tag { key = "k8s.io/role/node" propagate_at_launch = true @@ -404,21 +434,25 @@ resource "aws_launch_template" "bastion-privatedns2-example-com" { tag_specifications { resource_type = "instance" tags = { - "KubernetesCluster" = "privatedns2.example.com" - "Name" = "bastion.privatedns2.example.com" - "k8s.io/role/bastion" = "1" - "kops.k8s.io/instancegroup" = "bastion" - "kubernetes.io/cluster/privatedns2.example.com" = "owned" + "KubernetesCluster" = "privatedns2.example.com" + "Name" = "bastion.privatedns2.example.com" + "k8s.io/cluster-autoscaler/node-template/label/kubernetes.io/role" = "node" + "k8s.io/cluster-autoscaler/node-template/label/node-role.kubernetes.io/node" = "" + "k8s.io/role/bastion" = "1" + "kops.k8s.io/instancegroup" = "bastion" + "kubernetes.io/cluster/privatedns2.example.com" = "owned" } } tag_specifications { resource_type = "volume" tags = { - "KubernetesCluster" = "privatedns2.example.com" - "Name" = "bastion.privatedns2.example.com" - "k8s.io/role/bastion" = "1" - "kops.k8s.io/instancegroup" = "bastion" - "kubernetes.io/cluster/privatedns2.example.com" = "owned" + "KubernetesCluster" = "privatedns2.example.com" + "Name" = "bastion.privatedns2.example.com" + "k8s.io/cluster-autoscaler/node-template/label/kubernetes.io/role" = "node" + "k8s.io/cluster-autoscaler/node-template/label/node-role.kubernetes.io/node" = "" + "k8s.io/role/bastion" = "1" + "kops.k8s.io/instancegroup" = "bastion" + "kubernetes.io/cluster/privatedns2.example.com" = "owned" } } } @@ -454,21 +488,25 @@ resource "aws_launch_template" "master-us-test-1a-masters-privatedns2-example-co tag_specifications { resource_type = "instance" tags = { - "KubernetesCluster" = "privatedns2.example.com" - "Name" = "master-us-test-1a.masters.privatedns2.example.com" - "k8s.io/role/master" = "1" - "kops.k8s.io/instancegroup" = "master-us-test-1a" - "kubernetes.io/cluster/privatedns2.example.com" = "owned" + "KubernetesCluster" = "privatedns2.example.com" + "Name" = "master-us-test-1a.masters.privatedns2.example.com" + "k8s.io/cluster-autoscaler/node-template/label/kubernetes.io/role" = "master" + "k8s.io/cluster-autoscaler/node-template/label/node-role.kubernetes.io/master" = "" + "k8s.io/role/master" = "1" + "kops.k8s.io/instancegroup" = "master-us-test-1a" + "kubernetes.io/cluster/privatedns2.example.com" = "owned" } } tag_specifications { resource_type = "volume" tags = { - "KubernetesCluster" = "privatedns2.example.com" - "Name" = "master-us-test-1a.masters.privatedns2.example.com" - "k8s.io/role/master" = "1" - "kops.k8s.io/instancegroup" = "master-us-test-1a" - "kubernetes.io/cluster/privatedns2.example.com" = "owned" + "KubernetesCluster" = "privatedns2.example.com" + "Name" = "master-us-test-1a.masters.privatedns2.example.com" + "k8s.io/cluster-autoscaler/node-template/label/kubernetes.io/role" = "master" + "k8s.io/cluster-autoscaler/node-template/label/node-role.kubernetes.io/master" = "" + "k8s.io/role/master" = "1" + "kops.k8s.io/instancegroup" = "master-us-test-1a" + "kubernetes.io/cluster/privatedns2.example.com" = "owned" } } user_data = filebase64("${path.module}/data/aws_launch_template_master-us-test-1a.masters.privatedns2.example.com_user_data") @@ -501,21 +539,25 @@ resource "aws_launch_template" "nodes-privatedns2-example-com" { tag_specifications { resource_type = "instance" tags = { - "KubernetesCluster" = "privatedns2.example.com" - "Name" = "nodes.privatedns2.example.com" - "k8s.io/role/node" = "1" - "kops.k8s.io/instancegroup" = "nodes" - "kubernetes.io/cluster/privatedns2.example.com" = "owned" + "KubernetesCluster" = "privatedns2.example.com" + "Name" = "nodes.privatedns2.example.com" + "k8s.io/cluster-autoscaler/node-template/label/kubernetes.io/role" = "node" + "k8s.io/cluster-autoscaler/node-template/label/node-role.kubernetes.io/node" = "" + "k8s.io/role/node" = "1" + "kops.k8s.io/instancegroup" = "nodes" + "kubernetes.io/cluster/privatedns2.example.com" = "owned" } } tag_specifications { resource_type = "volume" tags = { - "KubernetesCluster" = "privatedns2.example.com" - "Name" = "nodes.privatedns2.example.com" - "k8s.io/role/node" = "1" - "kops.k8s.io/instancegroup" = "nodes" - "kubernetes.io/cluster/privatedns2.example.com" = "owned" + "KubernetesCluster" = "privatedns2.example.com" + "Name" = "nodes.privatedns2.example.com" + "k8s.io/cluster-autoscaler/node-template/label/kubernetes.io/role" = "node" + "k8s.io/cluster-autoscaler/node-template/label/node-role.kubernetes.io/node" = "" + "k8s.io/role/node" = "1" + "kops.k8s.io/instancegroup" = "nodes" + "kubernetes.io/cluster/privatedns2.example.com" = "owned" } } user_data = filebase64("${path.module}/data/aws_launch_template_nodes.privatedns2.example.com_user_data") diff --git a/tests/integration/update_cluster/privateflannel/kubernetes.tf b/tests/integration/update_cluster/privateflannel/kubernetes.tf index 9c4a2fe62cbcc..8ddd917c89d5c 100644 --- a/tests/integration/update_cluster/privateflannel/kubernetes.tf +++ b/tests/integration/update_cluster/privateflannel/kubernetes.tf @@ -140,6 +140,16 @@ resource "aws_autoscaling_group" "bastion-privateflannel-example-com" { propagate_at_launch = true value = "bastion.privateflannel.example.com" } + tag { + key = "k8s.io/cluster-autoscaler/node-template/label/kubernetes.io/role" + propagate_at_launch = true + value = "node" + } + tag { + key = "k8s.io/cluster-autoscaler/node-template/label/node-role.kubernetes.io/node" + propagate_at_launch = true + value = "" + } tag { key = "k8s.io/role/bastion" propagate_at_launch = true @@ -178,6 +188,16 @@ resource "aws_autoscaling_group" "master-us-test-1a-masters-privateflannel-examp propagate_at_launch = true value = "master-us-test-1a.masters.privateflannel.example.com" } + tag { + key = "k8s.io/cluster-autoscaler/node-template/label/kubernetes.io/role" + propagate_at_launch = true + value = "master" + } + tag { + key = "k8s.io/cluster-autoscaler/node-template/label/node-role.kubernetes.io/master" + propagate_at_launch = true + value = "" + } tag { key = "k8s.io/role/master" propagate_at_launch = true @@ -216,6 +236,16 @@ resource "aws_autoscaling_group" "nodes-privateflannel-example-com" { propagate_at_launch = true value = "nodes.privateflannel.example.com" } + tag { + key = "k8s.io/cluster-autoscaler/node-template/label/kubernetes.io/role" + propagate_at_launch = true + value = "node" + } + tag { + key = "k8s.io/cluster-autoscaler/node-template/label/node-role.kubernetes.io/node" + propagate_at_launch = true + value = "" + } tag { key = "k8s.io/role/node" propagate_at_launch = true @@ -418,21 +448,25 @@ resource "aws_launch_template" "bastion-privateflannel-example-com" { tag_specifications { resource_type = "instance" tags = { - "KubernetesCluster" = "privateflannel.example.com" - "Name" = "bastion.privateflannel.example.com" - "k8s.io/role/bastion" = "1" - "kops.k8s.io/instancegroup" = "bastion" - "kubernetes.io/cluster/privateflannel.example.com" = "owned" + "KubernetesCluster" = "privateflannel.example.com" + "Name" = "bastion.privateflannel.example.com" + "k8s.io/cluster-autoscaler/node-template/label/kubernetes.io/role" = "node" + "k8s.io/cluster-autoscaler/node-template/label/node-role.kubernetes.io/node" = "" + "k8s.io/role/bastion" = "1" + "kops.k8s.io/instancegroup" = "bastion" + "kubernetes.io/cluster/privateflannel.example.com" = "owned" } } tag_specifications { resource_type = "volume" tags = { - "KubernetesCluster" = "privateflannel.example.com" - "Name" = "bastion.privateflannel.example.com" - "k8s.io/role/bastion" = "1" - "kops.k8s.io/instancegroup" = "bastion" - "kubernetes.io/cluster/privateflannel.example.com" = "owned" + "KubernetesCluster" = "privateflannel.example.com" + "Name" = "bastion.privateflannel.example.com" + "k8s.io/cluster-autoscaler/node-template/label/kubernetes.io/role" = "node" + "k8s.io/cluster-autoscaler/node-template/label/node-role.kubernetes.io/node" = "" + "k8s.io/role/bastion" = "1" + "kops.k8s.io/instancegroup" = "bastion" + "kubernetes.io/cluster/privateflannel.example.com" = "owned" } } } @@ -468,21 +502,25 @@ resource "aws_launch_template" "master-us-test-1a-masters-privateflannel-example tag_specifications { resource_type = "instance" tags = { - "KubernetesCluster" = "privateflannel.example.com" - "Name" = "master-us-test-1a.masters.privateflannel.example.com" - "k8s.io/role/master" = "1" - "kops.k8s.io/instancegroup" = "master-us-test-1a" - "kubernetes.io/cluster/privateflannel.example.com" = "owned" + "KubernetesCluster" = "privateflannel.example.com" + "Name" = "master-us-test-1a.masters.privateflannel.example.com" + "k8s.io/cluster-autoscaler/node-template/label/kubernetes.io/role" = "master" + "k8s.io/cluster-autoscaler/node-template/label/node-role.kubernetes.io/master" = "" + "k8s.io/role/master" = "1" + "kops.k8s.io/instancegroup" = "master-us-test-1a" + "kubernetes.io/cluster/privateflannel.example.com" = "owned" } } tag_specifications { resource_type = "volume" tags = { - "KubernetesCluster" = "privateflannel.example.com" - "Name" = "master-us-test-1a.masters.privateflannel.example.com" - "k8s.io/role/master" = "1" - "kops.k8s.io/instancegroup" = "master-us-test-1a" - "kubernetes.io/cluster/privateflannel.example.com" = "owned" + "KubernetesCluster" = "privateflannel.example.com" + "Name" = "master-us-test-1a.masters.privateflannel.example.com" + "k8s.io/cluster-autoscaler/node-template/label/kubernetes.io/role" = "master" + "k8s.io/cluster-autoscaler/node-template/label/node-role.kubernetes.io/master" = "" + "k8s.io/role/master" = "1" + "kops.k8s.io/instancegroup" = "master-us-test-1a" + "kubernetes.io/cluster/privateflannel.example.com" = "owned" } } user_data = filebase64("${path.module}/data/aws_launch_template_master-us-test-1a.masters.privateflannel.example.com_user_data") @@ -515,21 +553,25 @@ resource "aws_launch_template" "nodes-privateflannel-example-com" { tag_specifications { resource_type = "instance" tags = { - "KubernetesCluster" = "privateflannel.example.com" - "Name" = "nodes.privateflannel.example.com" - "k8s.io/role/node" = "1" - "kops.k8s.io/instancegroup" = "nodes" - "kubernetes.io/cluster/privateflannel.example.com" = "owned" + "KubernetesCluster" = "privateflannel.example.com" + "Name" = "nodes.privateflannel.example.com" + "k8s.io/cluster-autoscaler/node-template/label/kubernetes.io/role" = "node" + "k8s.io/cluster-autoscaler/node-template/label/node-role.kubernetes.io/node" = "" + "k8s.io/role/node" = "1" + "kops.k8s.io/instancegroup" = "nodes" + "kubernetes.io/cluster/privateflannel.example.com" = "owned" } } tag_specifications { resource_type = "volume" tags = { - "KubernetesCluster" = "privateflannel.example.com" - "Name" = "nodes.privateflannel.example.com" - "k8s.io/role/node" = "1" - "kops.k8s.io/instancegroup" = "nodes" - "kubernetes.io/cluster/privateflannel.example.com" = "owned" + "KubernetesCluster" = "privateflannel.example.com" + "Name" = "nodes.privateflannel.example.com" + "k8s.io/cluster-autoscaler/node-template/label/kubernetes.io/role" = "node" + "k8s.io/cluster-autoscaler/node-template/label/node-role.kubernetes.io/node" = "" + "k8s.io/role/node" = "1" + "kops.k8s.io/instancegroup" = "nodes" + "kubernetes.io/cluster/privateflannel.example.com" = "owned" } } user_data = filebase64("${path.module}/data/aws_launch_template_nodes.privateflannel.example.com_user_data") diff --git a/tests/integration/update_cluster/privatekopeio/kubernetes.tf b/tests/integration/update_cluster/privatekopeio/kubernetes.tf index 2dfca4997ae4f..b26c8648d3538 100644 --- a/tests/integration/update_cluster/privatekopeio/kubernetes.tf +++ b/tests/integration/update_cluster/privatekopeio/kubernetes.tf @@ -155,6 +155,16 @@ resource "aws_autoscaling_group" "bastion-privatekopeio-example-com" { propagate_at_launch = true value = "bastion.privatekopeio.example.com" } + tag { + key = "k8s.io/cluster-autoscaler/node-template/label/kubernetes.io/role" + propagate_at_launch = true + value = "node" + } + tag { + key = "k8s.io/cluster-autoscaler/node-template/label/node-role.kubernetes.io/node" + propagate_at_launch = true + value = "" + } tag { key = "k8s.io/role/bastion" propagate_at_launch = true @@ -193,6 +203,16 @@ resource "aws_autoscaling_group" "master-us-test-1a-masters-privatekopeio-exampl propagate_at_launch = true value = "master-us-test-1a.masters.privatekopeio.example.com" } + tag { + key = "k8s.io/cluster-autoscaler/node-template/label/kubernetes.io/role" + propagate_at_launch = true + value = "master" + } + tag { + key = "k8s.io/cluster-autoscaler/node-template/label/node-role.kubernetes.io/master" + propagate_at_launch = true + value = "" + } tag { key = "k8s.io/role/master" propagate_at_launch = true @@ -231,6 +251,16 @@ resource "aws_autoscaling_group" "nodes-privatekopeio-example-com" { propagate_at_launch = true value = "nodes.privatekopeio.example.com" } + tag { + key = "k8s.io/cluster-autoscaler/node-template/label/kubernetes.io/role" + propagate_at_launch = true + value = "node" + } + tag { + key = "k8s.io/cluster-autoscaler/node-template/label/node-role.kubernetes.io/node" + propagate_at_launch = true + value = "" + } tag { key = "k8s.io/role/node" propagate_at_launch = true @@ -424,21 +454,25 @@ resource "aws_launch_template" "bastion-privatekopeio-example-com" { tag_specifications { resource_type = "instance" tags = { - "KubernetesCluster" = "privatekopeio.example.com" - "Name" = "bastion.privatekopeio.example.com" - "k8s.io/role/bastion" = "1" - "kops.k8s.io/instancegroup" = "bastion" - "kubernetes.io/cluster/privatekopeio.example.com" = "owned" + "KubernetesCluster" = "privatekopeio.example.com" + "Name" = "bastion.privatekopeio.example.com" + "k8s.io/cluster-autoscaler/node-template/label/kubernetes.io/role" = "node" + "k8s.io/cluster-autoscaler/node-template/label/node-role.kubernetes.io/node" = "" + "k8s.io/role/bastion" = "1" + "kops.k8s.io/instancegroup" = "bastion" + "kubernetes.io/cluster/privatekopeio.example.com" = "owned" } } tag_specifications { resource_type = "volume" tags = { - "KubernetesCluster" = "privatekopeio.example.com" - "Name" = "bastion.privatekopeio.example.com" - "k8s.io/role/bastion" = "1" - "kops.k8s.io/instancegroup" = "bastion" - "kubernetes.io/cluster/privatekopeio.example.com" = "owned" + "KubernetesCluster" = "privatekopeio.example.com" + "Name" = "bastion.privatekopeio.example.com" + "k8s.io/cluster-autoscaler/node-template/label/kubernetes.io/role" = "node" + "k8s.io/cluster-autoscaler/node-template/label/node-role.kubernetes.io/node" = "" + "k8s.io/role/bastion" = "1" + "kops.k8s.io/instancegroup" = "bastion" + "kubernetes.io/cluster/privatekopeio.example.com" = "owned" } } } @@ -474,21 +508,25 @@ resource "aws_launch_template" "master-us-test-1a-masters-privatekopeio-example- tag_specifications { resource_type = "instance" tags = { - "KubernetesCluster" = "privatekopeio.example.com" - "Name" = "master-us-test-1a.masters.privatekopeio.example.com" - "k8s.io/role/master" = "1" - "kops.k8s.io/instancegroup" = "master-us-test-1a" - "kubernetes.io/cluster/privatekopeio.example.com" = "owned" + "KubernetesCluster" = "privatekopeio.example.com" + "Name" = "master-us-test-1a.masters.privatekopeio.example.com" + "k8s.io/cluster-autoscaler/node-template/label/kubernetes.io/role" = "master" + "k8s.io/cluster-autoscaler/node-template/label/node-role.kubernetes.io/master" = "" + "k8s.io/role/master" = "1" + "kops.k8s.io/instancegroup" = "master-us-test-1a" + "kubernetes.io/cluster/privatekopeio.example.com" = "owned" } } tag_specifications { resource_type = "volume" tags = { - "KubernetesCluster" = "privatekopeio.example.com" - "Name" = "master-us-test-1a.masters.privatekopeio.example.com" - "k8s.io/role/master" = "1" - "kops.k8s.io/instancegroup" = "master-us-test-1a" - "kubernetes.io/cluster/privatekopeio.example.com" = "owned" + "KubernetesCluster" = "privatekopeio.example.com" + "Name" = "master-us-test-1a.masters.privatekopeio.example.com" + "k8s.io/cluster-autoscaler/node-template/label/kubernetes.io/role" = "master" + "k8s.io/cluster-autoscaler/node-template/label/node-role.kubernetes.io/master" = "" + "k8s.io/role/master" = "1" + "kops.k8s.io/instancegroup" = "master-us-test-1a" + "kubernetes.io/cluster/privatekopeio.example.com" = "owned" } } user_data = filebase64("${path.module}/data/aws_launch_template_master-us-test-1a.masters.privatekopeio.example.com_user_data") @@ -521,21 +559,25 @@ resource "aws_launch_template" "nodes-privatekopeio-example-com" { tag_specifications { resource_type = "instance" tags = { - "KubernetesCluster" = "privatekopeio.example.com" - "Name" = "nodes.privatekopeio.example.com" - "k8s.io/role/node" = "1" - "kops.k8s.io/instancegroup" = "nodes" - "kubernetes.io/cluster/privatekopeio.example.com" = "owned" + "KubernetesCluster" = "privatekopeio.example.com" + "Name" = "nodes.privatekopeio.example.com" + "k8s.io/cluster-autoscaler/node-template/label/kubernetes.io/role" = "node" + "k8s.io/cluster-autoscaler/node-template/label/node-role.kubernetes.io/node" = "" + "k8s.io/role/node" = "1" + "kops.k8s.io/instancegroup" = "nodes" + "kubernetes.io/cluster/privatekopeio.example.com" = "owned" } } tag_specifications { resource_type = "volume" tags = { - "KubernetesCluster" = "privatekopeio.example.com" - "Name" = "nodes.privatekopeio.example.com" - "k8s.io/role/node" = "1" - "kops.k8s.io/instancegroup" = "nodes" - "kubernetes.io/cluster/privatekopeio.example.com" = "owned" + "KubernetesCluster" = "privatekopeio.example.com" + "Name" = "nodes.privatekopeio.example.com" + "k8s.io/cluster-autoscaler/node-template/label/kubernetes.io/role" = "node" + "k8s.io/cluster-autoscaler/node-template/label/node-role.kubernetes.io/node" = "" + "k8s.io/role/node" = "1" + "kops.k8s.io/instancegroup" = "nodes" + "kubernetes.io/cluster/privatekopeio.example.com" = "owned" } } user_data = filebase64("${path.module}/data/aws_launch_template_nodes.privatekopeio.example.com_user_data") diff --git a/tests/integration/update_cluster/privateweave/kubernetes.tf b/tests/integration/update_cluster/privateweave/kubernetes.tf index a28d3f6da9833..6af72e1e9572d 100644 --- a/tests/integration/update_cluster/privateweave/kubernetes.tf +++ b/tests/integration/update_cluster/privateweave/kubernetes.tf @@ -140,6 +140,16 @@ resource "aws_autoscaling_group" "bastion-privateweave-example-com" { propagate_at_launch = true value = "bastion.privateweave.example.com" } + tag { + key = "k8s.io/cluster-autoscaler/node-template/label/kubernetes.io/role" + propagate_at_launch = true + value = "node" + } + tag { + key = "k8s.io/cluster-autoscaler/node-template/label/node-role.kubernetes.io/node" + propagate_at_launch = true + value = "" + } tag { key = "k8s.io/role/bastion" propagate_at_launch = true @@ -178,6 +188,16 @@ resource "aws_autoscaling_group" "master-us-test-1a-masters-privateweave-example propagate_at_launch = true value = "master-us-test-1a.masters.privateweave.example.com" } + tag { + key = "k8s.io/cluster-autoscaler/node-template/label/kubernetes.io/role" + propagate_at_launch = true + value = "master" + } + tag { + key = "k8s.io/cluster-autoscaler/node-template/label/node-role.kubernetes.io/master" + propagate_at_launch = true + value = "" + } tag { key = "k8s.io/role/master" propagate_at_launch = true @@ -216,6 +236,16 @@ resource "aws_autoscaling_group" "nodes-privateweave-example-com" { propagate_at_launch = true value = "nodes.privateweave.example.com" } + tag { + key = "k8s.io/cluster-autoscaler/node-template/label/kubernetes.io/role" + propagate_at_launch = true + value = "node" + } + tag { + key = "k8s.io/cluster-autoscaler/node-template/label/node-role.kubernetes.io/node" + propagate_at_launch = true + value = "" + } tag { key = "k8s.io/role/node" propagate_at_launch = true @@ -418,21 +448,25 @@ resource "aws_launch_template" "bastion-privateweave-example-com" { tag_specifications { resource_type = "instance" tags = { - "KubernetesCluster" = "privateweave.example.com" - "Name" = "bastion.privateweave.example.com" - "k8s.io/role/bastion" = "1" - "kops.k8s.io/instancegroup" = "bastion" - "kubernetes.io/cluster/privateweave.example.com" = "owned" + "KubernetesCluster" = "privateweave.example.com" + "Name" = "bastion.privateweave.example.com" + "k8s.io/cluster-autoscaler/node-template/label/kubernetes.io/role" = "node" + "k8s.io/cluster-autoscaler/node-template/label/node-role.kubernetes.io/node" = "" + "k8s.io/role/bastion" = "1" + "kops.k8s.io/instancegroup" = "bastion" + "kubernetes.io/cluster/privateweave.example.com" = "owned" } } tag_specifications { resource_type = "volume" tags = { - "KubernetesCluster" = "privateweave.example.com" - "Name" = "bastion.privateweave.example.com" - "k8s.io/role/bastion" = "1" - "kops.k8s.io/instancegroup" = "bastion" - "kubernetes.io/cluster/privateweave.example.com" = "owned" + "KubernetesCluster" = "privateweave.example.com" + "Name" = "bastion.privateweave.example.com" + "k8s.io/cluster-autoscaler/node-template/label/kubernetes.io/role" = "node" + "k8s.io/cluster-autoscaler/node-template/label/node-role.kubernetes.io/node" = "" + "k8s.io/role/bastion" = "1" + "kops.k8s.io/instancegroup" = "bastion" + "kubernetes.io/cluster/privateweave.example.com" = "owned" } } } @@ -468,21 +502,25 @@ resource "aws_launch_template" "master-us-test-1a-masters-privateweave-example-c tag_specifications { resource_type = "instance" tags = { - "KubernetesCluster" = "privateweave.example.com" - "Name" = "master-us-test-1a.masters.privateweave.example.com" - "k8s.io/role/master" = "1" - "kops.k8s.io/instancegroup" = "master-us-test-1a" - "kubernetes.io/cluster/privateweave.example.com" = "owned" + "KubernetesCluster" = "privateweave.example.com" + "Name" = "master-us-test-1a.masters.privateweave.example.com" + "k8s.io/cluster-autoscaler/node-template/label/kubernetes.io/role" = "master" + "k8s.io/cluster-autoscaler/node-template/label/node-role.kubernetes.io/master" = "" + "k8s.io/role/master" = "1" + "kops.k8s.io/instancegroup" = "master-us-test-1a" + "kubernetes.io/cluster/privateweave.example.com" = "owned" } } tag_specifications { resource_type = "volume" tags = { - "KubernetesCluster" = "privateweave.example.com" - "Name" = "master-us-test-1a.masters.privateweave.example.com" - "k8s.io/role/master" = "1" - "kops.k8s.io/instancegroup" = "master-us-test-1a" - "kubernetes.io/cluster/privateweave.example.com" = "owned" + "KubernetesCluster" = "privateweave.example.com" + "Name" = "master-us-test-1a.masters.privateweave.example.com" + "k8s.io/cluster-autoscaler/node-template/label/kubernetes.io/role" = "master" + "k8s.io/cluster-autoscaler/node-template/label/node-role.kubernetes.io/master" = "" + "k8s.io/role/master" = "1" + "kops.k8s.io/instancegroup" = "master-us-test-1a" + "kubernetes.io/cluster/privateweave.example.com" = "owned" } } user_data = filebase64("${path.module}/data/aws_launch_template_master-us-test-1a.masters.privateweave.example.com_user_data") @@ -515,21 +553,25 @@ resource "aws_launch_template" "nodes-privateweave-example-com" { tag_specifications { resource_type = "instance" tags = { - "KubernetesCluster" = "privateweave.example.com" - "Name" = "nodes.privateweave.example.com" - "k8s.io/role/node" = "1" - "kops.k8s.io/instancegroup" = "nodes" - "kubernetes.io/cluster/privateweave.example.com" = "owned" + "KubernetesCluster" = "privateweave.example.com" + "Name" = "nodes.privateweave.example.com" + "k8s.io/cluster-autoscaler/node-template/label/kubernetes.io/role" = "node" + "k8s.io/cluster-autoscaler/node-template/label/node-role.kubernetes.io/node" = "" + "k8s.io/role/node" = "1" + "kops.k8s.io/instancegroup" = "nodes" + "kubernetes.io/cluster/privateweave.example.com" = "owned" } } tag_specifications { resource_type = "volume" tags = { - "KubernetesCluster" = "privateweave.example.com" - "Name" = "nodes.privateweave.example.com" - "k8s.io/role/node" = "1" - "kops.k8s.io/instancegroup" = "nodes" - "kubernetes.io/cluster/privateweave.example.com" = "owned" + "KubernetesCluster" = "privateweave.example.com" + "Name" = "nodes.privateweave.example.com" + "k8s.io/cluster-autoscaler/node-template/label/kubernetes.io/role" = "node" + "k8s.io/cluster-autoscaler/node-template/label/node-role.kubernetes.io/node" = "" + "k8s.io/role/node" = "1" + "kops.k8s.io/instancegroup" = "nodes" + "kubernetes.io/cluster/privateweave.example.com" = "owned" } } user_data = filebase64("${path.module}/data/aws_launch_template_nodes.privateweave.example.com_user_data") diff --git a/tests/integration/update_cluster/shared_subnet/kubernetes.tf b/tests/integration/update_cluster/shared_subnet/kubernetes.tf index b53c29ee75338..3df8dd3ac3cf8 100644 --- a/tests/integration/update_cluster/shared_subnet/kubernetes.tf +++ b/tests/integration/update_cluster/shared_subnet/kubernetes.tf @@ -95,6 +95,16 @@ resource "aws_autoscaling_group" "master-us-test-1a-masters-sharedsubnet-example propagate_at_launch = true value = "master-us-test-1a.masters.sharedsubnet.example.com" } + tag { + key = "k8s.io/cluster-autoscaler/node-template/label/kubernetes.io/role" + propagate_at_launch = true + value = "master" + } + tag { + key = "k8s.io/cluster-autoscaler/node-template/label/node-role.kubernetes.io/master" + propagate_at_launch = true + value = "" + } tag { key = "k8s.io/role/master" propagate_at_launch = true @@ -133,6 +143,16 @@ resource "aws_autoscaling_group" "nodes-sharedsubnet-example-com" { propagate_at_launch = true value = "nodes.sharedsubnet.example.com" } + tag { + key = "k8s.io/cluster-autoscaler/node-template/label/kubernetes.io/role" + propagate_at_launch = true + value = "node" + } + tag { + key = "k8s.io/cluster-autoscaler/node-template/label/node-role.kubernetes.io/node" + propagate_at_launch = true + value = "" + } tag { key = "k8s.io/role/node" propagate_at_launch = true @@ -252,21 +272,25 @@ resource "aws_launch_template" "master-us-test-1a-masters-sharedsubnet-example-c tag_specifications { resource_type = "instance" tags = { - "KubernetesCluster" = "sharedsubnet.example.com" - "Name" = "master-us-test-1a.masters.sharedsubnet.example.com" - "k8s.io/role/master" = "1" - "kops.k8s.io/instancegroup" = "master-us-test-1a" - "kubernetes.io/cluster/sharedsubnet.example.com" = "owned" + "KubernetesCluster" = "sharedsubnet.example.com" + "Name" = "master-us-test-1a.masters.sharedsubnet.example.com" + "k8s.io/cluster-autoscaler/node-template/label/kubernetes.io/role" = "master" + "k8s.io/cluster-autoscaler/node-template/label/node-role.kubernetes.io/master" = "" + "k8s.io/role/master" = "1" + "kops.k8s.io/instancegroup" = "master-us-test-1a" + "kubernetes.io/cluster/sharedsubnet.example.com" = "owned" } } tag_specifications { resource_type = "volume" tags = { - "KubernetesCluster" = "sharedsubnet.example.com" - "Name" = "master-us-test-1a.masters.sharedsubnet.example.com" - "k8s.io/role/master" = "1" - "kops.k8s.io/instancegroup" = "master-us-test-1a" - "kubernetes.io/cluster/sharedsubnet.example.com" = "owned" + "KubernetesCluster" = "sharedsubnet.example.com" + "Name" = "master-us-test-1a.masters.sharedsubnet.example.com" + "k8s.io/cluster-autoscaler/node-template/label/kubernetes.io/role" = "master" + "k8s.io/cluster-autoscaler/node-template/label/node-role.kubernetes.io/master" = "" + "k8s.io/role/master" = "1" + "kops.k8s.io/instancegroup" = "master-us-test-1a" + "kubernetes.io/cluster/sharedsubnet.example.com" = "owned" } } user_data = filebase64("${path.module}/data/aws_launch_template_master-us-test-1a.masters.sharedsubnet.example.com_user_data") @@ -299,21 +323,25 @@ resource "aws_launch_template" "nodes-sharedsubnet-example-com" { tag_specifications { resource_type = "instance" tags = { - "KubernetesCluster" = "sharedsubnet.example.com" - "Name" = "nodes.sharedsubnet.example.com" - "k8s.io/role/node" = "1" - "kops.k8s.io/instancegroup" = "nodes" - "kubernetes.io/cluster/sharedsubnet.example.com" = "owned" + "KubernetesCluster" = "sharedsubnet.example.com" + "Name" = "nodes.sharedsubnet.example.com" + "k8s.io/cluster-autoscaler/node-template/label/kubernetes.io/role" = "node" + "k8s.io/cluster-autoscaler/node-template/label/node-role.kubernetes.io/node" = "" + "k8s.io/role/node" = "1" + "kops.k8s.io/instancegroup" = "nodes" + "kubernetes.io/cluster/sharedsubnet.example.com" = "owned" } } tag_specifications { resource_type = "volume" tags = { - "KubernetesCluster" = "sharedsubnet.example.com" - "Name" = "nodes.sharedsubnet.example.com" - "k8s.io/role/node" = "1" - "kops.k8s.io/instancegroup" = "nodes" - "kubernetes.io/cluster/sharedsubnet.example.com" = "owned" + "KubernetesCluster" = "sharedsubnet.example.com" + "Name" = "nodes.sharedsubnet.example.com" + "k8s.io/cluster-autoscaler/node-template/label/kubernetes.io/role" = "node" + "k8s.io/cluster-autoscaler/node-template/label/node-role.kubernetes.io/node" = "" + "k8s.io/role/node" = "1" + "kops.k8s.io/instancegroup" = "nodes" + "kubernetes.io/cluster/sharedsubnet.example.com" = "owned" } } user_data = filebase64("${path.module}/data/aws_launch_template_nodes.sharedsubnet.example.com_user_data") diff --git a/tests/integration/update_cluster/shared_vpc/kubernetes.tf b/tests/integration/update_cluster/shared_vpc/kubernetes.tf index f5150f5acb39f..37a656f65818f 100644 --- a/tests/integration/update_cluster/shared_vpc/kubernetes.tf +++ b/tests/integration/update_cluster/shared_vpc/kubernetes.tf @@ -95,6 +95,16 @@ resource "aws_autoscaling_group" "master-us-test-1a-masters-sharedvpc-example-co propagate_at_launch = true value = "master-us-test-1a.masters.sharedvpc.example.com" } + tag { + key = "k8s.io/cluster-autoscaler/node-template/label/kubernetes.io/role" + propagate_at_launch = true + value = "master" + } + tag { + key = "k8s.io/cluster-autoscaler/node-template/label/node-role.kubernetes.io/master" + propagate_at_launch = true + value = "" + } tag { key = "k8s.io/role/master" propagate_at_launch = true @@ -133,6 +143,16 @@ resource "aws_autoscaling_group" "nodes-sharedvpc-example-com" { propagate_at_launch = true value = "nodes.sharedvpc.example.com" } + tag { + key = "k8s.io/cluster-autoscaler/node-template/label/kubernetes.io/role" + propagate_at_launch = true + value = "node" + } + tag { + key = "k8s.io/cluster-autoscaler/node-template/label/node-role.kubernetes.io/node" + propagate_at_launch = true + value = "" + } tag { key = "k8s.io/role/node" propagate_at_launch = true @@ -252,21 +272,25 @@ resource "aws_launch_template" "master-us-test-1a-masters-sharedvpc-example-com" tag_specifications { resource_type = "instance" tags = { - "KubernetesCluster" = "sharedvpc.example.com" - "Name" = "master-us-test-1a.masters.sharedvpc.example.com" - "k8s.io/role/master" = "1" - "kops.k8s.io/instancegroup" = "master-us-test-1a" - "kubernetes.io/cluster/sharedvpc.example.com" = "owned" + "KubernetesCluster" = "sharedvpc.example.com" + "Name" = "master-us-test-1a.masters.sharedvpc.example.com" + "k8s.io/cluster-autoscaler/node-template/label/kubernetes.io/role" = "master" + "k8s.io/cluster-autoscaler/node-template/label/node-role.kubernetes.io/master" = "" + "k8s.io/role/master" = "1" + "kops.k8s.io/instancegroup" = "master-us-test-1a" + "kubernetes.io/cluster/sharedvpc.example.com" = "owned" } } tag_specifications { resource_type = "volume" tags = { - "KubernetesCluster" = "sharedvpc.example.com" - "Name" = "master-us-test-1a.masters.sharedvpc.example.com" - "k8s.io/role/master" = "1" - "kops.k8s.io/instancegroup" = "master-us-test-1a" - "kubernetes.io/cluster/sharedvpc.example.com" = "owned" + "KubernetesCluster" = "sharedvpc.example.com" + "Name" = "master-us-test-1a.masters.sharedvpc.example.com" + "k8s.io/cluster-autoscaler/node-template/label/kubernetes.io/role" = "master" + "k8s.io/cluster-autoscaler/node-template/label/node-role.kubernetes.io/master" = "" + "k8s.io/role/master" = "1" + "kops.k8s.io/instancegroup" = "master-us-test-1a" + "kubernetes.io/cluster/sharedvpc.example.com" = "owned" } } user_data = filebase64("${path.module}/data/aws_launch_template_master-us-test-1a.masters.sharedvpc.example.com_user_data") @@ -299,21 +323,25 @@ resource "aws_launch_template" "nodes-sharedvpc-example-com" { tag_specifications { resource_type = "instance" tags = { - "KubernetesCluster" = "sharedvpc.example.com" - "Name" = "nodes.sharedvpc.example.com" - "k8s.io/role/node" = "1" - "kops.k8s.io/instancegroup" = "nodes" - "kubernetes.io/cluster/sharedvpc.example.com" = "owned" + "KubernetesCluster" = "sharedvpc.example.com" + "Name" = "nodes.sharedvpc.example.com" + "k8s.io/cluster-autoscaler/node-template/label/kubernetes.io/role" = "node" + "k8s.io/cluster-autoscaler/node-template/label/node-role.kubernetes.io/node" = "" + "k8s.io/role/node" = "1" + "kops.k8s.io/instancegroup" = "nodes" + "kubernetes.io/cluster/sharedvpc.example.com" = "owned" } } tag_specifications { resource_type = "volume" tags = { - "KubernetesCluster" = "sharedvpc.example.com" - "Name" = "nodes.sharedvpc.example.com" - "k8s.io/role/node" = "1" - "kops.k8s.io/instancegroup" = "nodes" - "kubernetes.io/cluster/sharedvpc.example.com" = "owned" + "KubernetesCluster" = "sharedvpc.example.com" + "Name" = "nodes.sharedvpc.example.com" + "k8s.io/cluster-autoscaler/node-template/label/kubernetes.io/role" = "node" + "k8s.io/cluster-autoscaler/node-template/label/node-role.kubernetes.io/node" = "" + "k8s.io/role/node" = "1" + "kops.k8s.io/instancegroup" = "nodes" + "kubernetes.io/cluster/sharedvpc.example.com" = "owned" } } user_data = filebase64("${path.module}/data/aws_launch_template_nodes.sharedvpc.example.com_user_data") diff --git a/tests/integration/update_cluster/unmanaged/kubernetes.tf b/tests/integration/update_cluster/unmanaged/kubernetes.tf index 487ef8c8c6a72..4192a8a422a57 100644 --- a/tests/integration/update_cluster/unmanaged/kubernetes.tf +++ b/tests/integration/update_cluster/unmanaged/kubernetes.tf @@ -135,6 +135,16 @@ resource "aws_autoscaling_group" "bastion-unmanaged-example-com" { propagate_at_launch = true value = "bastion.unmanaged.example.com" } + tag { + key = "k8s.io/cluster-autoscaler/node-template/label/kubernetes.io/role" + propagate_at_launch = true + value = "node" + } + tag { + key = "k8s.io/cluster-autoscaler/node-template/label/node-role.kubernetes.io/node" + propagate_at_launch = true + value = "" + } tag { key = "k8s.io/role/bastion" propagate_at_launch = true @@ -173,6 +183,16 @@ resource "aws_autoscaling_group" "master-us-test-1a-masters-unmanaged-example-co propagate_at_launch = true value = "master-us-test-1a.masters.unmanaged.example.com" } + tag { + key = "k8s.io/cluster-autoscaler/node-template/label/kubernetes.io/role" + propagate_at_launch = true + value = "master" + } + tag { + key = "k8s.io/cluster-autoscaler/node-template/label/node-role.kubernetes.io/master" + propagate_at_launch = true + value = "" + } tag { key = "k8s.io/role/master" propagate_at_launch = true @@ -211,6 +231,16 @@ resource "aws_autoscaling_group" "nodes-unmanaged-example-com" { propagate_at_launch = true value = "nodes.unmanaged.example.com" } + tag { + key = "k8s.io/cluster-autoscaler/node-template/label/kubernetes.io/role" + propagate_at_launch = true + value = "node" + } + tag { + key = "k8s.io/cluster-autoscaler/node-template/label/node-role.kubernetes.io/node" + propagate_at_launch = true + value = "" + } tag { key = "k8s.io/role/node" propagate_at_launch = true @@ -395,21 +425,25 @@ resource "aws_launch_template" "bastion-unmanaged-example-com" { tag_specifications { resource_type = "instance" tags = { - "KubernetesCluster" = "unmanaged.example.com" - "Name" = "bastion.unmanaged.example.com" - "k8s.io/role/bastion" = "1" - "kops.k8s.io/instancegroup" = "bastion" - "kubernetes.io/cluster/unmanaged.example.com" = "owned" + "KubernetesCluster" = "unmanaged.example.com" + "Name" = "bastion.unmanaged.example.com" + "k8s.io/cluster-autoscaler/node-template/label/kubernetes.io/role" = "node" + "k8s.io/cluster-autoscaler/node-template/label/node-role.kubernetes.io/node" = "" + "k8s.io/role/bastion" = "1" + "kops.k8s.io/instancegroup" = "bastion" + "kubernetes.io/cluster/unmanaged.example.com" = "owned" } } tag_specifications { resource_type = "volume" tags = { - "KubernetesCluster" = "unmanaged.example.com" - "Name" = "bastion.unmanaged.example.com" - "k8s.io/role/bastion" = "1" - "kops.k8s.io/instancegroup" = "bastion" - "kubernetes.io/cluster/unmanaged.example.com" = "owned" + "KubernetesCluster" = "unmanaged.example.com" + "Name" = "bastion.unmanaged.example.com" + "k8s.io/cluster-autoscaler/node-template/label/kubernetes.io/role" = "node" + "k8s.io/cluster-autoscaler/node-template/label/node-role.kubernetes.io/node" = "" + "k8s.io/role/bastion" = "1" + "kops.k8s.io/instancegroup" = "bastion" + "kubernetes.io/cluster/unmanaged.example.com" = "owned" } } } @@ -445,21 +479,25 @@ resource "aws_launch_template" "master-us-test-1a-masters-unmanaged-example-com" tag_specifications { resource_type = "instance" tags = { - "KubernetesCluster" = "unmanaged.example.com" - "Name" = "master-us-test-1a.masters.unmanaged.example.com" - "k8s.io/role/master" = "1" - "kops.k8s.io/instancegroup" = "master-us-test-1a" - "kubernetes.io/cluster/unmanaged.example.com" = "owned" + "KubernetesCluster" = "unmanaged.example.com" + "Name" = "master-us-test-1a.masters.unmanaged.example.com" + "k8s.io/cluster-autoscaler/node-template/label/kubernetes.io/role" = "master" + "k8s.io/cluster-autoscaler/node-template/label/node-role.kubernetes.io/master" = "" + "k8s.io/role/master" = "1" + "kops.k8s.io/instancegroup" = "master-us-test-1a" + "kubernetes.io/cluster/unmanaged.example.com" = "owned" } } tag_specifications { resource_type = "volume" tags = { - "KubernetesCluster" = "unmanaged.example.com" - "Name" = "master-us-test-1a.masters.unmanaged.example.com" - "k8s.io/role/master" = "1" - "kops.k8s.io/instancegroup" = "master-us-test-1a" - "kubernetes.io/cluster/unmanaged.example.com" = "owned" + "KubernetesCluster" = "unmanaged.example.com" + "Name" = "master-us-test-1a.masters.unmanaged.example.com" + "k8s.io/cluster-autoscaler/node-template/label/kubernetes.io/role" = "master" + "k8s.io/cluster-autoscaler/node-template/label/node-role.kubernetes.io/master" = "" + "k8s.io/role/master" = "1" + "kops.k8s.io/instancegroup" = "master-us-test-1a" + "kubernetes.io/cluster/unmanaged.example.com" = "owned" } } user_data = filebase64("${path.module}/data/aws_launch_template_master-us-test-1a.masters.unmanaged.example.com_user_data") @@ -492,21 +530,25 @@ resource "aws_launch_template" "nodes-unmanaged-example-com" { tag_specifications { resource_type = "instance" tags = { - "KubernetesCluster" = "unmanaged.example.com" - "Name" = "nodes.unmanaged.example.com" - "k8s.io/role/node" = "1" - "kops.k8s.io/instancegroup" = "nodes" - "kubernetes.io/cluster/unmanaged.example.com" = "owned" + "KubernetesCluster" = "unmanaged.example.com" + "Name" = "nodes.unmanaged.example.com" + "k8s.io/cluster-autoscaler/node-template/label/kubernetes.io/role" = "node" + "k8s.io/cluster-autoscaler/node-template/label/node-role.kubernetes.io/node" = "" + "k8s.io/role/node" = "1" + "kops.k8s.io/instancegroup" = "nodes" + "kubernetes.io/cluster/unmanaged.example.com" = "owned" } } tag_specifications { resource_type = "volume" tags = { - "KubernetesCluster" = "unmanaged.example.com" - "Name" = "nodes.unmanaged.example.com" - "k8s.io/role/node" = "1" - "kops.k8s.io/instancegroup" = "nodes" - "kubernetes.io/cluster/unmanaged.example.com" = "owned" + "KubernetesCluster" = "unmanaged.example.com" + "Name" = "nodes.unmanaged.example.com" + "k8s.io/cluster-autoscaler/node-template/label/kubernetes.io/role" = "node" + "k8s.io/cluster-autoscaler/node-template/label/node-role.kubernetes.io/node" = "" + "k8s.io/role/node" = "1" + "kops.k8s.io/instancegroup" = "nodes" + "kubernetes.io/cluster/unmanaged.example.com" = "owned" } } user_data = filebase64("${path.module}/data/aws_launch_template_nodes.unmanaged.example.com_user_data")