Skip to content

Commit 43a9b33

Browse files
committed
add PVC for database and local extensions storage
Signed-off-by: Valeriy Svydenko <vsvydenk@redhat.com>
1 parent d35f0a4 commit 43a9b33

File tree

2 files changed

+45
-5
lines changed

2 files changed

+45
-5
lines changed

openshift/openvsx-deployment.yml

+44-4
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,16 @@ objects:
99
name: "${NAMESPACE}"
1010
labels:
1111
name: openvsx
12+
- apiVersion: v1
13+
kind: PersistentVolumeClaim
14+
metadata:
15+
name: postgres-pvc
16+
spec:
17+
accessModes:
18+
- ReadWriteOnce
19+
resources:
20+
requests:
21+
storage: ${STORAGE_CAPACITY}
1222
- apiVersion: apps/v1
1323
kind: Deployment
1424
metadata:
@@ -32,17 +42,24 @@ objects:
3242
app.kubernetes.io/instance: openvsx
3343
app.kubernetes.io/component: postgresql
3444
spec:
45+
volumes:
46+
- name: postgres-storage
47+
persistentVolumeClaim:
48+
claimName: postgres-pvc
3549
containers:
3650
- name: postgresql
3751
image: ${POSTGERSQL_IMAGE}
38-
imagePullPolicy: Never
52+
imagePullPolicy: IfNotPresent
3953
env:
4054
- name: POSTGRESQL_DATABASE
4155
value: openvsx
4256
- name: POSTGRESQL_USER
4357
value: openvsx
4458
- name: POSTGRESQL_PASSWORD
4559
value: openvsx
60+
volumeMounts:
61+
- name: postgres-storage
62+
mountPath: /var/lib/pgsql/data
4663
ports:
4764
- containerPort: 5432
4865
protocol: TCP
@@ -120,7 +137,7 @@ objects:
120137
protocol: TCP
121138
- containerPort: 9200
122139
protocol: TCP
123-
imagePullPolicy: Never
140+
imagePullPolicy: IfNotPresent
124141
env:
125142
- name: bootstrap.memory_lock
126143
value: 'true'
@@ -171,6 +188,16 @@ objects:
171188
protocol: TCP
172189
selector:
173190
deployment: elasticsearch
191+
- apiVersion: v1
192+
kind: PersistentVolumeClaim
193+
metadata:
194+
name: extensions-pvc
195+
spec:
196+
accessModes:
197+
- ReadWriteOnce
198+
resources:
199+
requests:
200+
storage: ${EXTENSIONS_STORAGE_CAPACITY}
174201
- apiVersion: apps/v1
175202
kind: Deployment
176203
metadata:
@@ -193,7 +220,7 @@ objects:
193220
containers:
194221
- name: openvsx-server
195222
image: ${OPENVSX_SERVER_IMAGE}
196-
imagePullPolicy: Never
223+
imagePullPolicy: IfNotPresent
197224
readinessProbe:
198225
httpGet:
199226
path: /api/version
@@ -229,6 +256,13 @@ objects:
229256
secretKeyRef:
230257
name: github-oauth
231258
key: client-secret
259+
volumeMounts:
260+
- name: extensions-storage
261+
mountPath: /tmp/extensions
262+
volumes:
263+
- name: extensions-storage
264+
persistentVolumeClaim:
265+
claimName: extensions-pvc
232266
- apiVersion: v1
233267
kind: Service
234268
metadata:
@@ -302,7 +336,7 @@ objects:
302336
containers:
303337
- name: ovsx-cli
304338
image: ${OPENVSX_CLI_IMAGE}
305-
imagePullPolicy: Never
339+
imagePullPolicy: IfNotPresent
306340
env:
307341
- name: OVSX_REGISTRY_URL
308342
value: http://openvsx-server:8080
@@ -354,3 +388,9 @@ parameters:
354388
value: "ZHVtbXlfdmFsdWU="
355389
displayName: GitHub Client Secret
356390
description: Base64 encoded GitHub Client Secret
391+
- name: STORAGE_CAPACITY
392+
description: "Persistent storage capacity for PostgreSQL"
393+
value: "1Gi"
394+
- name: EXTENSIONS_STORAGE_CAPACITY
395+
description: "Persistent storage capacity for local extensions storage"
396+
value: "5Gi"

openshift/openvsx.Dockerfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,6 @@ USER root
4242
RUN sed -i "s/OPENVSX_VERSION/${OPENVSX_VERSION}/g" config/application.yml
4343
USER openvsx
4444
# Local storage:
45-
RUN \
45+
RUN \
4646
mkdir -p /tmp/extensions && \
4747
chmod 777 /tmp/extensions

0 commit comments

Comments
 (0)