test: terraform uses data source to get latest GKE version
This commit is contained in:
parent
972a6defc2
commit
0db2be6d10
2 changed files with 6 additions and 7 deletions
|
@ -10,14 +10,18 @@ resource "random_id" "suffix" {
|
||||||
byte_length = 4
|
byte_length = 4
|
||||||
}
|
}
|
||||||
|
|
||||||
|
data "google_container_engine_versions" "main" {
|
||||||
|
zone = "${var.zone}"
|
||||||
|
}
|
||||||
|
|
||||||
resource "google_container_cluster" "cluster" {
|
resource "google_container_cluster" "cluster" {
|
||||||
name = "consul-k8s-${random_id.suffix.dec}"
|
name = "consul-k8s-${random_id.suffix.dec}"
|
||||||
project = "${var.project}"
|
project = "${var.project}"
|
||||||
enable_legacy_abac = true
|
enable_legacy_abac = true
|
||||||
initial_node_count = 5
|
initial_node_count = 5
|
||||||
zone = "${var.zone}"
|
zone = "${var.zone}"
|
||||||
min_master_version = "${var.k8s_version}"
|
min_master_version = "${data.google_container_engine_versions.main.latest_master_version}"
|
||||||
node_version = "${var.k8s_version}"
|
node_version = "${data.google_container_engine_versions.main.latest_node_version}"
|
||||||
}
|
}
|
||||||
|
|
||||||
resource "null_resource" "kubectl" {
|
resource "null_resource" "kubectl" {
|
||||||
|
|
|
@ -1,8 +1,3 @@
|
||||||
variable "k8s_version" {
|
|
||||||
default = "1.10.5-gke.4"
|
|
||||||
description = "The K8S version to use for both master and nodes."
|
|
||||||
}
|
|
||||||
|
|
||||||
variable "project" {
|
variable "project" {
|
||||||
description = <<EOF
|
description = <<EOF
|
||||||
Google Cloud Project to launch resources in. This project must have GKE
|
Google Cloud Project to launch resources in. This project must have GKE
|
||||||
|
|
Loading…
Reference in a new issue