From 54c280eed56ccd8ba6dc9eccadcde31f69818c65 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 --- .../adds-additional-security-groups.yaml | 2 + .../adds-cloud-labels-from-ClusterSpec.yaml | 2 + ...s-cloud-labels-from-InstanceGroupSpec.yaml | 2 + ...ithout-bastion-auto-zone-distribution.yaml | 12 ++ ...without-bastion-with-API-loadbalancer.yaml | 12 ++ ...tup-3-masters-3-nodes-without-bastion.yaml | 12 ++ ...sters-3-nodes-without-external-router.yaml | 12 ++ .../one-master-one-node-one-bastion-2.yaml | 6 + .../one-master-one-node-one-bastion.yaml | 6 + ...hout-bastion-no-public-ip-association.yaml | 4 + .../servergroup/one-master-one-node.yaml | 4 + ...subnet-as-availability-zones-fallback.yaml | 2 + ...nce-group-zones-as-availability-zones.yaml | 2 + .../bastionadditional_user-data/kubernetes.tf | 138 ++++++++----- .../complex/cloudformation.json | 52 +++++ .../update_cluster/complex/kubernetes.tf | 116 +++++++---- .../cloudformation.json | 52 +++++ .../update_cluster/existing_iam/kubernetes.tf | 184 ++++++++++++------ .../cloudformation.json | 52 +++++ .../update_cluster/existing_sg/kubernetes.tf | 184 ++++++++++++------ .../externallb/cloudformation.json | 52 +++++ .../update_cluster/externallb/kubernetes.tf | 92 ++++++--- .../externalpolicies/kubernetes.tf | 116 +++++++---- .../update_cluster/ha/kubernetes.tf | 184 ++++++++++++------ .../launch_templates/cloudformation.json | 40 ++++ .../launch_templates/kubernetes.tf | 40 ++++ .../cloudformation.json | 52 +++++ .../minimal-json/kubernetes.tf.json | 32 +++ .../update_cluster/minimal-tf11/kubernetes.tf | 96 ++++++--- .../update_cluster/minimal/kubernetes.tf | 92 ++++++--- .../mixed_instances/cloudformation.json | 104 ++++++++++ .../mixed_instances/kubernetes.tf | 184 ++++++++++++------ .../mixed_instances_spot/cloudformation.json | 104 ++++++++++ .../mixed_instances_spot/kubernetes.tf | 184 ++++++++++++------ .../private-shared-subnet/kubernetes.tf | 138 ++++++++----- .../privatecalico/cloudformation.json | 78 ++++++++ .../privatecalico/kubernetes.tf | 138 ++++++++----- .../update_cluster/privatecanal/kubernetes.tf | 138 ++++++++----- .../privatecilium/cloudformation.json | 78 ++++++++ .../privatecilium/kubernetes.tf | 138 ++++++++----- .../privatecilium2/cloudformation.json | 78 ++++++++ .../privatecilium2/kubernetes.tf | 138 ++++++++----- .../privateciliumadvanced/cloudformation.json | 78 ++++++++ .../privateciliumadvanced/kubernetes.tf | 138 ++++++++----- .../update_cluster/privatedns1/kubernetes.tf | 174 +++++++++++------ .../update_cluster/privatedns2/kubernetes.tf | 138 ++++++++----- .../privateflannel/kubernetes.tf | 138 ++++++++----- .../privatekopeio/kubernetes.tf | 138 ++++++++----- .../update_cluster/privateweave/kubernetes.tf | 138 ++++++++----- .../update_cluster/public-jwks/kubernetes.tf | 92 ++++++--- .../shared_subnet/kubernetes.tf | 92 ++++++--- .../update_cluster/shared_vpc/kubernetes.tf | 92 ++++++--- .../update_cluster/unmanaged/kubernetes.tf | 138 ++++++++----- 53 files changed, 3341 insertions(+), 1167 deletions(-) diff --git a/pkg/model/openstackmodel/tests/servergroup/adds-additional-security-groups.yaml b/pkg/model/openstackmodel/tests/servergroup/adds-additional-security-groups.yaml index f1ad0d5f4825d..6d3843ac7cd10 100644 --- a/pkg/model/openstackmodel/tests/servergroup/adds-additional-security-groups.yaml +++ b/pkg/model/openstackmodel/tests/servergroup/adds-additional-security-groups.yaml @@ -15,6 +15,8 @@ Metadata: cluster_generation: "0" ig_generation: "0" k8s: cluster + 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: node Name: node-1-cluster diff --git a/pkg/model/openstackmodel/tests/servergroup/adds-cloud-labels-from-ClusterSpec.yaml b/pkg/model/openstackmodel/tests/servergroup/adds-cloud-labels-from-ClusterSpec.yaml index e9695bd8ca602..eed66c1902b14 100644 --- a/pkg/model/openstackmodel/tests/servergroup/adds-cloud-labels-from-ClusterSpec.yaml +++ b/pkg/model/openstackmodel/tests/servergroup/adds-cloud-labels-from-ClusterSpec.yaml @@ -15,6 +15,8 @@ Metadata: cluster_generation: "0" ig_generation: "0" k8s: cluster + 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: node some___:x: label diff --git a/pkg/model/openstackmodel/tests/servergroup/adds-cloud-labels-from-InstanceGroupSpec.yaml b/pkg/model/openstackmodel/tests/servergroup/adds-cloud-labels-from-InstanceGroupSpec.yaml index e9695bd8ca602..eed66c1902b14 100644 --- a/pkg/model/openstackmodel/tests/servergroup/adds-cloud-labels-from-InstanceGroupSpec.yaml +++ b/pkg/model/openstackmodel/tests/servergroup/adds-cloud-labels-from-InstanceGroupSpec.yaml @@ -15,6 +15,8 @@ Metadata: cluster_generation: "0" ig_generation: "0" k8s: cluster + 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: node some___:x: label diff --git a/pkg/model/openstackmodel/tests/servergroup/multizone-setup-3-masters-3-nodes-without-bastion-auto-zone-distribution.yaml b/pkg/model/openstackmodel/tests/servergroup/multizone-setup-3-masters-3-nodes-without-bastion-auto-zone-distribution.yaml index 0f22686ddfe23..26815d8fd107d 100644 --- a/pkg/model/openstackmodel/tests/servergroup/multizone-setup-3-masters-3-nodes-without-bastion-auto-zone-distribution.yaml +++ b/pkg/model/openstackmodel/tests/servergroup/multizone-setup-3-masters-3-nodes-without-bastion-auto-zone-distribution.yaml @@ -65,6 +65,8 @@ Metadata: cluster_generation: "0" ig_generation: "0" k8s: cluster + 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 Name: master-1-cluster @@ -141,6 +143,8 @@ Metadata: cluster_generation: "0" ig_generation: "0" k8s: cluster + 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 Name: master-2-cluster @@ -217,6 +221,8 @@ Metadata: cluster_generation: "0" ig_generation: "0" k8s: cluster + 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 Name: master-3-cluster @@ -293,6 +299,8 @@ Metadata: cluster_generation: "0" ig_generation: "0" k8s: cluster + 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: node Name: node-1-cluster @@ -363,6 +371,8 @@ Metadata: cluster_generation: "0" ig_generation: "0" k8s: cluster + 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: node Name: node-2-cluster @@ -433,6 +443,8 @@ Metadata: cluster_generation: "0" ig_generation: "0" k8s: cluster + 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: node Name: node-3-cluster diff --git a/pkg/model/openstackmodel/tests/servergroup/multizone-setup-3-masters-3-nodes-without-bastion-with-API-loadbalancer.yaml b/pkg/model/openstackmodel/tests/servergroup/multizone-setup-3-masters-3-nodes-without-bastion-with-API-loadbalancer.yaml index 386d35da2fab1..5eb3f8b25add1 100644 --- a/pkg/model/openstackmodel/tests/servergroup/multizone-setup-3-masters-3-nodes-without-bastion-with-API-loadbalancer.yaml +++ b/pkg/model/openstackmodel/tests/servergroup/multizone-setup-3-masters-3-nodes-without-bastion-with-API-loadbalancer.yaml @@ -66,6 +66,8 @@ Metadata: cluster_generation: "0" ig_generation: "0" k8s: cluster + 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-a Name: master-a-1-cluster @@ -130,6 +132,8 @@ Metadata: cluster_generation: "0" ig_generation: "0" k8s: cluster + 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-b Name: master-b-1-cluster @@ -194,6 +198,8 @@ Metadata: cluster_generation: "0" ig_generation: "0" k8s: cluster + 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-c Name: master-c-1-cluster @@ -264,6 +270,8 @@ Metadata: cluster_generation: "0" ig_generation: "0" k8s: cluster + 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: node-a Name: node-a-1-cluster @@ -334,6 +342,8 @@ Metadata: cluster_generation: "0" ig_generation: "0" k8s: cluster + 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: node-b Name: node-b-1-cluster @@ -404,6 +414,8 @@ Metadata: cluster_generation: "0" ig_generation: "0" k8s: cluster + 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: node-c Name: node-c-1-cluster diff --git a/pkg/model/openstackmodel/tests/servergroup/multizone-setup-3-masters-3-nodes-without-bastion.yaml b/pkg/model/openstackmodel/tests/servergroup/multizone-setup-3-masters-3-nodes-without-bastion.yaml index fd2b4b1631fd6..a6a99f2d35c0f 100644 --- a/pkg/model/openstackmodel/tests/servergroup/multizone-setup-3-masters-3-nodes-without-bastion.yaml +++ b/pkg/model/openstackmodel/tests/servergroup/multizone-setup-3-masters-3-nodes-without-bastion.yaml @@ -73,6 +73,8 @@ Metadata: cluster_generation: "0" ig_generation: "0" k8s: cluster + 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-a Name: master-a-1-cluster @@ -149,6 +151,8 @@ Metadata: cluster_generation: "0" ig_generation: "0" k8s: cluster + 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-b Name: master-b-1-cluster @@ -225,6 +229,8 @@ Metadata: cluster_generation: "0" ig_generation: "0" k8s: cluster + 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-c Name: master-c-1-cluster @@ -301,6 +307,8 @@ Metadata: cluster_generation: "0" ig_generation: "0" k8s: cluster + 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: node-a Name: node-a-1-cluster @@ -371,6 +379,8 @@ Metadata: cluster_generation: "0" ig_generation: "0" k8s: cluster + 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: node-b Name: node-b-1-cluster @@ -441,6 +451,8 @@ Metadata: cluster_generation: "0" ig_generation: "0" k8s: cluster + 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: node-c Name: node-c-1-cluster diff --git a/pkg/model/openstackmodel/tests/servergroup/multizone-setup-3-masters-3-nodes-without-external-router.yaml b/pkg/model/openstackmodel/tests/servergroup/multizone-setup-3-masters-3-nodes-without-external-router.yaml index f545891553d33..81a6040296e90 100644 --- a/pkg/model/openstackmodel/tests/servergroup/multizone-setup-3-masters-3-nodes-without-external-router.yaml +++ b/pkg/model/openstackmodel/tests/servergroup/multizone-setup-3-masters-3-nodes-without-external-router.yaml @@ -25,6 +25,8 @@ Metadata: cluster_generation: "0" ig_generation: "0" k8s: cluster + 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-a Name: master-a-1-cluster @@ -95,6 +97,8 @@ Metadata: cluster_generation: "0" ig_generation: "0" k8s: cluster + 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-b Name: master-b-1-cluster @@ -165,6 +169,8 @@ Metadata: cluster_generation: "0" ig_generation: "0" k8s: cluster + 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-c Name: master-c-1-cluster @@ -235,6 +241,8 @@ Metadata: cluster_generation: "0" ig_generation: "0" k8s: cluster + 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: node-a Name: node-a-1-cluster @@ -299,6 +307,8 @@ Metadata: cluster_generation: "0" ig_generation: "0" k8s: cluster + 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: node-b Name: node-b-1-cluster @@ -363,6 +373,8 @@ Metadata: cluster_generation: "0" ig_generation: "0" k8s: cluster + 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: node-c Name: node-c-1-cluster diff --git a/pkg/model/openstackmodel/tests/servergroup/one-master-one-node-one-bastion-2.yaml b/pkg/model/openstackmodel/tests/servergroup/one-master-one-node-one-bastion-2.yaml index 81754889019f0..f98917c5a06f2 100644 --- a/pkg/model/openstackmodel/tests/servergroup/one-master-one-node-one-bastion-2.yaml +++ b/pkg/model/openstackmodel/tests/servergroup/one-master-one-node-one-bastion-2.yaml @@ -18,6 +18,8 @@ Metadata: cluster_generation: "0" ig_generation: "0" k8s: cluster + 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 Name: bastion-1-cluster @@ -82,6 +84,8 @@ Metadata: cluster_generation: "0" ig_generation: "0" k8s: cluster + 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 Name: master-1-cluster @@ -152,6 +156,8 @@ Metadata: cluster_generation: "0" ig_generation: "0" k8s: cluster + 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: node Name: node-1-cluster diff --git a/pkg/model/openstackmodel/tests/servergroup/one-master-one-node-one-bastion.yaml b/pkg/model/openstackmodel/tests/servergroup/one-master-one-node-one-bastion.yaml index 7c972ad62942d..1d328302877f6 100644 --- a/pkg/model/openstackmodel/tests/servergroup/one-master-one-node-one-bastion.yaml +++ b/pkg/model/openstackmodel/tests/servergroup/one-master-one-node-one-bastion.yaml @@ -38,6 +38,8 @@ Metadata: cluster_generation: "0" ig_generation: "0" k8s: cluster + 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 Name: bastion-1-cluster @@ -108,6 +110,8 @@ Metadata: cluster_generation: "0" ig_generation: "0" k8s: cluster + 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 Name: master-1-cluster @@ -178,6 +182,8 @@ Metadata: cluster_generation: "0" ig_generation: "0" k8s: cluster + 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: node Name: node-1-cluster diff --git a/pkg/model/openstackmodel/tests/servergroup/one-master-one-node-without-bastion-no-public-ip-association.yaml b/pkg/model/openstackmodel/tests/servergroup/one-master-one-node-without-bastion-no-public-ip-association.yaml index e2e3e1eb1b224..4a1c42c816fa7 100644 --- a/pkg/model/openstackmodel/tests/servergroup/one-master-one-node-without-bastion-no-public-ip-association.yaml +++ b/pkg/model/openstackmodel/tests/servergroup/one-master-one-node-without-bastion-no-public-ip-association.yaml @@ -17,6 +17,8 @@ Metadata: cluster_generation: "0" ig_generation: "0" k8s: cluster + 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 Name: master-1-cluster @@ -87,6 +89,8 @@ Metadata: cluster_generation: "0" ig_generation: "0" k8s: cluster + 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: node Name: node-1-cluster diff --git a/pkg/model/openstackmodel/tests/servergroup/one-master-one-node.yaml b/pkg/model/openstackmodel/tests/servergroup/one-master-one-node.yaml index f05e822e91425..0ce90f492e878 100644 --- a/pkg/model/openstackmodel/tests/servergroup/one-master-one-node.yaml +++ b/pkg/model/openstackmodel/tests/servergroup/one-master-one-node.yaml @@ -37,6 +37,8 @@ Metadata: cluster_generation: "0" ig_generation: "0" k8s: cluster + 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 Name: master-1-cluster @@ -113,6 +115,8 @@ Metadata: cluster_generation: "0" ig_generation: "0" k8s: cluster + 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: node Name: node-1-cluster diff --git a/pkg/model/openstackmodel/tests/servergroup/uses-instance-group-subnet-as-availability-zones-fallback.yaml b/pkg/model/openstackmodel/tests/servergroup/uses-instance-group-subnet-as-availability-zones-fallback.yaml index 24d4fd594a891..a9981c0a7d713 100644 --- a/pkg/model/openstackmodel/tests/servergroup/uses-instance-group-subnet-as-availability-zones-fallback.yaml +++ b/pkg/model/openstackmodel/tests/servergroup/uses-instance-group-subnet-as-availability-zones-fallback.yaml @@ -15,6 +15,8 @@ Metadata: cluster_generation: "0" ig_generation: "0" k8s: cluster + 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: node Name: node-1-cluster diff --git a/pkg/model/openstackmodel/tests/servergroup/uses-instance-group-zones-as-availability-zones.yaml b/pkg/model/openstackmodel/tests/servergroup/uses-instance-group-zones-as-availability-zones.yaml index 8b5aa501fc1ec..9299aa452aaee 100644 --- a/pkg/model/openstackmodel/tests/servergroup/uses-instance-group-zones-as-availability-zones.yaml +++ b/pkg/model/openstackmodel/tests/servergroup/uses-instance-group-zones-as-availability-zones.yaml @@ -15,6 +15,8 @@ Metadata: cluster_generation: "0" ig_generation: "0" k8s: cluster + 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: node Name: node-1-cluster diff --git a/tests/integration/update_cluster/bastionadditional_user-data/kubernetes.tf b/tests/integration/update_cluster/bastionadditional_user-data/kubernetes.tf index 2cd9afd8f4ce9..f2b1af99acdcf 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 @@ -416,29 +446,35 @@ 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" } } 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") } @@ -474,29 +510,35 @@ 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" } } 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") } @@ -528,29 +570,35 @@ 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" } } 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 9e40b2886e3a5..7244a1f2d513e 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", @@ -274,6 +294,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" @@ -307,6 +335,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" @@ -391,6 +427,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" @@ -424,6 +468,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 98ed770b9433c..ede925037bd91 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 @@ -318,35 +338,41 @@ 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" } } 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") } @@ -386,35 +412,41 @@ 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" } } 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 4c4affd2cc264..e7afe43924b2b 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,29 +396,35 @@ 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" } } 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") } @@ -414,29 +460,35 @@ 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" } } 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") } @@ -472,29 +524,35 @@ 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" } } 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") } @@ -526,29 +584,35 @@ 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" } } 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 c8754e9798d68..2d7b9d185cd79 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 @@ -449,29 +489,35 @@ 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" } } 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") } @@ -507,29 +553,35 @@ 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" } } 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") } @@ -565,29 +617,35 @@ 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" } } 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") } @@ -619,29 +677,35 @@ 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" } } 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 542878f1e4d13..d7103ac252e5c 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,29 +301,35 @@ 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" } } 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") } @@ -335,29 +361,35 @@ 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" } } 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 87952ae8ae549..c1816e196af56 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 @@ -338,35 +358,41 @@ 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" } } 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") } @@ -398,35 +424,41 @@ 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" } } 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 fc634f558c3ff..d2e8d794fdf13 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,29 +448,35 @@ 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" } } 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") } @@ -466,29 +512,35 @@ 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" } } 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") } @@ -524,29 +576,35 @@ 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" } } 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") } @@ -578,29 +636,35 @@ 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" } } 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 91463a6ad7c82..0a5d7df83436c 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", @@ -314,6 +334,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" @@ -324,6 +346,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" @@ -334,6 +358,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" @@ -379,6 +405,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" @@ -389,6 +417,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" @@ -399,6 +429,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 d4632131e5e8a..133d6f4c776d3 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" @@ -292,22 +316,26 @@ resource "aws_launch_template" "master-us-test-1a-masters-minimal-tf11-example-c } 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" } tag_specifications = { 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" } } @@ -315,11 +343,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" } } @@ -358,22 +388,26 @@ resource "aws_launch_template" "nodes-minimal-tf11-example-com" { } 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" } tag_specifications = { 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" } } @@ -381,11 +415,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 552d222f92185..ae646a8a84b66 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,29 +286,35 @@ 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" } } 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") } @@ -320,29 +346,35 @@ 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" } } 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 eb9ba206c02e3..252b21c2aaa7a 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,29 +466,35 @@ 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" } } 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") } @@ -484,29 +530,35 @@ 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" } } 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") } @@ -542,29 +594,35 @@ 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" } } 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") } @@ -596,29 +654,35 @@ 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" } } 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 54347a4480542..d6506dbac108e 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,29 +466,35 @@ 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" } } 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") } @@ -484,29 +530,35 @@ 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" } } 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") } @@ -542,29 +594,35 @@ 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" } } 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") } @@ -596,29 +654,35 @@ 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" } } 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 a6121e0838275..2cee5ce7a056c 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 @@ -388,29 +418,35 @@ 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" } } 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" } } @@ -445,29 +481,35 @@ 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" } } 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") } @@ -499,29 +541,35 @@ 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" } } 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 98181269a619a..a2a06066b6f00 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 @@ -416,29 +446,35 @@ 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" } } 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" } } @@ -473,29 +509,35 @@ 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" } } 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") } @@ -527,29 +569,35 @@ 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" } } 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 c6b778c86ac72..5eb90f1e37937 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 @@ -416,29 +446,35 @@ 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" } } 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" } } @@ -473,29 +509,35 @@ 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" } } 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") } @@ -527,29 +569,35 @@ 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" } } 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 917594bef77ec..2f560d354a2d9 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 @@ -416,29 +446,35 @@ 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" } } 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" } } @@ -473,29 +509,35 @@ 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" } } 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") } @@ -527,29 +569,35 @@ 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" } } 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 917594bef77ec..2f560d354a2d9 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 @@ -416,29 +446,35 @@ 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" } } 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" } } @@ -473,29 +509,35 @@ 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" } } 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") } @@ -527,29 +569,35 @@ 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" } } 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 4a079fe617699..8d9d6c07978c6 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 @@ -430,29 +460,35 @@ 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" } } 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" } } @@ -487,29 +523,35 @@ 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" } } 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") } @@ -541,29 +583,35 @@ 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" } } 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 7c3f981be6359..d9d3c35c95884 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 @@ -460,35 +490,41 @@ 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" } } 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" } } @@ -523,35 +559,41 @@ 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" } } 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") } @@ -583,35 +625,41 @@ 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" } } 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 8e85b910537a7..44a21e4b57318 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 @@ -402,29 +432,35 @@ 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" } } 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" } } @@ -459,29 +495,35 @@ 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" } } 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") } @@ -513,29 +555,35 @@ 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" } } 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 f8e6bc8af3ff9..462c99c24ed63 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 @@ -416,29 +446,35 @@ 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" } } 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" } } @@ -473,29 +509,35 @@ 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" } } 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") } @@ -527,29 +569,35 @@ 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" } } 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 b464493383540..439c850121f6b 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 @@ -422,29 +452,35 @@ 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" } } 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" } } @@ -479,29 +515,35 @@ 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" } } 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") } @@ -533,29 +575,35 @@ 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" } } 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 9ba52faeb268d..52b85f89fd467 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 @@ -416,29 +446,35 @@ 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" } } 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" } } @@ -473,29 +509,35 @@ 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" } } 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") } @@ -527,29 +569,35 @@ 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" } } 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/public-jwks/kubernetes.tf b/tests/integration/update_cluster/public-jwks/kubernetes.tf index c01a09d30b1f8..7e201218c9783 100644 --- a/tests/integration/update_cluster/public-jwks/kubernetes.tf +++ b/tests/integration/update_cluster/public-jwks/kubernetes.tf @@ -110,6 +110,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 @@ -148,6 +158,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 @@ -293,29 +313,35 @@ 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" } } 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") } @@ -347,29 +373,35 @@ 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" } } 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/shared_subnet/kubernetes.tf b/tests/integration/update_cluster/shared_subnet/kubernetes.tf index b0a50a643eea4..b5da2511d645f 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,29 +272,35 @@ 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" } } 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") } @@ -306,29 +332,35 @@ 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" } } 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 c76ae3fc3687b..c318df5ff07e5 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,29 +272,35 @@ 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" } } 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") } @@ -306,29 +332,35 @@ 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" } } 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 2d8f7b9f58327..9132ef700e670 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 @@ -393,29 +423,35 @@ 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" } } 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" } } @@ -450,29 +486,35 @@ 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" } } 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") } @@ -504,29 +546,35 @@ 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" } } 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") }