Skip to content

Commit 565a6a5

Browse files
committed
language replace
1 parent 802539a commit 565a6a5

File tree

1 file changed

+32
-32
lines changed

1 file changed

+32
-32
lines changed

guestbook-go/README.md

Lines changed: 32 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
## Guestbook Example
22

3-
This example shows how to build a simple multi-tier web application using Kubernetes and Docker. The application consists of a web front end, Redis master for storage, and replicated set of Redis slaves, all for which we will create Kubernetes replication controllers, pods, and services.
3+
This example shows how to build a simple multi-tier web application using Kubernetes and Docker. The application consists of a web front end, Redis master for storage, and replicated set of Redis replicas, all for which we will create Kubernetes replication controllers, pods, and services.
44

55
If you are running a cluster in Google Container Engine (GKE), instead see the [Guestbook Example for Google Container Engine](https://cloud.google.com/container-engine/docs/tutorials/guestbook).
66

@@ -9,8 +9,8 @@ If you are running a cluster in Google Container Engine (GKE), instead see the [
99
* [Step Zero: Prerequisites](#step-zero)
1010
* [Step One: Create the Redis master pod](#step-one)
1111
* [Step Two: Create the Redis master service](#step-two)
12-
* [Step Three: Create the Redis slave pods](#step-three)
13-
* [Step Four: Create the Redis slave service](#step-four)
12+
* [Step Three: Create the Redis replica pods](#step-three)
13+
* [Step Four: Create the Redis replica service](#step-four)
1414
* [Step Five: Create the guestbook pods](#step-five)
1515
* [Step Six: Create the guestbook service](#step-six)
1616
* [Step Seven: View the guestbook](#step-seven)
@@ -92,77 +92,77 @@ Services find the pods to load balance based on pod labels. The pod that you cre
9292
Result: All new pods will see the `redis-master` service running on the host (`$REDIS_MASTER_SERVICE_HOST` environment variable) at port 6379, or running on `redis-master:6379`. After the service is created, the service proxy on each node is configured to set up a proxy on the specified port (in our example, that's port 6379).
9393

9494

95-
### Step Three: Create the Redis slave pods <a id="step-three"></a>
95+
### Step Three: Create the Redis replica pods <a id="step-three"></a>
9696

97-
The Redis master we created earlier is a single pod (REPLICAS = 1), while the Redis read slaves we are creating here are 'replicated' pods. In Kubernetes, a replication controller is responsible for managing the multiple instances of a replicated pod.
97+
The Redis master we created earlier is a single pod (REPLICAS = 1), while the Redis read replicas we are creating here are 'replicated' pods. In Kubernetes, a replication controller is responsible for managing the multiple instances of a replicated pod.
9898

99-
1. Use the file [redis-slave-controller.json](redis-slave-controller.json) to create the replication controller by running the `kubectl create -f` *`filename`* command:
99+
1. Use the file [redis-replica-controller.json](redis-replica-controller.json) to create the replication controller by running the `kubectl create -f` *`filename`* command:
100100

101101
```console
102-
$ kubectl create -f examples/guestbook-go/redis-slave-controller.json
102+
$ kubectl create -f examples/guestbook-go/redis-replica-controller.json
103103
104104
```
105105

106-
2. To verify that the redis-slave controller is running, run the `kubectl get rc` command:
106+
2. To verify that the redis-replica controller is running, run the `kubectl get rc` command:
107107

108108
```console
109109
$ kubectl get rc
110110
CONTROLLER CONTAINER(S) IMAGE(S) SELECTOR REPLICAS
111111
redis-master redis-master redis app=redis,role=master 1
112-
redis-slave redis-slave k8s.gcr.io/redis-slave:v2 app=redis,role=slave 2
112+
redis-replica redis-replica k8s.gcr.io/redis-slave:v2 app=redis,role=replica 2
113113
...
114114
```
115115

116-
Result: The replication controller creates and configures the Redis slave pods through the redis-master service (name:port pair, in our example that's `redis-master:6379`).
116+
Result: The replication controller creates and configures the Redis replica pods through the redis-master service (name:port pair, in our example that's `redis-master:6379`).
117117

118118
Example:
119-
The Redis slaves get started by the replication controller with the following command:
119+
The Redis replicas get started by the replication controller with the following command:
120120

121121
```console
122-
redis-server --slaveof redis-master 6379
122+
redis-server --replicaof redis-master 6379
123123
```
124124

125-
3. To verify that the Redis master and slaves pods are running, run the `kubectl get pods` command:
125+
3. To verify that the Redis master and replicas pods are running, run the `kubectl get pods` command:
126126

127127
```console
128128
$ kubectl get pods
129129
NAME READY STATUS RESTARTS AGE
130130
redis-master-xx4uv 1/1 Running 0 18m
131-
redis-slave-b6wj4 1/1 Running 0 1m
132-
redis-slave-iai40 1/1 Running 0 1m
131+
redis-replica-b6wj4 1/1 Running 0 1m
132+
redis-replica-iai40 1/1 Running 0 1m
133133
...
134134
```
135135

136-
Result: You see the single Redis master and two Redis slave pods.
136+
Result: You see the single Redis master and two Redis replica pods.
137137

138-
### Step Four: Create the Redis slave service <a id="step-four"></a>
138+
### Step Four: Create the Redis replica service <a id="step-four"></a>
139139

140-
Just like the master, we want to have a service to proxy connections to the read slaves. In this case, in addition to discovery, the Redis slave service provides transparent load balancing to clients.
140+
Just like the master, we want to have a service to proxy connections to the read replicas. In this case, in addition to discovery, the Redis replica service provides transparent load balancing to clients.
141141

142-
1. Use the [redis-slave-service.json](redis-slave-service.json) file to create the Redis slave service by running the `kubectl create -f` *`filename`* command:
142+
1. Use the [redis-replica-service.json](redis-replica-service.json) file to create the Redis replica service by running the `kubectl create -f` *`filename`* command:
143143

144144
```console
145-
$ kubectl create -f examples/guestbook-go/redis-slave-service.json
145+
$ kubectl create -f examples/guestbook-go/redis-replica-service.json
146146
147147
```
148148

149-
2. To verify that the redis-slave service is up, list the services you created in the cluster with the `kubectl get services` command:
149+
2. To verify that the redis-replica service is up, list the services you created in the cluster with the `kubectl get services` command:
150150

151151
```console
152152
$ kubectl get services
153153
NAME CLUSTER_IP EXTERNAL_IP PORT(S) SELECTOR AGE
154154
redis-master 10.0.136.3 <none> 6379/TCP app=redis,role=master 1h
155-
redis-slave 10.0.21.92 <none> 6379/TCP app-redis,role=slave 1h
155+
redis-replica 10.0.21.92 <none> 6379/TCP app-redis,role=replica 1h
156156
...
157157
```
158158

159-
Result: The service is created with labels `app=redis` and `role=slave` to identify that the pods are running the Redis slaves.
159+
Result: The service is created with labels `app=redis` and `role=replica` to identify that the pods are running the Redis replicas.
160160

161161
Tip: It is helpful to set labels on your services themselves--as we've done here--to make it easy to locate them later.
162162

163163
### Step Five: Create the guestbook pods <a id="step-five"></a>
164164

165-
This is a simple Go `net/http` ([negroni](https://github.com/codegangsta/negroni) based) server that is configured to talk to either the slave or master services depending on whether the request is a read or a write. The pods we are creating expose a simple JSON interface and serves a jQuery-Ajax based UI. Like the Redis slave pods, these pods are also managed by a replication controller.
165+
This is a simple Go `net/http` ([negroni](https://github.com/codegangsta/negroni) based) server that is configured to talk to either the replica or master services depending on whether the request is a read or a write. The pods we are creating expose a simple JSON interface and serves a jQuery-Ajax based UI. Like the Redis replica pods, these pods are also managed by a replication controller.
166166

167167
1. Use the [guestbook-controller.json](guestbook-controller.json) file to create the guestbook replication controller by running the `kubectl create -f` *`filename`* command:
168168

@@ -178,9 +178,9 @@ This is a simple Go `net/http` ([negroni](https://github.com/codegangsta/negroni
178178
```console
179179
$ kubectl get rc
180180
CONTROLLER CONTAINER(S) IMAGE(S) SELECTOR REPLICAS
181-
guestbook guestbook k8s.gcr.io/guestbook:v3 app=guestbook 3
181+
guestbook guestbook k8s.gcr.io/guestbook:v3 app=guestbook 3
182182
redis-master redis-master redis app=redis,role=master 1
183-
redis-slave redis-slave k8s.gcr.io/redis-slave:v2 app=redis,role=slave 2
183+
redis-replica redis-replica k8s.gcr.io/redis-replica:v2 app=redis,role=replica 2
184184
...
185185
```
186186

@@ -193,12 +193,12 @@ This is a simple Go `net/http` ([negroni](https://github.com/codegangsta/negroni
193193
guestbook-gv7i6 1/1 Running 0 2m
194194
guestbook-x405a 1/1 Running 0 2m
195195
redis-master-xx4uv 1/1 Running 0 23m
196-
redis-slave-b6wj4 1/1 Running 0 6m
197-
redis-slave-iai40 1/1 Running 0 6m
196+
redis-replica-b6wj4 1/1 Running 0 6m
197+
redis-replica-iai40 1/1 Running 0 6m
198198
...
199199
```
200200

201-
Result: You see a single Redis master, two Redis slaves, and three guestbook pods.
201+
Result: You see a single Redis master, two Redis replicas, and three guestbook pods.
202202

203203
### Step Six: Create the guestbook service <a id="step-six"></a>
204204

@@ -218,7 +218,7 @@ Just like the others, we create a service to group the guestbook pods but this t
218218
NAME CLUSTER_IP EXTERNAL_IP PORT(S) SELECTOR AGE
219219
guestbook 10.0.217.218 146.148.81.8 3000/TCP app=guestbook 1h
220220
redis-master 10.0.136.3 <none> 6379/TCP app=redis,role=master 1h
221-
redis-slave 10.0.21.92 <none> 6379/TCP app-redis,role=slave 1h
221+
redis-replica 10.0.21.92 <none> 6379/TCP app-redis,role=replica 1h
222222
...
223223
```
224224

@@ -258,8 +258,8 @@ guestbook-controller
258258
guestbook
259259
redid-master-controller
260260
redis-master
261-
redis-slave-controller
262-
redis-slave
261+
redis-replica-controller
262+
redis-replica
263263
```
264264

265265
Tip: To turn down your Kubernetes cluster, follow the corresponding instructions in the version of the

0 commit comments

Comments
 (0)