Convert gcutil to gcloud compute
This commit is contained in:
parent
5e7b2b4016
commit
00b05e7276
|
@ -39,8 +39,7 @@ redis-master-pod gurpartap/redis kubernetes-minion-3.c.thockin-dev.intern
|
|||
If you ssh to that machine, you can run `docker ps` to see the actual pod:
|
||||
|
||||
```shell
|
||||
$ gcutil ssh --zone us-central1-b kubernetes-minion-3
|
||||
$ sudo docker ps
|
||||
me@workstation$ gcloud compute ssh --zone us-central1-b kubernetes-minion-3
|
||||
|
||||
me@kubernetes-minion-3:~$ sudo docker ps
|
||||
CONTAINER ID IMAGE COMMAND CREATED STATUS
|
||||
|
@ -165,33 +164,33 @@ redis-slave name=redis,role=slave name=redis,role=slave 10.0.0.2
|
|||
guestbook name=guestbook 10.0.0.3 3000
|
||||
```
|
||||
|
||||
To play with the service itself, find the external IP of the load balancer from the [Google Cloud Console][cloud-console] or the `gcutil` tool, and visit `http://<ip>:3000`.
|
||||
To play with the service itself, find the external IP of the load balancer from the [Google Cloud Console][cloud-console] or the `gcloud` tool, and visit `http://<ip>:3000`.
|
||||
|
||||
```shell
|
||||
$ gcutil getforwardingrule guestbook
|
||||
+---------------+-----------------------------------+
|
||||
| name | guestbook |
|
||||
| description | |
|
||||
| creation-time | 2014-10-15T19:07:24.837-07:00 |
|
||||
| region | us-central1 |
|
||||
| ip | 12.34.56.78 |
|
||||
| protocol | TCP |
|
||||
| port-range | 3000-3000 |
|
||||
| target | us-central1/targetPools/guestbook |
|
||||
+---------------+-----------------------------------+
|
||||
$ gcloud compute forwarding-rules describe --region=us-central1 guestbook
|
||||
IPAddress: 11.22.33.44
|
||||
IPProtocol: TCP
|
||||
creationTimestamp: '2014-11-24T16:08:15.327-08:00'
|
||||
id: '17594840560849468061'
|
||||
kind: compute#forwardingRule
|
||||
name: guestbook
|
||||
portRange: 1-65535
|
||||
region: https://www.googleapis.com/compute/v1/projects/jbeda-prod/regions/us-central1
|
||||
selfLink: https://www.googleapis.com/compute/v1/projects/jbeda-prod/regions/us-central1/forwardingRules/guestbook
|
||||
target: https://www.googleapis.com/compute/v1/projects/jbeda-prod/regions/us-central1/targetPools/guestbook
|
||||
```
|
||||
|
||||
You may need to open the firewall for port 3000 using the [console][cloud-console] or the `gcutil` tool. The following command will allow traffic from any source to instances tagged `kubernetes-minion`:
|
||||
You may need to open the firewall for port 3000 using the [console][cloud-console] or the `gcloud` tool. The following command will allow traffic from any source to instances tagged `kubernetes-minion`:
|
||||
|
||||
```shell
|
||||
$ gcutil addfirewall --allowed=tcp:3000 --target_tags=kubernetes-minion kubernetes-minion-3000
|
||||
$ gcloud compute firewall-rules create --allow=tcp:3000 --target-tags=kubernetes-minion kubernetes-minion-3000
|
||||
```
|
||||
|
||||
If you are running Kubernetes locally, you can just visit http://localhost:3000
|
||||
For details about limiting traffic to specific sources, see the [gcutil documentation][gcutil-docs]
|
||||
For details about limiting traffic to specific sources, see the [GCE firewall documentation][gce-firewall-docs].
|
||||
|
||||
[cloud-console]: https://console.developer.google.com
|
||||
[gcutil-docs]: https://developers.google.com/compute/docs/gcutil/reference/firewall#addfirewall
|
||||
[gce-firewall-docs]: https://cloud.google.com/compute/docs/networking#firewalls
|
||||
|
||||
### Step Seven: Cleanup
|
||||
|
||||
|
|
|
@ -66,8 +66,7 @@ redis-master dockerfile/redis kubernetes-minion-3.c.briandpe-api.inter
|
|||
If you ssh to that machine, you can run `docker ps` to see the actual pod:
|
||||
|
||||
```shell
|
||||
$ gcutil ssh --zone us-central1-b kubernetes-minion-3
|
||||
$ sudo docker ps
|
||||
me@workstation$ gcloud compute ssh --zone us-central1-b kubernetes-minion-3
|
||||
|
||||
me@kubernetes-minion-3:~$ sudo docker ps
|
||||
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
|
||||
|
@ -308,23 +307,23 @@ if (isset($_GET['cmd']) === true) {
|
|||
} ?>
|
||||
```
|
||||
|
||||
To play with the service itself, find the name of a frontend, grab the external IP of that host from the [Google Cloud Console][cloud-console] or the `gcutil` tool, and visit `http://<host-ip>:8000`.
|
||||
To play with the service itself, find the name of a frontend, grab the external IP of that host from the [Google Cloud Console][cloud-console] or the `gcloud` tool, and visit `http://<host-ip>:8000`.
|
||||
|
||||
```shell
|
||||
$ gcutil listinstances
|
||||
$ gcloud compute instances list
|
||||
```
|
||||
|
||||
You may need to open the firewall for port 8000 using the [console][cloud-console] or the `gcutil` tool. The following command will allow traffic from any source to instances tagged `kubernetes-minion`:
|
||||
You may need to open the firewall for port 8000 using the [console][cloud-console] or the `gcloud` tool. The following command will allow traffic from any source to instances tagged `kubernetes-minion`:
|
||||
|
||||
```shell
|
||||
$ gcutil addfirewall --allowed=tcp:8000 --target_tags=kubernetes-minion kubernetes-minion-8000
|
||||
$ gcloud compute firewall-rules create --allow=tcp:8000 --target-tags=kubernetes-minion kubernetes-minion-8000
|
||||
```
|
||||
|
||||
If you are running Kubernetes locally, you can just visit http://localhost:8000.
|
||||
For details about limiting traffic to specific sources, see the [gcutil documentation][gcutil-docs].
|
||||
For details about limiting traffic to specific sources, see the [GCE firewall documentation][gce-firewall-docs].
|
||||
|
||||
[cloud-console]: https://console.developer.google.com
|
||||
[gcutil-docs]: https://developers.google.com/compute/docs/gcutil/reference/firewall#addfirewall
|
||||
[gce-firewall-docs]: https://cloud.google.com/compute/docs/networking#firewalls
|
||||
|
||||
### Step Six: Cleanup
|
||||
|
||||
|
|
|
@ -33,10 +33,12 @@ It also assumes that `$DOCKER_HUB_USER` is set to your Docker user id. We use t
|
|||
$ export DOCKER_HUB_USER=my-docker-id
|
||||
```
|
||||
|
||||
You may need to open the firewall for port 8080 using the [console][cloud-console] or the `gcutil` tool. The following command will allow traffic from any source to instances tagged `kubernetes-minion`:
|
||||
You may need to open the firewall for port 8080 using the [console][cloud-console] or the `gcloud` tool. The following command will allow traffic from any source to instances tagged `kubernetes-minion`:
|
||||
|
||||
```bash
|
||||
$ gcutil addfirewall --allowed=tcp:8080 --target_tags=kubernetes-minion kubernetes-minion-8080
|
||||
$ gcloud compute firewall-rules create \
|
||||
--allow tcp:8080 --target-tags=kubernetes-minion \
|
||||
--zone=us-central1-a kubernetes-minion-8080
|
||||
```
|
||||
|
||||
### Step Zero: Build the Docker images
|
||||
|
|
Loading…
Reference in New Issue