-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathkubernetes.yaml
233 lines (233 loc) · 5.38 KB
/
kubernetes.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
apiVersion: v1
kind: Namespace
metadata:
name: loanbroker-example
---
apiVersion: serving.knative.dev/v1
kind: Service
metadata:
name: loanbroker-bank1
namespace: loanbroker-example
spec:
template:
metadata:
creationTimestamp: null
spec:
containerConcurrency: 0
containers:
- env:
- name: BANK_ID
value: Bank1
- name: MAX_LOAN_AMOUNT
value: "500000"
- name: MIN_CREDIT_SCORE
value: "300"
- name: BASE_RATE
value: "3"
image: dev.local/loanbroker-bank:latest
imagePullPolicy: IfNotPresent
livenessProbe:
httpGet:
path: /health/liveness
port: 0
name: user-container
readinessProbe:
httpGet:
path: /health/readiness
port: 0
successThreshold: 1
resources: {}
enableServiceLinks: false
timeoutSeconds: 300
traffic:
- latestRevision: true
percent: 100
---
apiVersion: serving.knative.dev/v1
kind: Service
metadata:
name: loanbroker-bank2
namespace: loanbroker-example
spec:
template:
metadata:
creationTimestamp: null
spec:
containerConcurrency: 0
containers:
- env:
- name: BANK_ID
value: Bank2
- name: MAX_LOAN_AMOUNT
value: "65536"
- name: MIN_CREDIT_SCORE
value: "100"
- name: BASE_RATE
value: "2"
image: dev.local/loanbroker-bank:latest
imagePullPolicy: IfNotPresent
livenessProbe:
httpGet:
path: /health/liveness
port: 0
name: user-container
readinessProbe:
httpGet:
path: /health/readiness
port: 0
successThreshold: 1
resources: {}
enableServiceLinks: false
timeoutSeconds: 300
traffic:
- latestRevision: true
percent: 100
---
apiVersion: serving.knative.dev/v1
kind: Service
metadata:
name: loanbroker-bank3
namespace: loanbroker-example
spec:
template:
metadata:
creationTimestamp: null
spec:
containerConcurrency: 0
containers:
- env:
- name: BANK_ID
value: Bank3
- name: MAX_LOAN_AMOUNT
value: "10000"
- name: MIN_CREDIT_SCORE
value: "400"
- name: BASE_RATE
value: "2"
image: dev.local/loanbroker-bank:latest
imagePullPolicy: IfNotPresent
livenessProbe:
httpGet:
path: /health/liveness
port: 0
name: user-container
readinessProbe:
httpGet:
path: /health/readiness
port: 0
successThreshold: 1
resources: {}
enableServiceLinks: false
timeoutSeconds: 300
traffic:
- latestRevision: true
percent: 100
---
apiVersion: serving.knative.dev/v1
kind: Service
metadata:
name: loanbroker-credit-bureau
namespace: loanbroker-example
spec:
template:
metadata:
creationTimestamp: null
spec:
containerConcurrency: 0
containers:
- image: dev.local/loanbroker-credit-bureau:latest
imagePullPolicy: IfNotPresent
livenessProbe:
httpGet:
path: /health/liveness
port: 0
name: user-container
readinessProbe:
httpGet:
path: /health/readiness
port: 0
successThreshold: 1
resources: {}
enableServiceLinks: false
timeoutSeconds: 300
traffic:
- latestRevision: true
percent: 100
---
# trigger for the Bank Function
# remove it once kn func implements this feature
apiVersion: eventing.knative.dev/v1
kind: Trigger
metadata:
name: trigger-aggregator-bank1-quote
namespace: loanbroker-example
spec:
broker: default
filter:
attributes:
type: kogito.serverless.workflow.request.quote
subscriber:
ref:
apiVersion: serving.knative.dev/v1
kind: Service
name: loanbroker-bank1
---
apiVersion: eventing.knative.dev/v1
kind: Trigger
metadata:
name: trigger-aggregator-bank2-quote
namespace: loanbroker-example
spec:
broker: default
filter:
attributes:
type: kogito.serverless.workflow.request.quote
subscriber:
ref:
apiVersion: serving.knative.dev/v1
kind: Service
name: loanbroker-bank2
---
apiVersion: eventing.knative.dev/v1
kind: Trigger
metadata:
name: trigger-aggregator-bank3-quote
namespace: loanbroker-example
spec:
broker: default
filter:
attributes:
type: kogito.serverless.workflow.request.quote
subscriber:
ref:
apiVersion: serving.knative.dev/v1
kind: Service
name: loanbroker-bank3
---
# use for debugging
# simple knative application to display the routed messages
apiVersion: serving.knative.dev/v1
kind: Service
metadata:
name: event-display
namespace: loanbroker-example
spec:
template:
spec:
containers:
- # This corresponds to
# https://github.com/knative/eventing-contrib/tree/main/cmd/event_display
image: gcr.io/knative-releases/knative.dev/eventing-contrib/cmd/event_display@sha256:a214514d6ba674d7393ec8448dd272472b2956207acb3f83152d3071f0ab1911
---
apiVersion: eventing.knative.dev/v1
kind: Trigger
metadata:
name: trigger-eventdisplay
namespace: loanbroker-example
spec:
broker: default
subscriber:
ref:
apiVersion: serving.knative.dev/v1
kind: Service
name: event-display