Skip to content

Commit 84d5626

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

File tree

2 files changed

+48
-2
lines changed

2 files changed

+48
-2
lines changed

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -170,6 +170,8 @@ Example showing how to deploy Helm releases to GKE from Terraform
170170

171171
Example showing how to create a Kubernetes Service tpye LoadBalancer to GKE from Terraform
172172

173+
[![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-service-lb/README.md)
174+
173175
<a href="https://concourse-tf.gcp.solutions/teams/main/pipelines/tf-examples-gke-service-lb" target="_blank">
174176
<img src="https://concourse-tf.gcp.solutions/api/v1/teams/main/pipelines/tf-examples-gke-service-lb/badge" /></a>
175177

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

Lines changed: 46 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,31 +2,75 @@
22

33
Example showing how to integrate the Terraform kubernetes provider with a Google Kubernetes Engine cluster.
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-service-lb/README.md)
6+
7+
<a href="https://concourse-tf.gcp.solutions/teams/main/pipelines/tf-examples-gke-service-lb" target="_blank">
8+
<img src="https://concourse-tf.gcp.solutions/api/v1/teams/main/pipelines/tf-examples-gke-service-lb/badge" /></a>
9+
10+
## Install Terraform
11+
12+
1. Install Terraform if it is not already installed (visit [terraform.io](https://terraform.io) for other distributions):
13+
14+
```
15+
./terraform-install.sh
16+
```
17+
18+
## Change to the example directory
19+
20+
```
21+
cd example-gke-service-lb/
22+
```
23+
524
## Set up the environment
625

26+
1. Set the project, replace `YOUR_PROJECT` with your project ID:
27+
28+
```
29+
PROJECT=YOUR_PROJECT
30+
```
31+
32+
```
33+
gcloud config set project ${PROJECT}
734
```
8-
gcloud auth application-default login
35+
36+
2. Configure the environment for Terraform:
37+
38+
```
39+
[[ $CLOUD_SHELL ]] || gcloud auth application-default login
940
export GOOGLE_PROJECT=$(gcloud config get-value project)
1041
```
1142

1243
## Run Terraform
1344

1445
```
1546
terraform init
16-
terraform plan
1747
terraform apply
1848
```
1949

2050
## Testing
2151

52+
1. Wait for the load balancer to be provisioned:
53+
54+
```
55+
./test.sh
56+
```
57+
58+
2. Verify response from load balancer:
59+
2260
```
2361
curl http://$(terraform output load-balancer-ip)
2462
```
2563

2664
## Connecting with kubectl
2765

66+
1. Get the cluster credentials and configure kubectl:
67+
2868
```
2969
gcloud container clusters get-credentials $(terraform output cluster_name) --zone $(terraform output cluster_zone)
70+
```
71+
72+
2. Verify kubectl connectivity:
3073

74+
```
3175
kubectl get pods -n staging
3276
```

0 commit comments

Comments
 (0)