Skip to content

Commit

Permalink
Update the complex integration test to cover CloudFormation output of…
Browse files Browse the repository at this point in the history
… NAT gateways
  • Loading branch information
rifelpet committed Dec 6, 2019
1 parent b60fbff commit 8b7ecb4
Show file tree
Hide file tree
Showing 4 changed files with 502 additions and 17 deletions.
291 changes: 291 additions & 0 deletions tests/integration/update_cluster/complex/cloudformation.json
Original file line number Diff line number Diff line change
Expand Up @@ -226,6 +226,26 @@
]
}
},
"AWSEC2EIPustest1bcomplexexamplecom": {
"Type": "AWS::EC2::EIP",
"Properties": {
"Domain": "vpc",
"Tags": [
{
"Key": "KubernetesCluster",
"Value": "complex.example.com"
},
{
"Key": "Name",
"Value": "us-test-1b.complex.example.com"
},
{
"Key": "kubernetes.io/cluster/complex.example.com",
"Value": "owned"
}
]
}
},
"AWSEC2InternetGatewaycomplexexamplecom": {
"Type": "AWS::EC2::InternetGateway",
"Properties": {
Expand All @@ -245,6 +265,25 @@
]
}
},
"AWSEC2NatGatewayustest1bcomplexexamplecom": {
"Type": "AWS::EC2::NatGateway",
"Properties": {
"AllocationId": {
"Fn::GetAtt": [
"AWSEC2EIPustest1bcomplexexamplecom",
"AllocationId"
]
},
"SubnetId": {
"Ref": "AWSEC2Subnetustest1butilcomplexexamplecom"
},
"tags": {
"KubernetesCluster": "complex.example.com",
"Name": "us-test-1b.complex.example.com",
"kubernetes.io/cluster/complex.example.com": "owned"
}
}
},
"AWSEC2Route00000": {
"Type": "AWS::EC2::Route",
"Properties": {
Expand Down Expand Up @@ -283,6 +322,80 @@
]
}
},
"AWSEC2RouteTableprivateustest1bcomplexexamplecom": {
"Type": "AWS::EC2::RouteTable",
"Properties": {
"VpcId": {
"Ref": "AWSEC2VPCcomplexexamplecom"
},
"Tags": [
{
"Key": "KubernetesCluster",
"Value": "complex.example.com"
},
{
"Key": "Name",
"Value": "private-us-test-1b.complex.example.com"
},
{
"Key": "kubernetes.io/cluster/complex.example.com",
"Value": "owned"
},
{
"Key": "kubernetes.io/kops/role",
"Value": "private-us-test-1b"
}
]
}
},
"AWSEC2RouteTableprivateustest1ccomplexexamplecom": {
"Type": "AWS::EC2::RouteTable",
"Properties": {
"VpcId": {
"Ref": "AWSEC2VPCcomplexexamplecom"
},
"Tags": [
{
"Key": "KubernetesCluster",
"Value": "complex.example.com"
},
{
"Key": "Name",
"Value": "private-us-test-1c.complex.example.com"
},
{
"Key": "kubernetes.io/cluster/complex.example.com",
"Value": "owned"
},
{
"Key": "kubernetes.io/kops/role",
"Value": "private-us-test-1c"
}
]
}
},
"AWSEC2Routeprivateustest1b00000": {
"Type": "AWS::EC2::Route",
"Properties": {
"RouteTableId": {
"Ref": "AWSEC2RouteTableprivateustest1bcomplexexamplecom"
},
"DestinationCidrBlock": "0.0.0.0/0",
"NatGatewayId": {
"Ref": "AWSEC2NatGatewayustest1bcomplexexamplecom"
}
}
},
"AWSEC2Routeprivateustest1c00000": {
"Type": "AWS::EC2::Route",
"Properties": {
"RouteTableId": {
"Ref": "AWSEC2RouteTableprivateustest1ccomplexexamplecom"
},
"DestinationCidrBlock": "0.0.0.0/0",
"NatGatewayId": "nat-12345678"
}
},
"AWSEC2SecurityGroupEgressapielbegress": {
"Type": "AWS::EC2::SecurityGroupEgress",
"Properties": {
Expand Down Expand Up @@ -596,6 +709,28 @@
]
}
},
"AWSEC2SubnetRouteTableAssociationprivateustest1bcomplexexamplecom": {
"Type": "AWS::EC2::SubnetRouteTableAssociation",
"Properties": {
"SubnetId": {
"Ref": "AWSEC2Subnetustest1bcomplexexamplecom"
},
"RouteTableId": {
"Ref": "AWSEC2RouteTableprivateustest1bcomplexexamplecom"
}
}
},
"AWSEC2SubnetRouteTableAssociationprivateustest1ccomplexexamplecom": {
"Type": "AWS::EC2::SubnetRouteTableAssociation",
"Properties": {
"SubnetId": {
"Ref": "AWSEC2Subnetustest1ccomplexexamplecom"
},
"RouteTableId": {
"Ref": "AWSEC2RouteTableprivateustest1ccomplexexamplecom"
}
}
},
"AWSEC2SubnetRouteTableAssociationustest1acomplexexamplecom": {
"Type": "AWS::EC2::SubnetRouteTableAssociation",
"Properties": {
Expand All @@ -607,6 +742,28 @@
}
}
},
"AWSEC2SubnetRouteTableAssociationustest1butilcomplexexamplecom": {
"Type": "AWS::EC2::SubnetRouteTableAssociation",
"Properties": {
"SubnetId": {
"Ref": "AWSEC2Subnetustest1butilcomplexexamplecom"
},
"RouteTableId": {
"Ref": "AWSEC2RouteTablecomplexexamplecom"
}
}
},
"AWSEC2SubnetRouteTableAssociationustest1cutilcomplexexamplecom": {
"Type": "AWS::EC2::SubnetRouteTableAssociation",
"Properties": {
"SubnetId": {
"Ref": "AWSEC2Subnetustest1cutilcomplexexamplecom"
},
"RouteTableId": {
"Ref": "AWSEC2RouteTablecomplexexamplecom"
}
}
},
"AWSEC2Subnetustest1acomplexexamplecom": {
"Type": "AWS::EC2::Subnet",
"Properties": {
Expand Down Expand Up @@ -639,6 +796,134 @@
]
}
},
"AWSEC2Subnetustest1bcomplexexamplecom": {
"Type": "AWS::EC2::Subnet",
"Properties": {
"VpcId": {
"Ref": "AWSEC2VPCcomplexexamplecom"
},
"CidrBlock": "172.20.64.0/19",
"AvailabilityZone": "us-test-1b",
"Tags": [
{
"Key": "KubernetesCluster",
"Value": "complex.example.com"
},
{
"Key": "Name",
"Value": "us-test-1b.complex.example.com"
},
{
"Key": "SubnetType",
"Value": "Private"
},
{
"Key": "kubernetes.io/cluster/complex.example.com",
"Value": "owned"
},
{
"Key": "kubernetes.io/role/internal-elb",
"Value": "1"
}
]
}
},
"AWSEC2Subnetustest1butilcomplexexamplecom": {
"Type": "AWS::EC2::Subnet",
"Properties": {
"VpcId": {
"Ref": "AWSEC2VPCcomplexexamplecom"
},
"CidrBlock": "172.20.96.0/19",
"AvailabilityZone": "us-test-1b",
"Tags": [
{
"Key": "KubernetesCluster",
"Value": "complex.example.com"
},
{
"Key": "Name",
"Value": "us-test-1b-util.complex.example.com"
},
{
"Key": "SubnetType",
"Value": "Utility"
},
{
"Key": "kubernetes.io/cluster/complex.example.com",
"Value": "owned"
},
{
"Key": "kubernetes.io/role/elb",
"Value": "1"
}
]
}
},
"AWSEC2Subnetustest1ccomplexexamplecom": {
"Type": "AWS::EC2::Subnet",
"Properties": {
"VpcId": {
"Ref": "AWSEC2VPCcomplexexamplecom"
},
"CidrBlock": "172.20.128.0/19",
"AvailabilityZone": "us-test-1c",
"Tags": [
{
"Key": "KubernetesCluster",
"Value": "complex.example.com"
},
{
"Key": "Name",
"Value": "us-test-1c.complex.example.com"
},
{
"Key": "SubnetType",
"Value": "Private"
},
{
"Key": "kubernetes.io/cluster/complex.example.com",
"Value": "owned"
},
{
"Key": "kubernetes.io/role/internal-elb",
"Value": "1"
}
]
}
},
"AWSEC2Subnetustest1cutilcomplexexamplecom": {
"Type": "AWS::EC2::Subnet",
"Properties": {
"VpcId": {
"Ref": "AWSEC2VPCcomplexexamplecom"
},
"CidrBlock": "172.20.160.0/19",
"AvailabilityZone": "us-test-1c",
"Tags": [
{
"Key": "KubernetesCluster",
"Value": "complex.example.com"
},
{
"Key": "Name",
"Value": "us-test-1c-util.complex.example.com"
},
{
"Key": "SubnetType",
"Value": "Utility"
},
{
"Key": "kubernetes.io/cluster/complex.example.com",
"Value": "owned"
},
{
"Key": "kubernetes.io/role/elb",
"Value": "1"
}
]
}
},
"AWSEC2VPCDHCPOptionsAssociationcomplexexamplecom": {
"Type": "AWS::EC2::VPCDHCPOptionsAssociation",
"Properties": {
Expand Down Expand Up @@ -783,6 +1068,12 @@
"Subnets": [
{
"Ref": "AWSEC2Subnetustest1acomplexexamplecom"
},
{
"Ref": "AWSEC2Subnetustest1butilcomplexexamplecom"
},
{
"Ref": "AWSEC2Subnetustest1cutilcomplexexamplecom"
}
],
"HealthCheck": {
Expand Down
18 changes: 17 additions & 1 deletion tests/integration/update_cluster/complex/in-legacy-v1alpha2.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,23 @@ spec:
name: us-test-1a
type: Public
zone: us-test-1a

- cidr: 172.20.64.0/19
name: us-test-1b
type: Private
zone: us-test-1b
- cidr: 172.20.96.0/19
name: us-test-1b-util
type: Utility
zone: us-test-1b
- cidr: 172.20.128.0/19
name: us-test-1c
type: Private
zone: us-test-1c
egress: nat-12345678
- cidr: 172.20.160.0/19
name: us-test-1c-util
type: Utility
zone: us-test-1c
---

apiVersion: kops/v1alpha2
Expand Down
17 changes: 17 additions & 0 deletions tests/integration/update_cluster/complex/in-v1alpha2.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,23 @@ spec:
name: us-test-1a
type: Public
zone: us-test-1a
- cidr: 172.20.64.0/19
name: us-test-1b
type: Private
zone: us-test-1b
- cidr: 172.20.96.0/19
name: us-test-1b-util
type: Utility
zone: us-test-1b
- cidr: 172.20.128.0/19
name: us-test-1c
type: Private
zone: us-test-1c
egress: nat-12345678
- cidr: 172.20.160.0/19
name: us-test-1c-util
type: Utility
zone: us-test-1c

---

Expand Down
Loading

0 comments on commit 8b7ecb4

Please sign in to comment.