diff --git a/hack/ginkgo-e2e.sh b/hack/ginkgo-e2e.sh index 7c063dfda5..00e8136c62 100755 --- a/hack/ginkgo-e2e.sh +++ b/hack/ginkgo-e2e.sh @@ -133,6 +133,7 @@ export PATH=$(dirname "${e2e_test}"):"${PATH}" --provider="${KUBERNETES_PROVIDER}" \ --gce-project="${PROJECT:-}" \ --gce-zone="${ZONE:-}" \ + --gce-multizone="${MULTIZONE:-false}" \ --gke-cluster="${CLUSTER_NAME:-}" \ --kube-master="${KUBE_MASTER:-}" \ --cluster-tag="${CLUSTER_ID:-}" \ diff --git a/hack/verify-flags/known-flags.txt b/hack/verify-flags/known-flags.txt index c36f7e09e3..5060c3dcd0 100644 --- a/hack/verify-flags/known-flags.txt +++ b/hack/verify-flags/known-flags.txt @@ -281,6 +281,7 @@ garbage-collector-enabled gather-logs-sizes gather-metrics-at-teardown gather-resource-usage +gce-multizone gce-project gce-service-account gce-upgrade-script diff --git a/test/e2e/e2e.go b/test/e2e/e2e.go index 79c26c19d1..bfc5372b98 100644 --- a/test/e2e/e2e.go +++ b/test/e2e/e2e.go @@ -72,7 +72,10 @@ func setupProviderConfig() error { if err != nil { return fmt.Errorf("error parsing GCE/GKE region from zone %q: %v", zone, err) } - managedZones := []string{zone} // Only single-zone for now + managedZones := []string{} // Manage all zones in the region + if !framework.TestContext.CloudConfig.MultiZone { + managedZones = []string{zone} + } cloudConfig.Provider, err = gcecloud.CreateGCECloud(framework.TestContext.CloudConfig.ProjectID, region, zone, managedZones, "" /* networkUrl */, nil /* nodeTags */, "" /* nodeInstancePerfix */, nil /* tokenSource */, false /* useMetadataServer */) if err != nil { return fmt.Errorf("Error building GCE/GKE provider: %v", err) diff --git a/test/e2e/framework/test_context.go b/test/e2e/framework/test_context.go index 3d8f275c6c..53da0d3cda 100644 --- a/test/e2e/framework/test_context.go +++ b/test/e2e/framework/test_context.go @@ -129,6 +129,7 @@ type NodeTestContextType struct { type CloudConfig struct { ProjectID string Zone string + MultiZone bool Cluster string MasterName string NodeInstanceGroup string @@ -194,6 +195,7 @@ func RegisterClusterFlags() { flag.StringVar(&cloudConfig.MasterName, "kube-master", "", "Name of the kubernetes master. Only required if provider is gce or gke") flag.StringVar(&cloudConfig.ProjectID, "gce-project", "", "The GCE project being used, if applicable") flag.StringVar(&cloudConfig.Zone, "gce-zone", "", "GCE zone being used, if applicable") + flag.BoolVar(&cloudConfig.MultiZone, "gce-multizone", false, "If true, start GCE cloud provider with multizone support.") flag.StringVar(&cloudConfig.Cluster, "gke-cluster", "", "GKE name of cluster being used, if applicable") flag.StringVar(&cloudConfig.NodeInstanceGroup, "node-instance-group", "", "Name of the managed instance group for nodes. Valid only for gce, gke or aws. If there is more than one group: comma separated list of groups.") flag.StringVar(&cloudConfig.Network, "network", "e2e", "The cloud provider network for this e2e cluster.")