diff --git a/cmd/kops/create_cluster_integration_test.go b/cmd/kops/create_cluster_integration_test.go index 7d8b57b6c6..093ff87c6e 100644 --- a/cmd/kops/create_cluster_integration_test.go +++ b/cmd/kops/create_cluster_integration_test.go @@ -39,6 +39,11 @@ func TestCreateClusterMinimal(t *testing.T) { runCreateClusterIntegrationTest(t, "../../tests/integration/create_cluster/minimal", "v1alpha2") } +// TestCreateClusterMinimal runs kops create cluster, with a grab-bag of edge cases +func TestCreateClusterComplex(t *testing.T) { + runCreateClusterIntegrationTest(t, "../../tests/integration/create_cluster/complex", "v1alpha2") +} + // TestCreateClusterHA runs kops create cluster ha.example.com --zones us-test-1a,us-test-1b,us-test-1c --master-zones us-test-1a,us-test-1b,us-test-1c func TestCreateClusterHA(t *testing.T) { runCreateClusterIntegrationTest(t, "../../tests/integration/create_cluster/ha", "v1alpha1") @@ -47,7 +52,7 @@ func TestCreateClusterHA(t *testing.T) { runCreateClusterIntegrationTest(t, "../../tests/integration/create_cluster/ha_encrypt", "v1alpha2") } -// TestCreateClusterHASharedZones tests kops create cluster when the master count is bigger than the numebr of zones +// TestCreateClusterHASharedZones tests kops create cluster when the master count is bigger than the number of zones func TestCreateClusterHASharedZones(t *testing.T) { // Cannot be expressed in v1alpha1 API: runCreateClusterIntegrationTest(t, "../../tests/integration/create_cluster/ha_shared_zones", "v1alpha1") runCreateClusterIntegrationTest(t, "../../tests/integration/create_cluster/ha_shared_zones", "v1alpha2") diff --git a/tests/integration/create_cluster/complex/expected-v1alpha2.yaml b/tests/integration/create_cluster/complex/expected-v1alpha2.yaml new file mode 100644 index 0000000000..0b39bdd0f0 --- /dev/null +++ b/tests/integration/create_cluster/complex/expected-v1alpha2.yaml @@ -0,0 +1,78 @@ +apiVersion: kops/v1alpha2 +kind: Cluster +metadata: + creationTimestamp: 2017-01-01T00:00:00Z + name: complex.example.com +spec: + api: + dns: {} + authorization: + alwaysAllow: {} + channel: stable + cloudProvider: aws + configBase: memfs://tests/complex.example.com + etcdClusters: + - etcdMembers: + - instanceGroup: master-us-test-1a + name: a + name: main + - etcdMembers: + - instanceGroup: master-us-test-1a + name: a + name: events + kubernetesApiAccess: + - 0.0.0.0/0 + kubernetesVersion: v1.7.1 + masterPublicName: api.complex.example.com + networkCIDR: 172.20.0.0/16 + networking: + kubenet: {} + nonMasqueradeCIDR: 100.64.0.0/10 + sshAccess: + - 1.2.3.4/32 + subnets: + - cidr: 172.20.32.0/19 + name: us-test-1a + type: Public + zone: us-test-1a + topology: + dns: + type: Public + masters: public + nodes: public + +--- + +apiVersion: kops/v1alpha2 +kind: InstanceGroup +metadata: + creationTimestamp: 2017-01-01T00:00:00Z + labels: + kops.k8s.io/cluster: complex.example.com + name: master-us-test-1a +spec: + image: kope.io/k8s-1.6-debian-jessie-amd64-hvm-ebs-2017-05-02 + machineType: m3.medium + maxSize: 1 + minSize: 1 + role: Master + subnets: + - us-test-1a + +--- + +apiVersion: kops/v1alpha2 +kind: InstanceGroup +metadata: + creationTimestamp: 2017-01-01T00:00:00Z + labels: + kops.k8s.io/cluster: complex.example.com + name: nodes +spec: + image: kope.io/k8s-1.6-debian-jessie-amd64-hvm-ebs-2017-05-02 + machineType: t2.medium + maxSize: 2 + minSize: 2 + role: Node + subnets: + - us-test-1a diff --git a/tests/integration/create_cluster/complex/options.yaml b/tests/integration/create_cluster/complex/options.yaml new file mode 100644 index 0000000000..e8f17aa339 --- /dev/null +++ b/tests/integration/create_cluster/complex/options.yaml @@ -0,0 +1,8 @@ +ClusterName: complex.example.com +Zones: +- us-test-1a +Cloud: aws +KubernetesVersion: v1.7.1 +# We specify SSHAccess but _not_ AdminAccess +SSHAccess: +- 1.2.3.4/32