Skip to content

Commit f7dfc32

Browse files
authored
remove postgresql database and add persistence (#166)
1 parent b07b415 commit f7dfc32

File tree

7 files changed

+53
-130
lines changed

7 files changed

+53
-130
lines changed

charts/cloudbeaver-chart/Chart.yaml

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ type: application
2222
# This is the chart version. This version number should be incremented each time you make changes
2323
# to the chart and its templates, including the app version.
2424
# Versions are expected to follow Semantic Versioning (https://semver.org/)
25-
version: 2.0.10
25+
version: 2.0.11
2626

2727
# This is the version number of the application being deployed. This version number should be
2828
# incremented each time you make changes to the application. Versions are not expected to
@@ -31,9 +31,5 @@ appVersion: latest
3131

3232
dependencies:
3333
- name: library-chart
34-
version: 1.7.5
34+
version: 1.7.11
3535
repository: https://inseefrlab.github.io/helm-charts-interactive-services
36-
- name: postgresql
37-
version: 16.7.13
38-
repository: https://charts.bitnami.com/bitnami
39-
enabled: true

charts/cloudbeaver-chart/templates/NOTES.txt

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,3 @@
66
{{- end }}
77
- Your username is **{{ .Values.security.username }}**
88
- Your password is **{{ .Values.security.password }}**
9-
10-
*NOTES about deletion :*
11-
12-
- **You can safely delete this chart and recreate one later**
13-
- Data volumes in the associated postgresql will not be deleted
14-
- If you start a new {{ .Chart.Name }}, it will reuse this volume silently.
15-
- If you want to delete this volume definitely : `kubectl delete pvc data-{{ .Values.postgresql.fullnameOverride }}-0`

charts/cloudbeaver-chart/templates/configmap-cb.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,10 @@ data:
2929
develMode: false,
3030
3131
database: {
32-
driver: "postgres-jdbc" ,
33-
url : "jdbc:postgresql://{{ .Values.postgresql.fullnameOverride }}:5432/{{ .Values.postgresql.auth.database }}" ,
34-
user : {{ .Values.postgresql.auth.username }} ,
35-
password : {{ .Values.postgresql.auth.password }} ,
32+
driver: "h2_embedded_v2",
33+
url: "jdbc:h2:${workspace}/.data/cb.h2v2.dat}",
34+
user : {{ .Values.security.username }} ,
35+
password : {{ .Values.security.password }} ,
3636
initialDataConfiguration: "conf/initial-data.conf",
3737
pool: {
3838
minIdleConnections: 4,

charts/cloudbeaver-chart/templates/deployment.yaml

Lines changed: 9 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,10 @@ spec:
3636
image: "{{ .Values.service.image.version }}"
3737
imagePullPolicy: {{ .Values.service.image.pullPolicy }}
3838
volumeMounts:
39+
{{- if .Values.persistence.enabled }}
40+
- name: cloudbeaver-data
41+
mountPath: /opt/cloudbeaver/workspace
42+
{{- end }}
3943
- name: cb-config
4044
mountPath: /opt/cloudbeaver/conf/cloudbeaver.conf
4145
subPath: cloudbeaver.conf
@@ -47,7 +51,6 @@ spec:
4751
mountPath: /opt/cloudbeaver/conf/initial-data-sources.conf
4852
subPath: initial-data-sources.conf
4953
{{- end }}
50-
5154
env:
5255
- name: CB_ADMIN_NAME
5356
value: "{{ .Values.security.username }}"
@@ -57,7 +60,6 @@ spec:
5760
value: "{{ .Values.cloudbeaver.serverName }}"
5861
- name: CB_SERVER_URL
5962
value: "https://{{ .Values.ingress.hostname }}"
60-
6163
ports:
6264
- name: http
6365
containerPort: {{ .Values.networking.beaver.port}}
@@ -72,8 +74,12 @@ spec:
7274
port: http
7375
resources:
7476
{{- toYaml .Values.resources | nindent 12 }}
75-
7677
volumes:
78+
{{- if .Values.persistence.enabled }}
79+
- name: cloudbeaver-data
80+
persistentVolumeClaim:
81+
claimName: {{ include "library-chart.fullname" . }}
82+
{{- end }}
7783
- name: cb-config
7884
configMap:
7985
name: {{ include "library-chart.fullname" . }}-cb-config
@@ -85,23 +91,6 @@ spec:
8591
secret:
8692
secretName: {{ include "library-chart.fullname" . }}
8793
{{- end }}
88-
89-
initContainers:
90-
- name: wait-for-postgresql
91-
image: "alpine"
92-
imagePullPolicy: IfNotPresent
93-
command:
94-
- sh
95-
- -c
96-
- |
97-
until printf "." && nc -z -w 2 {{ .Values.postgresql.fullnameOverride }} 5432; do
98-
sleep 2;
99-
done;
100-
echo 'PostgreSQL OK ✓'
101-
resources:
102-
requests:
103-
cpu: "0.05"
104-
memory: "128Mi"
10594
{{- with .Values.nodeSelector }}
10695
nodeSelector:
10796
{{- toYaml . | nindent 8 }}
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{{- if .Values.persistence.enabled }}
2+
apiVersion: v1
3+
kind: PersistentVolumeClaim
4+
metadata:
5+
name: {{ include "library-chart.fullname" . }}
6+
spec:
7+
accessModes:
8+
- ReadWriteOnce
9+
resources:
10+
requests:
11+
storage: {{ .Values.persistence.size }}
12+
{{- end }}

charts/cloudbeaver-chart/values.schema.json

Lines changed: 22 additions & 72 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,28 @@
3838
}
3939
}
4040
},
41+
"persistence": {
42+
"title": "Persistence",
43+
"type": "object",
44+
"properties": {
45+
"enabled": {
46+
"title": "Create a persistent volume",
47+
"type": "boolean",
48+
"default": true
49+
},
50+
"size": {
51+
"title": "Persistent volume size",
52+
"type": "string",
53+
"default": "10Gi",
54+
"form": true,
55+
"render": "slider",
56+
"sliderMin": 1,
57+
"sliderMax": 100,
58+
"sliderStep": 1,
59+
"sliderUnit": "Gi"
60+
}
61+
}
62+
},
4163
"resources": {
4264
"description": "Your service will have at least the requested resources and never more than its limits. No limit for a resource and you can consume everything left on the host machine.",
4365
"type": "object",
@@ -172,78 +194,6 @@
172194
}
173195
}
174196
},
175-
"postgresql": {
176-
"description": "postgres specific configuration",
177-
"type": "object",
178-
"title": "Database",
179-
"properties": {
180-
"image": {
181-
"description": "image specific configuration",
182-
"type": "object",
183-
"properties": {
184-
"tag": {
185-
"description": "postgresql major version",
186-
"type": "string",
187-
"enum": [
188-
"12",
189-
"13",
190-
"14",
191-
"15",
192-
"16",
193-
"17"
194-
],
195-
"default": "17"
196-
}
197-
}
198-
},
199-
"auth": {
200-
"description": "postgres specific configuration",
201-
"type": "object",
202-
"title": "Authentification",
203-
"properties": {
204-
"username": {
205-
"type": "string",
206-
"title": "User",
207-
"default": "user",
208-
"x-form": {
209-
"value": "{{project.id}}"
210-
},
211-
"x-onyxia": {
212-
"overwriteDefaultWith": "{{project.id}}"
213-
}
214-
},
215-
"password": {
216-
"type": "string",
217-
"title": "User Password",
218-
"default": "changeme",
219-
"x-form": {
220-
"value": "{{project.password}}"
221-
},
222-
"x-onyxia": {
223-
"overwriteDefaultWith": "{{project.password}}"
224-
}
225-
},
226-
"postgresPassword": {
227-
"type": "string",
228-
"title": "Admin Password",
229-
"default": "changeme",
230-
"x-form": {
231-
"value": "{{project.password}}"
232-
},
233-
"x-onyxia": {
234-
"overwriteDefaultWith": "{{project.password}}"
235-
}
236-
},
237-
"database": {
238-
"description": "Name for the default database that is created when the image is first started.",
239-
"type": "string",
240-
"title": "Database",
241-
"default": "cloudbeaver"
242-
}
243-
}
244-
}
245-
}
246-
},
247197
"discovery": {
248198
"description": "configure your service to autodetect some ressources.",
249199
"type": "object",

charts/cloudbeaver-chart/values.yaml

Lines changed: 4 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -10,27 +10,6 @@ discovery:
1010
mariadb: true
1111
trino: true
1212

13-
postgresql:
14-
image:
15-
tag: "17"
16-
auth:
17-
username: "admin"
18-
password: "changeme"
19-
postgresPassword: "changeme"
20-
database: "cloudbeaver"
21-
fullnameOverride: "cloudbeaver-db"
22-
primary:
23-
resources:
24-
limits:
25-
cpu: "1000m"
26-
memory: "2000Mi"
27-
requests:
28-
memory: 256Mi
29-
cpu: 250m
30-
persistence:
31-
enabled: true
32-
size: 8Gi
33-
3413
cloudbeaver:
3514
serverName: "Cloudbeaver Server"
3615

@@ -117,6 +96,10 @@ resources: {}
11796
# cpu: 100m
11897
# memory: 128Mi
11998

99+
persistence:
100+
enabled: true
101+
size: 10Gi
102+
120103
autoscaling:
121104
enabled: false
122105
minReplicas: 1

0 commit comments

Comments
 (0)