-
Notifications
You must be signed in to change notification settings - Fork 0
/
artifactory.yaml
374 lines (372 loc) · 10.7 KB
/
artifactory.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
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
kind: Template
apiVersion: v1
labels:
version: 6.8.2-1
group: infrastructure
metadata:
annotations:
description: Creates the infrastructure for the end-to-end content and security management story.
tags: instant-app,artifactory
version: 6.8.2-1
name: artifactory
objects:
- kind: ImageStream
apiVersion: v1
metadata:
name: artifactory
spec:
tags:
- name: "${ARTIFACTORY_VERSION}"
from:
kind: DockerImage
name: "${ARTIFACTORY_IMAGE_REPOSITORY}:${ARTIFACTORY_VERSION}"
importPolicy: {}
- name: latest
from:
kind: ImageStreamTag
name: "${ARTIFACTORY_VERSION}"
- kind: PersistentVolumeClaim
apiVersion: v1
metadata:
name: artifactory-postgresql
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: '${POSTGRESQL_VOLUME_CAPACITY}'
storageClassName: ${STORAGE_CLASS_NAME}
- kind: Route
apiVersion: v1
metadata:
name: artifactory
spec:
to:
kind: Service
name: artifactory
host: ${ROUTE_DOMAIN}
- kind: Service
apiVersion: v1
metadata:
name: artifactory
annotations:
app: artifactory
service.openshift.io/infrastructure: 'true'
service.alpha.openshift.io/dependencies: '[{"name":"${DATABASE_SERVICE_NAME}","namespace":"","kind":"Service"}]'
service.alpha.openshift.io/serving-cert-secret-name: artifactory
spec:
ports:
- name: artifactory
port: 8081
protocol: TCP
targetPort: 8081
selector:
app: artifactory
sessionAffinity: None
type: ClusterIP
- kind: Service
apiVersion: v1
metadata:
name: artifactory-postgresql
annotations:
description: Exposes the database server
spec:
ports:
- name: postgresql
port: 5432
targetPort: 5432
selector:
name: artifactory-postgresql
- kind: StatefulSet
apiVersion: apps/v1
metadata:
name: artifactory
labels:
app: artifactory
spec:
serviceName: artifactory
replicas: 1
triggers:
- type: ConfigChange
- type: ImageChange
imageChangeParams:
automatic: true
containerNames:
- artifactory
from:
kind: ImageStreamTag
name: "artifactory:${ARTIFACTORY_VERSION}"
lastTriggeredImage: ''
test: false
strategy:
recreateParams:
timeoutSeconds: 600
resources: {}
type: Recreate
selector:
matchLabels:
app: artifactory
template:
metadata:
labels:
deploymentconfig: artifactory
app: artifactory
spec:
serviceAccountName: artifactory
serviceAccount: artifactory
containers:
- name: artifactory
image: "${ARTIFACTORY_IMAGE_REPOSITORY}:${ARTIFACTORY_VERSION}"
imagePullPolicy: Always
env:
- name: DB_USER
value: '${DATABASE_USER}'
- name: DB_PASSWORD
value: '${DATABASE_PASSWORD}'
- name: DB_HOST
value: '${DATABASE_SERVICE_NAME}'
- name: DB_TYPE
value: postgresql
livenessProbe:
failureThreshold: 3
initialDelaySeconds: 130
periodSeconds: 10
successThreshold: 1
timeoutSeconds: 5
httpGet:
path: /
port: 8081
ports:
- containerPort: 8081
protocol: TCP
resources:
limits:
cpu: '2'
memory: 8192Mi
requests:
cpu: '1'
memory: 4096Mi
securityContext:
capabilities: {}
privileged: false
terminationMessagePath: /dev/termination-log
volumeMounts:
- mountPath: /var/opt/jfrog/artifactory
name: artifactory-data
- name: generated-certificate-volume
mountPath: /etc/opt/jfrog/certs/
readOnly: true
dnsPolicy: ClusterFirst
restartPolicy: Always
securityContext: {}
terminationGracePeriodSeconds: 30
volumes:
- name: artifactory-etc
configMap:
name: artifactory-default-config
items:
- key: default
path: default
- key: artifactory.system.properties
path: artifactory.system.properties
- key: artifactory.config.xml
path: artifactory.config.xml
- key: artifactory.lic
path: artifactory.lic
- name: artifactory-data
persistentVolumeClaim:
claimName: artifactory-data
- name: artifactory-logs
persistentVolumeClaim:
claimName: artifactory-logs
- name: artifactory-backup
persistentVolumeClaim:
claimName: artifactory-backup
- name: artifactory-var
persistentVolumeClaim:
claimName: artifactory-var
- name: generated-certificate-volume
secret:
secretName: artifactory
volumeClaimTemplates:
- metadata:
name: artifactory-data
annotations:
app: artifactory
spec:
accessModes:
- "ReadWriteOnce"
resources:
requests:
storage: ${ARTIFACTORY_DATA_VOLUME_CAPACITY}
storageClassName: ${STORAGE_CLASS_NAME}
- metadata:
name: artifactory-logs
annotations:
app: artifactory
spec:
accessModes:
- "ReadWriteOnce"
resources:
requests:
storage: 1Gi
storageClassName: ${STORAGE_CLASS_NAME}
- metadata:
name: artifactory-backup
annotations:
app: artifactory
spec:
accessModes:
- "ReadWriteOnce"
resources:
requests:
storage: 1Gi
storageClassName: ${STORAGE_CLASS_NAME}
- metadata:
name: artifactory-var
annotations:
app: artifactory
spec:
accessModes:
- "ReadWriteOnce"
resources:
requests:
storage: 1Gi
storageClassName: ${STORAGE_CLASS_NAME}
- kind: DeploymentConfig
apiVersion: v1
metadata:
name: '${DATABASE_SERVICE_NAME}'
annotations:
description: Defines how to deploy the database
spec:
strategy:
type: Recreate
triggers:
- type: ImageChange
imageChangeParams:
automatic: true
containerNames:
- artifactory-postgresql
from:
kind: ImageStreamTag
namespace: openshift
name: 'postgresql:9.5'
- type: ConfigChange
replicas: 1
selector:
name: '${DATABASE_SERVICE_NAME}'
template:
metadata:
name: '${DATABASE_SERVICE_NAME}'
labels:
name: '${DATABASE_SERVICE_NAME}'
spec:
volumes:
- name: data
emptyDir: {}
containers:
- name: '${DATABASE_SERVICE_NAME}'
image: ' '
ports:
- containerPort: 5432
restartPolicy: Always
dnsPolicy: ClusterFirst
imagePullPolicy: IfNotPresent
capabilities: {}
securityContext:
capabilities: {}
privileged: false
readinessProbe:
timeoutSeconds: 1
initialDelaySeconds: 5
exec:
command:
- '/bin/sh'
- '-i'
- '-c'
- 'psql -h 127.0.0.1 -U ${POSTGRESQL_USER} -q -d ${POSTGRESQL_DATABASE} -c "SELECT 1"'
livenessProbe:
timeoutSeconds: 1
initialDelaySeconds: 30
tcpSocket:
port: 5432
volumeMounts:
- name: artifactory-postgresql-data
mountPath: /var/lib/pgsql/data
terminationMessagePath: /dev/termination-log
env:
- name: POSTGRESQL_USER
value: '${DATABASE_USER}'
- name: POSTGRESQL_PASSWORD
value: '${DATABASE_PASSWORD}'
- name: POSTGRESQL_DATABASE
value: '${DATABASE_NAME}'
- name: POSTGRESQL_MAX_CONNECTIONS
value: '${POSTGRESQL_MAX_CONNECTIONS}'
- name: POSTGRESQL_SHARED_BUFFERS
value: '${POSTGRESQL_SHARED_BUFFERS}'
resources:
limits:
memory: '${MEMORY_POSTGRESQL_LIMIT}'
volumes:
- name: artifactory-postgresql-data
persistentVolumeClaim:
claimName: artifactory-postgresql
parameters:
- name: MEMORY_POSTGRESQL_LIMIT
displayName: Memory Limit (PostgreSQL)
required: true
description: Maximum amount of memory the PostgreSQL container can use.
value: 512Mi
- name: DATABASE_SERVICE_NAME
displayName: Database Service Name
value: artifactory-postgresql
- name: DATABASE_USER
displayName: Database Username
generate: expression
from: 'user[A-Z0-9]{3}'
value: artifactory
- name: DATABASE_PASSWORD
displayName: Database Password
generate: expression
from: '[a-zA-Z0-9]{8}'
value: artifactory
- name: DATABASE_NAME
required: true
displayName: Database Name
value: artifactory
- name: POSTGRESQL_MAX_CONNECTIONS
displayName: Maximum Database Connections
value: '100'
- name: POSTGRESQL_SHARED_BUFFERS
displayName: Shared Buffer Amount
value: 12MB
- name: POSTGRESQL_VOLUME_CAPACITY
displayName: Volume Capacity
description: 'Volume space available for data, e.g. 512Mi, 2Gi.'
value: 4Gi
required: true
- name: ARTIFACTORY_DATA_VOLUME_CAPACITY
displayName: Artifactory Data Volume Capacity
description: 'Volume space available for data, e.g. 512Mi, 2Gi.'
value: 300Gi
required: true
- name: ARTIFACTORY_VERSION
displayName: Artifactory Version
description: 'Version of the Artifactory container image to be used'
value: "6.8.2"
required: true
- name: ARTIFACTORY_IMAGE_REPOSITORY
displayName: Artifactory Image Repository
description: 'Artifactory container image repository to be used'
value: "registry.mgt.devsecops.gov:5000/jfrog/artifactory-pro"
required: true
- description: The storageClassName to use when creating PersistentVolumeClaims
displayName: Storage Class Name
name: STORAGE_CLASS_NAME
value: glusterfs-storage
- description: The domain name to use when creating the route (users will browse to this to access artifactory)
displayName: Storage Class Name
name: ROUTE_DOMAIN
value: artifactory.apps.mgt.devsecops.gov