Skip to content
This repository was archived by the owner on Dec 9, 2024. It is now read-only.

Commit cc063bd

Browse files
authored
Merge pull request #117 from andresmgot/todoGKE
Update docs for TODO app in GKE
2 parents 53d3fe6 + 9731ab0 commit cc063bd

File tree

1 file changed

+19
-19
lines changed

1 file changed

+19
-19
lines changed

examples/todo-app/backend/README.md

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -30,31 +30,31 @@ Serverless: Function read-one successfully deployed
3030

3131
# Running the Backend in GKE
3232

33-
In case your cluster is running on GCE you need to perform an additional step. If you check the Ingress rules that has been created:
33+
In case your cluster is running on GCE you need to perform some additional steps. First you need to follow the [guide for deploying an Ingress Controller](https://github.com/kubernetes/ingress-nginx/blob/master/docs/deploy/index.md). Make sure you execute the "Mandatory commands", the ones for "Install without RBAC roles" and also "GCE - GKE" (using RBAC). If you successfully follow the guide you should be able to see the Ingress Controller running in the `ingress-nginx` namespace:
34+
3435
```
35-
$ kubectl get ingress
36-
NAME HOSTS ADDRESS PORTS AGE
37-
ingress-1505835652059 35.185.47.240.nip.io 35.196.212.24 80 18s
36+
$ kubectl get pods -n ingress-nginx
37+
NAME READY STATUS RESTARTS AGE
38+
default-http-backend-66b447d9cf-zs2zn 1/1 Running 0 13m
39+
nginx-ingress-controller-6fb4c56b69-cpd5b 1/1 Running 3 12m
3840
```
3941

40-
There are two different possibilities, using `35.185.47.240.nip.io` or `35.196.212.24`. We will use the IP address (`35.196.212.24`) since it is accessible through HTTP. The hostname points to the Kubernetes API and it is only accessible through HTTPS and using the cluster certificate so it is not suitable for our application.
41-
42-
In any case we need to go to the [google console](https://console.cloud.google.com/) to enable HTTP traffic for the IP that we want to use.
43-
44-
On the left menu go to: `NETWORKING` -> `VPC Network` -> `Firewall rules` and select the Firewall rule that applies to all the Targets:
45-
46-
<img src="./img/gce_firewall_rules.png" width="700">
47-
48-
Then click on EDIT and modify the `Source IP ranges` to make it accessible from outside of the cluster and click on `Save`:
42+
After a couple of minutes you will see that the Ingress rule has an `address` associated:
4943

50-
<img src="./img/gce_firewall_rule_edit.png" width="700">
44+
```
45+
$ kubectl get ingress
46+
NAME HOSTS ADDRESS PORTS AGE
47+
todos 35.196.179.155.xip.io 35.229.122.182 80 7m
48+
```
5149

52-
| Note: This will make the cluster accessible from anywhere to any port. You can create a more specific rule to only allow TCP traffic to the port 80
50+
Note that the `HOST` is not correct since the IP that the Ingress provided us is different. To modify it execute `kubectl edit ingress todos`. That will open an editor in which you can change the key `host: 35.196.179.155.xip.io` for `host: 35.229.122.182.xip.io` or simply remove the key and the value to make it compatible with any host. Once you do that you should be able to access the functions:
5351

54-
You should now be able to access the functions:
55-
```console
56-
$ curl 35.196.212.24/read-all
52+
```
53+
$ kubectl get ingress
54+
NAME HOSTS ADDRESS PORTS AGE
55+
todos 35.229.122.182.xip.io 35.229.122.182 80 7m
56+
$ curl 35.229.122.182.xip.io/read-all
5757
[]
5858
```
5959

60-
This IP is the one that should be used as `API_URL` in the frontend.
60+
This host is the one that should be used as `API_URL` in the frontend.

0 commit comments

Comments
 (0)