You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: guestbook-go/README.md
+32-32Lines changed: 32 additions & 32 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,6 @@
1
1
## Guestbook Example
2
2
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.
4
4
5
5
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).
6
6
@@ -9,8 +9,8 @@ If you are running a cluster in Google Container Engine (GKE), instead see the [
9
9
*[Step Zero: Prerequisites](#step-zero)
10
10
*[Step One: Create the Redis master pod](#step-one)
11
11
*[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)
14
14
*[Step Five: Create the guestbook pods](#step-five)
15
15
*[Step Six: Create the guestbook service](#step-six)
16
16
*[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
92
92
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).
93
93
94
94
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>
96
96
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.
98
98
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:
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`).
117
117
118
118
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:
120
120
121
121
```console
122
-
redis-server --slaveof redis-master 6379
122
+
redis-server --replicaof redis-master 6379
123
123
```
124
124
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:
126
126
127
127
```console
128
128
$ kubectl get pods
129
129
NAME READY STATUS RESTARTS AGE
130
130
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
133
133
...
134
134
```
135
135
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.
137
137
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>
139
139
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.
141
141
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:
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.
160
160
161
161
Tip: It is helpful to set labels on your services themselves--as we've done here--to make it easy to locate them later.
162
162
163
163
### Step Five: Create the guestbook pods <a id="step-five"></a>
164
164
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.
166
166
167
167
1. Use the [guestbook-controller.json](guestbook-controller.json) file to create the guestbook replication controller by running the `kubectl create -f` *`filename`* command:
168
168
@@ -178,9 +178,9 @@ This is a simple Go `net/http` ([negroni](https://github.com/codegangsta/negroni
0 commit comments