Skip to content

Commit

Permalink
add PVC for database and local extensions storage
Browse files Browse the repository at this point in the history
Signed-off-by: Valeriy Svydenko <[email protected]>
  • Loading branch information
svor committed Dec 9, 2024
1 parent d35f0a4 commit 43a9b33
Show file tree
Hide file tree
Showing 2 changed files with 45 additions and 5 deletions.
48 changes: 44 additions & 4 deletions openshift/openvsx-deployment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,16 @@ objects:
name: "${NAMESPACE}"
labels:
name: openvsx
- apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: postgres-pvc
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: ${STORAGE_CAPACITY}
- apiVersion: apps/v1
kind: Deployment
metadata:
Expand All @@ -32,17 +42,24 @@ objects:
app.kubernetes.io/instance: openvsx
app.kubernetes.io/component: postgresql
spec:
volumes:
- name: postgres-storage
persistentVolumeClaim:
claimName: postgres-pvc
containers:
- name: postgresql
image: ${POSTGERSQL_IMAGE}
imagePullPolicy: Never
imagePullPolicy: IfNotPresent
env:
- name: POSTGRESQL_DATABASE
value: openvsx
- name: POSTGRESQL_USER
value: openvsx
- name: POSTGRESQL_PASSWORD
value: openvsx
volumeMounts:
- name: postgres-storage
mountPath: /var/lib/pgsql/data
ports:
- containerPort: 5432
protocol: TCP
Expand Down Expand Up @@ -120,7 +137,7 @@ objects:
protocol: TCP
- containerPort: 9200
protocol: TCP
imagePullPolicy: Never
imagePullPolicy: IfNotPresent
env:
- name: bootstrap.memory_lock
value: 'true'
Expand Down Expand Up @@ -171,6 +188,16 @@ objects:
protocol: TCP
selector:
deployment: elasticsearch
- apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: extensions-pvc
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: ${EXTENSIONS_STORAGE_CAPACITY}
- apiVersion: apps/v1
kind: Deployment
metadata:
Expand All @@ -193,7 +220,7 @@ objects:
containers:
- name: openvsx-server
image: ${OPENVSX_SERVER_IMAGE}
imagePullPolicy: Never
imagePullPolicy: IfNotPresent
readinessProbe:
httpGet:
path: /api/version
Expand Down Expand Up @@ -229,6 +256,13 @@ objects:
secretKeyRef:
name: github-oauth
key: client-secret
volumeMounts:
- name: extensions-storage
mountPath: /tmp/extensions
volumes:
- name: extensions-storage
persistentVolumeClaim:
claimName: extensions-pvc
- apiVersion: v1
kind: Service
metadata:
Expand Down Expand Up @@ -302,7 +336,7 @@ objects:
containers:
- name: ovsx-cli
image: ${OPENVSX_CLI_IMAGE}
imagePullPolicy: Never
imagePullPolicy: IfNotPresent
env:
- name: OVSX_REGISTRY_URL
value: http://openvsx-server:8080
Expand Down Expand Up @@ -354,3 +388,9 @@ parameters:
value: "ZHVtbXlfdmFsdWU="
displayName: GitHub Client Secret
description: Base64 encoded GitHub Client Secret
- name: STORAGE_CAPACITY
description: "Persistent storage capacity for PostgreSQL"
value: "1Gi"
- name: EXTENSIONS_STORAGE_CAPACITY
description: "Persistent storage capacity for local extensions storage"
value: "5Gi"
2 changes: 1 addition & 1 deletion openshift/openvsx.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,6 @@ USER root
RUN sed -i "s/OPENVSX_VERSION/${OPENVSX_VERSION}/g" config/application.yml
USER openvsx
# Local storage:
RUN \
RUN \
mkdir -p /tmp/extensions && \
chmod 777 /tmp/extensions

0 comments on commit 43a9b33

Please sign in to comment.