-
Notifications
You must be signed in to change notification settings - Fork 1k
Expand file tree
/
Copy pathmain.tf
More file actions
65 lines (52 loc) · 1.61 KB
/
main.tf
File metadata and controls
65 lines (52 loc) · 1.61 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
# Copyright IBM Corp. 2017, 2025
# SPDX-License-Identifier: MPL-2.0
terraform {
required_providers {
google = {
source = "hashicorp/google"
version = ">= 5.1"
}
}
}
# This is used to set local variable google_zone.
# This can be replaced with a statically-configured zone, if preferred.
data "google_compute_zones" "available" {
provider = google-beta
}
locals {
google_zone = data.google_compute_zones.available.names[0]
}
data "google_container_engine_versions" "supported" {
provider = google-beta
location = local.google_zone
version_prefix = var.kubernetes_version
}
resource "google_container_cluster" "default" {
provider = google-beta
name = var.cluster_name
location = local.google_zone
initial_node_count = var.workers_count
min_master_version = data.google_container_engine_versions.supported.latest_master_version
# node version must match master version
# https://www.terraform.io/docs/providers/google/r/container_cluster.html#node_version
node_version = data.google_container_engine_versions.supported.latest_master_version
release_channel {
channel = "RAPID"
}
node_locations = [
data.google_compute_zones.available.names[1],
]
node_config {
machine_type = "n1-standard-4"
oauth_scopes = [
"https://www.googleapis.com/auth/compute",
"https://www.googleapis.com/auth/devstorage.read_only",
"https://www.googleapis.com/auth/logging.write",
"https://www.googleapis.com/auth/monitoring",
]
}
identity_service_config {
enabled = var.idp_enabled
}
deletion_protection = false
}