diff --git a/cmd/kops/integration_test.go b/cmd/kops/integration_test.go index cd43aaa0e8..6c8f55bf49 100644 --- a/cmd/kops/integration_test.go +++ b/cmd/kops/integration_test.go @@ -170,8 +170,8 @@ func TestPhaseNetwork(t *testing.T) { } func TestExternalLoadBalancer(t *testing.T) { - runTestAWS(t, "externallb.example.com", "externallb", "v1alpha2", false, 1) - runTestCloudformation(t, "externallb.example.com", "externallb", "v1alpha2", false) + runTestAWS(t, "externallb.example.com", "externallb", "v1alpha2", false, 1, true) + runTestCloudformation(t, "externallb.example.com", "externallb", "v1alpha2", false, nil) } // TestPhaseIAM tests the output of tf for the iam phase diff --git a/tests/integration/update_cluster/externallb/cloudformation.json b/tests/integration/update_cluster/externallb/cloudformation.json index df3b0bbde6..a94696a473 100644 --- a/tests/integration/update_cluster/externallb/cloudformation.json +++ b/tests/integration/update_cluster/externallb/cloudformation.json @@ -134,7 +134,8 @@ "Ref": "AWSEC2SecurityGroupmastersexternallbexamplecom" } ], - "UserData": "extracted" + "UserData": "extracted", + "InstanceMonitoring": false } }, "AWSAutoScalingLaunchConfigurationnodesexternallbexamplecom": { @@ -162,7 +163,8 @@ "Ref": "AWSEC2SecurityGroupnodesexternallbexamplecom" } ], - "UserData": "extracted" + "UserData": "extracted", + "InstanceMonitoring": false } }, "AWSEC2DHCPOptionsexternallbexamplecom": { @@ -418,6 +420,10 @@ { "Key": "Name", "Value": "masters.externallb.example.com" + }, + { + "Key": "kubernetes.io/cluster/externallb.example.com", + "Value": "owned" } ] } @@ -437,6 +443,10 @@ { "Key": "Name", "Value": "nodes.externallb.example.com" + }, + { + "Key": "kubernetes.io/cluster/externallb.example.com", + "Value": "owned" } ] } @@ -551,6 +561,10 @@ { "Key": "k8s.io/role/master", "Value": "1" + }, + { + "Key": "kubernetes.io/cluster/externallb.example.com", + "Value": "owned" } ] } @@ -578,6 +592,10 @@ { "Key": "k8s.io/role/master", "Value": "1" + }, + { + "Key": "kubernetes.io/cluster/externallb.example.com", + "Value": "owned" } ] } @@ -620,8 +638,7 @@ "Effect": "Allow", "Resource": [ "*" - ], - "Sid": "kopsK8sEC2MasterPermsFullAccess" + ] }, { "Action": [ @@ -637,8 +654,7 @@ "Effect": "Allow", "Resource": [ "*" - ], - "Sid": "kopsK8sASMasterPerms" + ] }, { "Action": [ @@ -647,8 +663,7 @@ "Effect": "Allow", "Resource": [ "*" - ], - "Sid": "kopsK8sELBMasterPermsFullAccess" + ] }, { "Action": [ @@ -658,8 +673,7 @@ "Effect": "Allow", "Resource": [ "*" - ], - "Sid": "kopsMasterCertIAMPerms" + ] }, { "Action": [ @@ -670,8 +684,7 @@ "Effect": "Allow", "Resource": [ "arn:aws:route53:::hostedzone/Z1AFAKE1ZON3YO" - ], - "Sid": "kopsK8sRoute53Change" + ] }, { "Action": [ @@ -680,8 +693,7 @@ "Effect": "Allow", "Resource": [ "arn:aws:route53:::change/*" - ], - "Sid": "kopsK8sRoute53GetChanges" + ] }, { "Action": [ @@ -690,8 +702,7 @@ "Effect": "Allow", "Resource": [ "*" - ], - "Sid": "kopsK8sRoute53ListZones" + ] }, { "Action": [ @@ -700,8 +711,7 @@ "Effect": "Allow", "Resource": [ "*" - ], - "Sid": "" + ] }, { "Action": [ @@ -716,8 +726,7 @@ "Effect": "Allow", "Resource": [ "*" - ], - "Sid": "kopsK8sECR" + ] } ], "Version": "2012-10-17" @@ -743,8 +752,7 @@ "Effect": "Allow", "Resource": [ "*" - ], - "Sid": "kopsK8sEC2NodePerms" + ] }, { "Action": [ @@ -755,8 +763,7 @@ "Effect": "Allow", "Resource": [ "arn:aws:route53:::hostedzone/Z1AFAKE1ZON3YO" - ], - "Sid": "kopsK8sRoute53Change" + ] }, { "Action": [ @@ -765,8 +772,7 @@ "Effect": "Allow", "Resource": [ "arn:aws:route53:::change/*" - ], - "Sid": "kopsK8sRoute53GetChanges" + ] }, { "Action": [ @@ -775,8 +781,7 @@ "Effect": "Allow", "Resource": [ "*" - ], - "Sid": "kopsK8sRoute53ListZones" + ] }, { "Action": [ @@ -785,8 +790,7 @@ "Effect": "Allow", "Resource": [ "*" - ], - "Sid": "" + ] }, { "Action": [ @@ -801,8 +805,7 @@ "Effect": "Allow", "Resource": [ "*" - ], - "Sid": "kopsK8sECR" + ] } ], "Version": "2012-10-17" diff --git a/tests/integration/update_cluster/externallb/cloudformation.json.extracted.yaml b/tests/integration/update_cluster/externallb/cloudformation.json.extracted.yaml index 9739657c97..4318b787eb 100644 --- a/tests/integration/update_cluster/externallb/cloudformation.json.extracted.yaml +++ b/tests/integration/update_cluster/externallb/cloudformation.json.extracted.yaml @@ -21,7 +21,7 @@ Resources.AWSAutoScalingLaunchConfigurationmasterustest1amastersexternallbexampl NODEUP_URL=https://kubeupv2.s3.amazonaws.com/kops/1.8.1/linux/amd64/nodeup NODEUP_HASH=bb41724c37d15ab7e039e06230e742b9b38d0808 - + export AWS_REGION=us-test-1 @@ -141,7 +141,6 @@ Resources.AWSAutoScalingLaunchConfigurationmasterustest1amastersexternallbexampl cat > cluster_spec.yaml << '__EOF_CLUSTER_SPEC' cloudConfig: null docker: - bridge: "" ipMasq: false ipTables: false logDriver: json-file @@ -318,7 +317,7 @@ Resources.AWSAutoScalingLaunchConfigurationnodesexternallbexamplecom.Properties. NODEUP_URL=https://kubeupv2.s3.amazonaws.com/kops/1.8.1/linux/amd64/nodeup NODEUP_HASH=bb41724c37d15ab7e039e06230e742b9b38d0808 - + export AWS_REGION=us-test-1 @@ -438,7 +437,6 @@ Resources.AWSAutoScalingLaunchConfigurationnodesexternallbexamplecom.Properties. cat > cluster_spec.yaml << '__EOF_CLUSTER_SPEC' cloudConfig: null docker: - bridge: "" ipMasq: false ipTables: false logDriver: json-file diff --git a/tests/integration/update_cluster/externallb/kubernetes.tf b/tests/integration/update_cluster/externallb/kubernetes.tf index 565a67d647..9daa9f569e 100644 --- a/tests/integration/update_cluster/externallb/kubernetes.tf +++ b/tests/integration/update_cluster/externallb/kubernetes.tf @@ -34,6 +34,18 @@ output "region" { value = "us-test-1" } +output "route_table_public_id" { + value = "${aws_route_table.externallb-example-com.id}" +} + +output "subnet_us-test-1a-public_id" { + value = "${aws_subnet.us-test-1a-externallb-example-com.id}" +} + +output "vpc_cidr_block" { + value = "${aws_vpc.externallb-example-com.cidr_block}" +} + output "vpc_id" { value = "${aws_vpc.externallb-example-com.id}" } @@ -122,10 +134,11 @@ resource "aws_ebs_volume" "us-test-1a-etcd-events-externallb-example-com" { encrypted = false tags = { - KubernetesCluster = "externallb.example.com" - Name = "us-test-1a.etcd-events.externallb.example.com" - "k8s.io/etcd/events" = "us-test-1a/us-test-1a" - "k8s.io/role/master" = "1" + KubernetesCluster = "externallb.example.com" + Name = "us-test-1a.etcd-events.externallb.example.com" + "k8s.io/etcd/events" = "us-test-1a/us-test-1a" + "k8s.io/role/master" = "1" + "kubernetes.io/cluster/externallb.example.com" = "owned" } } @@ -136,10 +149,11 @@ resource "aws_ebs_volume" "us-test-1a-etcd-main-externallb-example-com" { encrypted = false tags = { - KubernetesCluster = "externallb.example.com" - Name = "us-test-1a.etcd-main.externallb.example.com" - "k8s.io/etcd/main" = "us-test-1a/us-test-1a" - "k8s.io/role/master" = "1" + KubernetesCluster = "externallb.example.com" + Name = "us-test-1a.etcd-main.externallb.example.com" + "k8s.io/etcd/main" = "us-test-1a/us-test-1a" + "k8s.io/role/master" = "1" + "kubernetes.io/cluster/externallb.example.com" = "owned" } } @@ -214,6 +228,8 @@ resource "aws_launch_configuration" "master-us-test-1a-masters-externallb-exampl lifecycle = { create_before_destroy = true } + + enable_monitoring = false } resource "aws_launch_configuration" "nodes-externallb-example-com" { @@ -235,6 +251,8 @@ resource "aws_launch_configuration" "nodes-externallb-example-com" { lifecycle = { create_before_destroy = true } + + enable_monitoring = false } resource "aws_route" "0-0-0-0--0" { @@ -265,8 +283,9 @@ resource "aws_security_group" "masters-externallb-example-com" { description = "Security group for masters" tags = { - KubernetesCluster = "externallb.example.com" - Name = "masters.externallb.example.com" + KubernetesCluster = "externallb.example.com" + Name = "masters.externallb.example.com" + "kubernetes.io/cluster/externallb.example.com" = "owned" } } @@ -276,8 +295,9 @@ resource "aws_security_group" "nodes-externallb-example-com" { description = "Security group for nodes" tags = { - KubernetesCluster = "externallb.example.com" - Name = "nodes.externallb.example.com" + KubernetesCluster = "externallb.example.com" + Name = "nodes.externallb.example.com" + "kubernetes.io/cluster/externallb.example.com" = "owned" } }