-
Notifications
You must be signed in to change notification settings - Fork 7
/
fider-bcgov.dc.yaml
297 lines (297 loc) · 9.55 KB
/
fider-bcgov.dc.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
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
---
kind: Template
apiVersion: template.openshift.io/v1
message: A new Fider application, customized with noTLS, has been created in your project
metadata:
name: nrmf-feedback-dc
parameters:
- description: The OpenShift Namespace where the ImageStream resides.
displayName: Namespace
name: IS_NAMESPACE
value: 599f0a-tools
- description: The OpenShift ImageStream name.
displayName: Image Stream
name: IS_NAME
value: fider-bcgov
- description: Version of Feedback image to be used (e.g. v0.18.0)
displayName: Version of Fider Product Feedback
name: IS_VERSION
value: 0.21.1
- description: The short-name of the Feedback Product, lower-case with hyphen.
displayName: Feedback Product Name
name: FEEDBACK_NAME
required: true
value: nrm
- description: The Fider environment (development | production).
displayName: Fider Go Environment
name: GO_ENV
value: production
- description: The Fider loggin level (DEBUG | INFO | ERROR).
displayName: Fider application logging level
name: LOG_LEVEL
value: ERROR
- description: JWT Secret.
displayName: Fider Go Environment
from: "[a-zA-Z0-9]{32}"
generate: expression
name: JWT_SECRET
required: true
- description: Email SMTP Host Configuration
displayName: SMTP Host
name: EMAIL_SMTP_HOST
value: apps.smtp.gov.bc.ca
- description: Email SMTP Port Configuration
displayName: SMTP Port
name: EMAIL_SMTP_PORT
value: "25"
- description: Email SMTP Username
displayName: SMTP User
name: EMAIL_SMTP_USERNAME
value: [email protected]
- description: Email SMTP No-Reply Address
displayName: SMTP No-Reply Address
name: EMAIL_NOREPLY
value: [email protected]
- description: Google Social Media Configuration ID
displayName: Google SoMe AppID
name: OAUTH_GOOGLE_CLIENTID
value: ""
- description: Google Social Media Configuration Secret
displayName: Google SoMe Secret
name: OAUTH_GOOGLE_SECRET
value: ""
- description: FaceBook Social Media Configuration ID
displayName: FaceBook SoMe AppID
name: OAUTH_FACEBOOK_APPID
value: ""
- description: FaceBook Social Media Configuration Secret
displayName: FaceBook SoMe Secret
name: OAUTH_FACEBOOK_SECRET
value: ""
- description: GitHub Social Media Configuration ID
displayName: GitHub SoMe AppID
name: OAUTH_GITHUB_CLIENTID
value: ""
- description: GitHub Social Media Configuration Secret
displayName: GitHub SoMe Secret
name: OAUTH_GITHUB_SECRET
value: ""
- name: CPU_LIMIT
value: 500m
- name: MEMORY_LIMIT
value: 1Gi
- name: CPU_REQUEST
value: 80m
- name: MEMORY_REQUEST
value: 196Mi
- name: REPLICA_MIN
value: "2"
- name: REPLICA_MAX
value: "3"
objects:
- kind: Secret
apiVersion: v1
metadata:
name: "${FEEDBACK_NAME}-jwt"
labels:
app: "${FEEDBACK_NAME}"
annotations:
description: Fider JWT token.
template.openshift.io/expose-fider_jst: "{.data['fider-jwt']}"
stringData:
fider-jwt: "${JWT_SECRET}"
- kind: DeploymentConfig
apiVersion: v1
metadata:
name: "${FEEDBACK_NAME}-app"
generation: 1
labels:
app: "${FEEDBACK_NAME}"
annotations: {}
spec:
strategy:
type: Rolling
rollingParams:
updatePeriodSeconds: 1
intervalSeconds: 1
timeoutSeconds: 180
maxUnavailable: 25%
maxSurge: 25%
resources: {}
activeDeadlineSeconds: 21600
triggers:
- type: ConfigChange
- type: ImageChange
imageChangeParams:
automatic: true
containerNames:
- "${FEEDBACK_NAME}-fider-app"
from:
kind: ImageStreamTag
namespace: "${IS_NAMESPACE}"
name: "${IS_NAME}:${IS_VERSION}"
replicas: "${{REPLICA_MIN}}"
revisionHistoryLimit: 10
test: false
selector:
app: "${FEEDBACK_NAME}"
deploymentconfig: "${FEEDBACK_NAME}-app"
template:
metadata:
labels:
app: "${FEEDBACK_NAME}"
deploymentconfig: "${FEEDBACK_NAME}-app"
annotations: {}
spec:
containers:
- name: "${FEEDBACK_NAME}-fider-app"
image: " "
ports:
- containerPort: 3000
protocol: TCP
env:
- name: POSTGRESQL_USERNAME
valueFrom:
secretKeyRef:
name: "${FEEDBACK_NAME}-postgresql"
key: database-user
- name: POSTGRESQL_PASSWORD
valueFrom:
secretKeyRef:
name: "${FEEDBACK_NAME}-postgresql"
key: database-password
- name: POSTGRESQL_DB_NAME
valueFrom:
secretKeyRef:
name: "${FEEDBACK_NAME}-postgresql"
key: database-name
- name: POSTGRESQL_DB_HOST
value: "${FEEDBACK_NAME}-postgresql"
- name: POSTGRESQL_PORT
value: "5432"
- description: The Fider environment (development | production).
displayName: Fider Go Environment
name: GO_ENV
value: "${GO_ENV}"
- description: The Fider loggin level (DEBUG | INFO).
displayName: Fider application logging level
name: LOG_LEVEL
value: "${LOG_LEVEL}"
- description: Email SMTP Host Configuration
displayName: SMTP Host
name: EMAIL_SMTP_HOST
value: "${EMAIL_SMTP_HOST}"
- description: Email SMTP Port Configuration
displayName: SMTP Port
name: EMAIL_SMTP_PORT
value: "${EMAIL_SMTP_PORT}"
- description: Email SMTP Username.
displayName: Email Username
name: EMAIL_SMTP_USERNAME
value: "${EMAIL_SMTP_USERNAME}"
- description: From which account e-mails will be sent.
displayName: From Email Address
name: EMAIL_NOREPLY
value: "${EMAIL_NOREPLY}"
- description: Email SMTP Username.
displayName: Email Username
name: EMAIL_SMTP_USERNAME
value: "${EMAIL_SMTP_USERNAME}"
- description: Connection string to the database.
displayName: Database connection
name: DATABASE_URL
value: postgres://$(POSTGRESQL_USERNAME):$(POSTGRESQL_PASSWORD)@$(POSTGRESQL_DB_HOST):$(POSTGRESQL_PORT)/${FEEDBACK_NAME}?sslmode=disable
- name: HOST_DOMAIN
value: ${FEEDBACK_NAME}.apps.silver.devops.gov.bc.ca
- name: JWT_SECRET
valueFrom:
secretKeyRef:
name: "${FEEDBACK_NAME}-jwt"
key: fider-jwt
resources:
limits:
cpu: "${CPU_LIMIT}"
memory: "${MEMORY_LIMIT}"
requests:
cpu: "${CPU_REQUEST}"
memory: "${MEMORY_REQUEST}"
livenessProbe:
exec:
command:
- ./fider
- ping
initialDelaySeconds: 60
periodSeconds: 15
successThreshold: 1
failureThreshold: 6
readinessProbe:
exec:
command:
- ./fider
- ping
initialDelaySeconds: 30
timeoutSeconds: 15
periodSeconds: 30
successThreshold: 1
failureThreshold: 10
terminationMessagePath: "/dev/termination-log"
terminationMessagePolicy: File
imagePullPolicy: Always
restartPolicy: Always
terminationGracePeriodSeconds: 30
dnsPolicy: ClusterFirst
securityContext: {}
schedulerName: default-scheduler
- apiVersion: autoscaling/v1
kind: HorizontalPodAutoscaler
metadata:
name: "${FEEDBACK_NAME}-app"
labels:
app: "${FEEDBACK_NAME}-app"
spec:
maxReplicas: "${{REPLICA_MAX}}"
minReplicas: "${{REPLICA_MIN}}"
scaleTargetRef:
apiVersion: apps.openshift.io/v1
kind: DeploymentConfig
name: "${FEEDBACK_NAME}-app"
targetCPUUtilizationPercentage: 95
- kind: Service
apiVersion: v1
metadata:
name: "${FEEDBACK_NAME}"
labels:
app: "${FEEDBACK_NAME}"
annotations:
description: Exposes and load balances the application pods
spec:
ports:
- name: web
protocol: TCP
port: 8080
targetPort: 3000
selector:
app: "${FEEDBACK_NAME}"
deploymentconfig: "${FEEDBACK_NAME}-app"
type: ClusterIP
sessionAffinity: None
status:
loadBalancer: {}
- kind: Route
apiVersion: v1
metadata:
name: "${FEEDBACK_NAME}"
creationTimestamp:
labels:
app: "${FEEDBACK_NAME}"
spec:
host: "${FEEDBACK_NAME}.apps.silver.devops.gov.bc.ca"
to:
kind: Service
name: "${FEEDBACK_NAME}"
weight: 100
port:
targetPort: web
tls:
termination: edge
wildcardPolicy: None