Skip to content

Commit dea723b

Browse files
committed
update to tutorials
1 parent 84d5626 commit dea723b

File tree

3 files changed

+52
-4
lines changed

3 files changed

+52
-4
lines changed

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -179,6 +179,8 @@ Example showing how to create a Kubernetes Service tpye LoadBalancer to GKE from
179179

180180
Example showing how to create an L7 HTTP load balancer across multiple regional GKE clusters.
181181

182+
[![button](http://gstatic.com/cloudssh/images/open-btn.png)](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/GoogleCloudPlatform/terraform-google-examples&page=editor&tutorial=example-gke-k8s-multi-region/README.md)
183+
182184
<a href="https://concourse-tf.gcp.solutions/teams/main/pipelines/tf-examples-gke-multi-region" target="_blank">
183185
<img src="https://concourse-tf.gcp.solutions/api/v1/teams/main/pipelines/tf-examples-gke-multi-region/badge" /></a>
184186

example-gke-k8s-multi-region/README.md

Lines changed: 42 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,35 +2,73 @@
22

33
This example shows how to do multi-region ingress using an L7 HTTP Load Balancer with regional clusters.
44

5+
[![button](http://gstatic.com/cloudssh/images/open-btn.png)](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/GoogleCloudPlatform/terraform-google-examples&page=editor&tutorial=example-gke-k8s-multi-region/README.md)
6+
7+
<a href="https://concourse-tf.gcp.solutions/teams/main/pipelines/tf-examples-gke-multi-region" target="_blank">
8+
<img src="https://concourse-tf.gcp.solutions/api/v1/teams/main/pipelines/tf-examples-gke-multi-region/badge" /></a>
9+
510
**Figure 1.** *diagram of Google Cloud resources*
611

712
![architecture diagram](./diagram.png)
813

14+
## Install Terraform
15+
16+
1. Install Terraform if it is not already installed (visit [terraform.io](https://terraform.io) for other distributions):
17+
18+
```
19+
./terraform-install.sh
20+
```
21+
22+
## Change to the example directory
23+
24+
```
25+
cd example-gke-k8s-multi-region/
26+
```
27+
928
## Set up the environment
1029

30+
1. Set the project, replace `YOUR_PROJECT` with your project ID:
31+
1132
```
12-
gcloud auth application-default login
33+
PROJECT=YOUR_PROJECT
34+
```
35+
36+
```
37+
gcloud config set project ${PROJECT}
38+
```
39+
40+
2. Configure the environment for Terraform:
41+
42+
```
43+
[[ $CLOUD_SHELL ]] || gcloud auth application-default login
1344
export GOOGLE_PROJECT=$(gcloud config get-value project)
1445
```
1546

1647
## Run Terraform
1748

1849
```
1950
terraform init
20-
terraform plan
2151
terraform apply
2252
```
2353

2454
## Testing
2555

26-
Open the address of the load balancer in a browser once it is ready:
56+
1. Wait for the load balancer to be provisioned:
57+
58+
```
59+
./test.sh
60+
```
61+
62+
2. Open the address of the load balancer:
2763

2864
```
29-
(until curl --connect-timeout 1 -sf -o /dev/null http://$(terraform output load-balancer-ip); do echo "Waiting for Load Balancer... "; sleep 5 ; done) && open http://$(terraform output load-balancer-ip)
65+
echo http://$(terraform output load-balancer-ip)
3066
```
3167

3268
## Cleanup
3369

70+
1. Delete resources created by terraform:
71+
3472
```
3573
terraform destroy
3674
```

example-gke-k8s-service-lb/README.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,4 +73,12 @@ gcloud container clusters get-credentials $(terraform output cluster_name) --zon
7373

7474
```
7575
kubectl get pods -n staging
76+
```
77+
78+
## Cleanup
79+
80+
1. Delete resources created by terraform:
81+
82+
```
83+
terraform destroy
7684
```

0 commit comments

Comments
 (0)