-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathgoogle_kubernetes.tf
63 lines (53 loc) · 2.03 KB
/
google_kubernetes.tf
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
resource "google_container_cluster" "polyaxon_cluster" {
provider = google-beta
name = var.gke_cluster_name
project = var.gcp_project
location = var.gcp_zone
description = "A GKE cluster of polyaxon created with terraform-module-polyaxon"
initial_node_count = 1
remove_default_node_pool = true
enable_tpu = true
enable_legacy_abac = false
network = "projects/${var.gcp_project}/global/networks/${google_compute_network.private_network.name}"
subnetwork = google_compute_subnetwork.polyaxon_subnet.self_link
# enable VPC native cluster
ip_allocation_policy {
cluster_secondary_range_name = google_compute_subnetwork.polyaxon_subnet.secondary_ip_range.0.range_name
services_secondary_range_name = google_compute_subnetwork.polyaxon_subnet.secondary_ip_range.1.range_name
}
timeouts {
create = "30m"
update = "30m"
delete = "30m"
}
# Auto upgrade option
# RAPID: Upgrade per a week, to get the latest Kubernetes release as early as possible
# REGULAR: Upgrade per several times in a month, you can access GKE and Kubernetes features reasonably soon after they debut
# STABLE: Upgrade once per several months, prioritize stability over new functionality
# https://cloud.google.com/kubernetes-engine/docs/concepts/release-channels
release_channel {
channel = "REGULAR"
}
maintenance_policy {
daily_maintenance_window {
# Maintenance window needs 4 hours (UTC)
# https://cloud.google.com/kubernetes-engine/docs/how-to/maintenance-window
start_time = "13:00"
}
}
depends_on = [
google_service_networking_connection.private_vpc_connection,
]
lifecycle {
# ignore changes to node_pool specifically so it doesn't
# try to recreate default node pool with every change
# ignore changes to network and subnetwork so it doesn't
# clutter up diff with dumb changes like:
# projects/[name]/regions/us-central1/subnetworks/[name]" => "name"
ignore_changes = [
node_pool,
network,
subnetwork
]
}
}