Skip to content

Commit bd15399

Browse files
committed
Clean up Kubernetes definitions.
- All related services and replication controllers live in one file. - All k8s yaml file are moved to loadtest/k8s/.
1 parent 593ad8b commit bd15399

10 files changed

+70
-140
lines changed

doc/loadtest/README.md

Lines changed: 10 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -211,10 +211,11 @@ You will have to replace `google.com/doorman` with your project name, of course,
211211
## Populating the cluster
212212

213213
### Doorman
214-
Now, time for the fun part: putting our containers into the cloud! First we'll create a replication controller for the doorman server. We want only one replica, but we need it to be restarted in case something happens. Please take a look at its code in [doorman-server.yaml](doorman-server.yaml).
214+
Now, time for the fun part: putting our containers into the cloud! First we'll create a replication controller for the doorman server. We want only one replica, but we need it to be restarted in case something happens. Second, we'll create a service, that will make our server discoverable for the clients. Please take a look at the code in [doorman-server.yaml](k8s/doorman-server.yaml).
215215

216216
```console
217-
$ kubectl create -f doc/loadtest/doorman-server.yaml
217+
$ kubectl create -f doc/loadtest/k8s/doorman-server.yaml
218+
service "doorman" created
218219
replicationcontroller "doorman-server" created
219220
```
220221

@@ -253,17 +254,11 @@ to forward our 3668 port to the same container's port. Now we can go to http://l
253254

254255
![doorman's /debug/status](empty-debug-status.png)
255256

256-
Before we forget about it, let's also create a service, that will make our server discoverable for the clients:
257-
258-
```console
259-
$ kubectl create -f doc/loadtest/doorman-server-service.yaml
260-
```
261-
262257
### Prometheus
263258
Let's not forget about
264259

265260
```console
266-
$ kubectl create -f doc/loadtest/prometheus.yaml
261+
$ kubectl create -f doc/loadtest/k8s/prometheus.yaml
267262
```
268263
and quickly verify that it's running. Forward its port:
269264

@@ -277,10 +272,9 @@ And go to http://localhost:9090/graph to verify it's running.
277272

278273
Now, it's time for the target.
279274
```console
280-
$ kubectl create -f doc/loadtest/target.yaml
281-
replicationcontroller "target" created
282-
$ kubectl create -f doc/loadtest/target-service.yaml
275+
$ kubectl create -f doc/loadtest/k8s/target.yaml
283276
service "target" created
277+
replicationcontroller "target" created
284278
```
285279

286280
Let's verify it's running:
@@ -296,8 +290,9 @@ target-4ivl7 1/1 Running 0 1m
296290
Now, the key, final element of our puzzle: the client. Let's bring it up:
297291

298292
```console
299-
$ kubectl create -f doc/loadtest/doorman-client.yaml
300-
$ kubectl create -f doc/loadtest/doorman-client-service.yaml
293+
$ kubectl create -f doc/loadtest/k8s/doorman-client.yaml
294+
service "doorman-client" created
295+
replicationcontroller "doorman-client" created
301296
```
302297

303298
This creates 10 replicas of `doorman-client`. Each replica is running the following command line:
@@ -371,4 +366,4 @@ Experiment with different capacity distribution algorithms. Edit [`config.protex
371366

372367
### High Availability
373368

374-
Make the Doorman server highly available. Add an etcd instance (or cluster) to the Kubernetes cluster, increase the number of replicas in [doorman-server.yaml](doorman-server.yaml), and configure them to do a leader election. (Hint: Use the `-etcd_endpoints` and `-master_election_lock` flags.)
369+
Make the Doorman server highly available. Add an etcd instance (or cluster) to the Kubernetes cluster, increase the number of replicas in [doorman-server.yaml](k8s/doorman-server.yaml), and configure them to do a leader election. (Hint: Use the `-etcd_endpoints` and `-master_election_lock` flags.)

doc/loadtest/doorman-client-fair.yaml

Lines changed: 0 additions & 38 deletions
This file was deleted.

doc/loadtest/doorman-client-proportional.yaml

Lines changed: 0 additions & 38 deletions
This file was deleted.

doc/loadtest/doorman-client-service.yaml

Lines changed: 0 additions & 15 deletions
This file was deleted.

doc/loadtest/doorman-server-service.yaml

Lines changed: 0 additions & 17 deletions
This file was deleted.

doc/loadtest/doorman-client.yaml renamed to doc/loadtest/k8s/doorman-client.yaml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,21 @@
1+
apiVersion: v1
2+
kind: Service
3+
metadata:
4+
labels:
5+
name: doorman-client
6+
name: doorman-client
7+
annotations:
8+
prometheus.io/scrape: "true"
9+
prometheus.io/port: "80"
10+
spec:
11+
ports:
12+
- port: 80
13+
name: http
14+
selector:
15+
app: doorman-client
16+
17+
---
18+
119
apiVersion: v1
220
kind: ReplicationController
321
metadata:

doc/loadtest/doorman-server.yaml renamed to doc/loadtest/k8s/doorman-server.yaml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,25 @@
1+
apiVersion: v1
2+
kind: ReplicationController
3+
apiVersion: v1
4+
kind: Service
5+
metadata:
6+
labels:
7+
name: doorman
8+
name: doorman
9+
annotations:
10+
prometheus.io/scrape: "true"
11+
prometheus.io/port: "3668"
12+
spec:
13+
ports:
14+
- port: 3667
15+
name: grpc
16+
- port: 3668
17+
name: http
18+
selector:
19+
app: doorman-server
20+
21+
---
22+
123
apiVersion: v1
224
kind: ReplicationController
325
metadata:
File renamed without changes.

doc/loadtest/target.yaml renamed to doc/loadtest/k8s/target.yaml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,23 @@
1+
apiVersion: v1
2+
kind: Service
3+
metadata:
4+
labels:
5+
name: target
6+
name: target
7+
annotations:
8+
prometheus.io/scrape: "true"
9+
prometheus.io/port: "80"
10+
spec:
11+
ports:
12+
- port: 81
13+
name: grpc
14+
- port: 80
15+
name: http
16+
selector:
17+
app: target
18+
19+
---
20+
121
apiVersion: v1
222
kind: ReplicationController
323
metadata:

doc/loadtest/target-service.yaml

Lines changed: 0 additions & 17 deletions
This file was deleted.

0 commit comments

Comments
 (0)