-
Notifications
You must be signed in to change notification settings - Fork 0
/
compute.tf
73 lines (50 loc) · 1.81 KB
/
compute.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
64
65
66
67
68
69
70
71
72
73
# resource "google_compute_address" "kubernetes_the_hard_way" {
# name = "kubernetes-public-api-server"
# region = "europe-west3"
# }
# # Create 3 compute instances for the control plane
# resource "google_compute_instance" "controller" {
# count = 3
# can_ip_forward = true
# name = "kubernetes-controller-${count.index}"
# zone = "europe-west3-a"
# boot_disk {
# initialize_params {
# size = 200
# image = "ubuntu-os-cloud/ubuntu-2004-lts" #project/family
# }
# }
# network_interface {
# subnetwork = "kubernetes-cluster-subnet"
# network_ip = "10.240.0.1${count.index}"
# access_config {
# }
# }
# machine_type = "e2-standard-2"
# tags = ["kubernetes-the-hard-way", "controller"]
# #Question haven't defined scopes, will need to see if needed later on:
# # compute-rw,storage-ro,service-management,service-control,logging-write,monitoring
# }
# # 3 compute instances to host the Kubernetes worker nodes
# resource "google_compute_instance" "worker" {
# count = 3
# name = "kubernetes-worker-${count.index}"
# zone = "europe-west3-a"
# boot_disk {
# initialize_params {
# size = 200
# image = "ubuntu-os-cloud/ubuntu-2004-lts" #project/family
# }
# }
# network_interface {
# subnetwork = "kubernetes-cluster-subnet"
# network_ip = "10.240.0.2${count.index}"
# access_config { # Gives an epphemeral ip to the instance (Ephemeral meaning for the lifetime of the instance, and a new one is generated if recreated/rebooted)
# }
# }
# metadata = {
# "pod-cidr" = "10.200.${count.index}.0/24" # pod subnet allocation will used to configure container networking at a later stage
# }
# machine_type = "e2-standard-2"
# tags = ["kubernetes-the-hard-way", "worker"]
# }