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

Improve apiserver backend service zone spanning on GCP #504

Merged
merged 1 commit into from
Jul 6, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,11 @@ Notable changes between versions.

* Update Calico from v3.7.3 to [v3.7.4](https://docs.projectcalico.org/v3.7/release-notes/)

#### Google Cloud

* Allow controller nodes to span more than 3 zones if available in a region ([#504](https://github.com/poseidon/typhoon/pull/504))
* Eliminate extraneous controller instance groups in single-controller clusters ([#504](https://github.com/poseidon/typhoon/pull/504))

#### Addons

* Update Grafana from v6.2.4 to v6.2.5
Expand Down
21 changes: 6 additions & 15 deletions google-cloud/container-linux/kubernetes/apiserver.tf
Original file line number Diff line number Diff line change
Expand Up @@ -45,16 +45,11 @@ resource "google_compute_backend_service" "apiserver" {
timeout_sec = "300"

# controller(s) spread across zonal instance groups
backend {
group = google_compute_instance_group.controllers[0].self_link
}

backend {
group = google_compute_instance_group.controllers[1].self_link
}

backend {
group = google_compute_instance_group.controllers[2].self_link
dynamic "backend" {
for_each = google_compute_instance_group.controllers
content {
group = backend.value.self_link
}
}

health_checks = [google_compute_health_check.apiserver.self_link]
Expand All @@ -64,11 +59,7 @@ resource "google_compute_backend_service" "apiserver" {
resource "google_compute_instance_group" "controllers" {
count = length(local.zones)

name = format(
"%s-controllers-%s",
var.cluster_name,
element(local.zones, count.index),
)
name = format("%s-controllers-%s", var.cluster_name, element(local.zones, count.index))
zone = element(local.zones, count.index)

named_port {
Expand Down
4 changes: 1 addition & 3 deletions google-cloud/container-linux/kubernetes/controllers.tf
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,7 @@ data "google_compute_zones" "all" {
}

locals {
# TCP proxy load balancers require a fixed number of zonal backends. Spread
# controllers over up to 3 zones, since all GCP regions have at least 3.
zones = slice(data.google_compute_zones.all.names, 0, 3)
zones = data.google_compute_zones.all.names

controllers_ipv4_public = google_compute_instance.controllers.*.network_interface.0.access_config.0.nat_ip
}
Expand Down