-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathobpapi_k8s_with_kafka.yaml
197 lines (197 loc) · 5.7 KB
/
obpapi_k8s_with_kafka.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
apiVersion: v1
kind: Secret
metadata:
name: postgres-credentials
type: Opaque
data:
postgres_user: cG9zdGdyZXM= #postgres
postgres_password: cGFzc3dvcmQ= #password
postgres_db_name: cG9zdGdyZXM= #postgres
postgres_data: L3Zhci9saWIvcG9zdGdyZXNxbC9kYXRhL3BnZGF0YQ== # /var/lib/postgresql/data/pgdata
jdbc_driver: b3JnLnBvc3RncmVzcWwuRHJpdmVy # org.postgresql.Driver
jdbc_url: amRiYzpwb3N0Z3Jlc3FsOi8vcG9zdGdyZXMtc2VydmljZTo1NDMyL3Bvc3RncmVzP3VzZXI9cG9zdGdyZXMmcGFzc3dvcmQ9cGFzc3dvcmQ= # jdbc:postgresql://postgres-service:5432/postgres?user=postgres&password=password
---
apiVersion: v1
kind: Secret
metadata:
name: obp-credentials
type: Opaque
data:
# Kafa
connector: a2Fma2FfdlNlcHQyMDE4 #kafka_vSept2018
kafka_bootstrap_hosts: a2Fma2Etc3ZjOjkwOTM= #kafka-svc:9093
kafka_partitions: MQ== #1
kafka_client_id: b2JwYXBpLXNlcnZpY2U= #obpapi-service
api_instance_id: b2JwYXBpLXNlcnZpY2U= #obpapi-service
kafka_akka_timeout: Mw== #3
remotedata_timeout: Mw== #3
# Debug
display_internal_errors: dHJ1ZQ== # true
---
kind: PersistentVolumeClaim
apiVersion: v1
metadata:
name: postgres-volume-claim
spec:
accessModes:
- ReadWriteOnce
volumeMode: Filesystem
resources:
requests:
storage: 5Gi
---
apiVersion: v1
kind: Service
metadata:
name: obpapi-service
spec:
selector:
app: obpapi
ports:
- name: http
protocol: TCP
port: 80
targetPort: 8080
type: LoadBalancer
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: obp-deployment
labels:
app: obpapi
spec:
replicas: 1
selector:
matchLabels:
app: obpapi
template:
metadata:
labels:
app: obpapi
spec:
containers:
- name: obpapi
image: openbankproject/obpapi-kube # docker build -t obpapi-kube .
resources:
requests:
memory: "126Mi"
env:
- name: OBP_DB_DRIVER
valueFrom:
secretKeyRef:
name: postgres-credentials
key: jdbc_driver
- name: OBP_DB_URL
valueFrom:
secretKeyRef:
name: postgres-credentials
key: jdbc_url
- name: OBP_CONNECTOR
valueFrom:
secretKeyRef:
name: obp-credentials
key: connector
- name: OBP_KAFKA_BOOTSTRAP_HOSTS
valueFrom:
secretKeyRef:
name: obp-credentials
key: kafka_bootstrap_hosts
- name: OBP_KAFKA_PARTITIONS
valueFrom:
secretKeyRef:
name: obp-credentials
key: kafka_partitions
- name: OBP_KAFKA_CLIENT_ID
valueFrom:
secretKeyRef:
name: obp-credentials
key: kafka_client_id
- name: OBP_API_INSTANCE_ID
valueFrom:
secretKeyRef:
name: obp-credentials
key: api_instance_id
- name: OBP_KAFKA_AKKA_TIMEOUT
valueFrom:
secretKeyRef:
name: obp-credentials
key: kafka_akka_timeout
- name: OBP_REMOTEDATA_TIMEOUT
valueFrom:
secretKeyRef:
name: obp-credentials
key: remotedata_timeout
- name: OBP_DISPLAY_INTERNAL_ERRORS
valueFrom:
secretKeyRef:
name: obp-credentials
key: display_internal_errors
ports:
- containerPort: 8080
name: http
---
apiVersion: v1
kind: Service
metadata:
name: postgres-service
spec:
selector:
app: postgres
ports:
- protocol: TCP
port: 5432
targetPort: 5432
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: postgres
labels:
app: postgres
spec:
replicas: 1
selector:
matchLabels:
app: postgres
template:
metadata:
labels:
app: postgres
spec:
containers:
- name: postgres
image: postgres:11.1-alpine
resources:
requests:
memory: "200Mi"
env:
- name: POSTGRES_USER
valueFrom:
secretKeyRef:
name: postgres-credentials
key: postgres_user
- name: POSTGRES_PASSWORD
valueFrom:
secretKeyRef:
name: postgres-credentials
key: postgres_password
- name: POSTGRES_DB
valueFrom:
secretKeyRef:
name: postgres-credentials
key: postgres_db_name
- name: PGDATA
valueFrom:
secretKeyRef:
name: postgres-credentials
key: postgres_data
volumeMounts:
- name: postgres-volume
mountPath: "/var/lib/postgresql/data"
ports:
- containerPort: 5432
volumes:
- name: postgres-volume
persistentVolumeClaim:
claimName: postgres-volume-claim