Skip to content

Commit

Permalink
test/tf/k8s: automatically use latest K8S version
Browse files Browse the repository at this point in the history
  • Loading branch information
mitchellh committed Aug 31, 2018
1 parent f51ef4c commit 8e8e6b1
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
8 changes: 6 additions & 2 deletions test/tf/k8s/main.tf
Expand Up @@ -2,14 +2,18 @@ resource "random_id" "suffix" {
byte_length = 4
}

data "google_container_engine_versions" "main" {
zone = "${var.zone}"
}

resource "google_container_cluster" "cluster" {
name = "consul-k8s-${random_id.suffix.dec}"
project = "${var.project}"
enable_legacy_abac = true
initial_node_count = 5
zone = "${var.zone}"
min_master_version = "${var.k8s_version}"
node_version = "${var.k8s_version}"
min_master_version = "${data.google_container_engine_versions.main.latest_master_version}"
node_version = "${data.google_container_engine_versions.main.latest_node_version}"
}

resource "local_file" "kubeconfig" {
Expand Down
5 changes: 0 additions & 5 deletions test/tf/k8s/variables.tf
@@ -1,8 +1,3 @@
variable "k8s_version" {
default = "1.10.6-gke.2"
description = "The K8S version to use for both master and nodes."
}

variable "project" {
description = <<EOF
Google Cloud Project to launch resources in. This project must have GKE
Expand Down

0 comments on commit 8e8e6b1

Please sign in to comment.