-
Notifications
You must be signed in to change notification settings - Fork 0
/
cluster.tf
37 lines (30 loc) · 1023 Bytes
/
cluster.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
resource "google_container_cluster" "cluster" {
name = "${var.cluster-name}"
zone = "${var.gcloud-zone}"
initial_node_count = "${var.cluster-size}"
master_auth {
username = "${var.username}"
password = "${var.password}"
}
node_config {
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",
]
machine_type = "${var.machine-type}"
}
provisioner "local-exec" {
command = "gcloud container clusters get-credentials ${var.cluster-name} --zone ${var.gcloud-zone} --project ${var.gcloud-project}"
}
provisioner "local-exec" {
command = "kubectl cluster-info"
}
provisioner "local-exec" {
command = "kubectl create -f hello-go/k8s/hello-deployment.yaml"
}
provisioner "local-exec" {
command = "kubectl create -f hello-go/k8s/hello-service.yaml"
}
}