Skip to content

Commit

Permalink
Configurable GKE kubee version
Browse files Browse the repository at this point in the history
  • Loading branch information
sjmiller609 committed Oct 9, 2019
1 parent 505327e commit efc5198
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 7 deletions.
10 changes: 5 additions & 5 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@ data "http" "local_ip" {
url = "http://ipv4.icanhazip.com/s"
}

data "google_container_engine_versions" "versions" {
location = var.zonal_cluster ? local.zone : local.region
version_prefix = "1.14."
}
# data "google_container_engine_versions" "versions" {
# location = var.zonal_cluster ? local.zone : local.region
# version_prefix = "1.14."
# }

# GKE cluster
resource "google_container_cluster" "primary" {
Expand Down Expand Up @@ -47,7 +47,7 @@ resource "google_container_cluster" "primary" {
# https://www.terraform.io/docs/providers/google/r/container_cluster.html#node_pool
location = var.zonal_cluster ? local.zone : local.region

min_master_version = data.google_container_engine_versions.versions.latest_master_version
min_master_version = var.kube_version_gke

network = local.core_network_id
subnetwork = local.gke_subnetwork_id
Expand Down
6 changes: 4 additions & 2 deletions node_pools.tf
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ resource "google_container_node_pool" "node_pool_mt" {

# these can't be created or deleted at the same time.
depends_on = [google_container_node_pool.node_pool_platform]
version = data.google_container_cluster.primary.master_version
# version = data.google_container_cluster.primary.master_version
version = var.kube_version_gke

# We want the multi-tenant node pool to be completely replaced
# instead of rolling deployment.
Expand Down Expand Up @@ -121,7 +122,8 @@ resource "google_container_node_pool" "node_pool_platform" {
# delete = "30m"
# }

version = data.google_container_cluster.primary.master_version
# version = data.google_container_cluster.primary.master_version
version = var.kube_version_gke

location = var.zonal_cluster ? local.zone : local.region
cluster = google_container_cluster.primary.name
Expand Down
5 changes: 5 additions & 0 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,11 @@ variable "dns_managed_zone" {
description = "The name of the google dns managed zone we should use"
}

variable "kube_version_gke" {
default = "1.14.6-gke.2"
description = "The kubernetes version to use in GKE"
}

variable "machine_type" {
default = "n1-standard-4"
description = "The GCP machine type for GKE worker nodes running multi-tenant workloads"
Expand Down

0 comments on commit efc5198

Please sign in to comment.