...
1# Two backend pods, one always failing
2# and another one returning OK response
3# Slowcooker is used to generate traffic
4# that will be routed via traffic split
5
6# Two backends serve at different ports i.e
7# 8080 and 8081.
8---
9apiVersion: apps/v1
10kind: Deployment
11metadata:
12 name: backend
13spec:
14 replicas: 1
15 selector:
16 matchLabels:
17 app: backend
18 template:
19 metadata:
20 labels:
21 app: backend
22 spec:
23 containers:
24 - name: backend
25 image: buoyantio/bb:v0.0.6
26 args:
27 - terminus
28 - "--h1-server-port=8080"
29 - "--response-text=backend1"
30 ports:
31 - containerPort: 8080
32---
33apiVersion: v1
34kind: Service
35metadata:
36 name: backend-svc
37spec:
38 selector:
39 app: backend
40 ports:
41 - name: http
42 port: 8080
43 targetPort: 8080
44---
45apiVersion: apps/v1
46kind: Deployment
47metadata:
48 name: failing
49spec:
50 replicas: 1
51 selector:
52 matchLabels:
53 app: failing
54 template:
55 metadata:
56 labels:
57 app: failing
58 spec:
59 containers:
60 - name: failing
61 image: buoyantio/bb:v0.0.6
62 args:
63 - terminus
64 - "--h1-server-port=8081"
65 - "--response-text=failing"
66 - "--percent-failure=100"
67 ports:
68 - containerPort: 8081
69---
70apiVersion: v1
71kind: Service
72metadata:
73 name: failing-svc
74spec:
75 selector:
76 app: failing
77 ports:
78 - name: http
79 port: 8081
80 targetPort: 8081
81---
82apiVersion: apps/v1
83kind: Deployment
84metadata:
85 name: slow-cooker
86spec:
87 replicas: 1
88 selector:
89 matchLabels:
90 app: slow-cooker
91 template:
92 metadata:
93 labels:
94 app: slow-cooker
95 spec:
96 containers:
97 - name: slow-cooker
98 image: buoyantio/slow_cooker:1.3.0
99 command:
100 - "/bin/sh"
101 args:
102 - "-c"
103 - |
104 sleep 5 # wait for pods to start
105 /slow_cooker/slow_cooker http://backend-svc:8080
106 ports:
107 - containerPort: 9999
View as plain text