Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

deploy/gcp: support zonal and multi-zonal cluster #809

Merged
merged 6 commits into from
Aug 26, 2019

Conversation

cofyc
Copy link
Contributor

@cofyc cofyc commented Aug 22, 2019

What problem does this PR solve?

  • support zonal/multi-zonal cluster
  • more examples

What is changed and how does it work?

Check List

Tests

  • Manual test (add detailed scripts or steps below)

Side effects

  • Breaking backward compatibility

Related changes

  • Need to cherry-pick to the release branch
  • Need to update the documentation

Does this PR introduce a user-facing change?:

deploy/gcp: support zonal and multi-zonal clusters

@cofyc cofyc requested review from gregwebs, jlerche, tennix and aylei August 22, 2019 08:36
@cofyc
Copy link
Contributor Author

cofyc commented Aug 22, 2019

@gregwebs @tennix @jlerche @aylei
I'd run a few tests manually, but I'm not terraform expert. Can you help test this when you have time?

Known issues:

  • when var.location is given a region different than GCE_REGION. VPC/bastion will be created in the wrong region

description = "Operator helm values"
type = string
default = ""
}
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

declare it in root module to make it configurable

description = "Kubernetes version to use for the GKE cluster"
type = string
default = "latest"
}
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

declare it in root module to make it configurable


variable "tidb_replica_count" {
default = 3
}
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

these three variables are not used anymore

variable "gcp_region" {
description = "The GCP region"
}

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

replaced by location

@cofyc cofyc force-pushed the improve_gcp branch 2 times, most recently from 145f378 to e8ed70d Compare August 22, 2019 11:06
}

variable "node_locations" {
description = "The list of zones in which the cluster's nodes should be located. These must be in the same region as the cluster zone for zonal clusters, or in the region of a regional cluster. In a multi-zonal cluster, the number of nodes specified in initial_node_count is created in all specified zones as well as the primary zone. If specified for a regional cluster, nodes will be created in only these zones."
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is the purpose of this for a single-zone cluster? Doesn't the above location variable already specify this properly?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oh, I see, there are zonal clusters that are multi-zone clusters. I wonder why not just use the regional cluster though?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, if you need to run a multi-zone cluster, it's better to use a regional cluster. However, if users want a small cluster for testing or for low network latency between work nodes, they can use a zonal cluster and run nodes in a single zone.

node_locations can also be used to choose node locations for the regional cluster too (at least two locations for a regional cluster).

Currently, in GCP, some types of machines are only available in a few zones, e.g. in region us-central1 c2-standard machines are only available in us-central1-b and us-central1-c zones.

If users want to use these compute-optimized machines, they must specify node_locations to deploy nodes in these zones.

gregwebs
gregwebs previously approved these changes Aug 23, 2019
@cofyc cofyc changed the title support zonal and multi-zonal cluster deploy/gcp: support zonal and multi-zonal cluster Aug 23, 2019
aylei
aylei previously approved these changes Aug 25, 2019
Copy link
Contributor

@aylei aylei left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@cofyc
Copy link
Contributor Author

cofyc commented Aug 25, 2019

/run-e2e-in-kind

@cofyc cofyc dismissed stale reviews from aylei and gregwebs via c97d6e0 August 25, 2019 06:09
@cofyc
Copy link
Contributor Author

cofyc commented Aug 25, 2019

/run-e2e-in-kind

@cofyc
Copy link
Contributor Author

cofyc commented Aug 25, 2019

@gregwebs @aylei
I pushed a new commit to set default value for var.location. PTAL.

Copy link
Contributor

@aylei aylei left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@cofyc cofyc merged commit d64aade into pingcap:master Aug 26, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants