Skip to content

Commit d80b865

Browse files
authored
[postgresql] Bump to v17 and add pgvector image (#160)
* [postgresql] Bump to v17 and add pgvector image * Moved and renamed Dockerfiles * [Postgresql] Fixed configuration form and added security allowInsecureImages option * [postgresql] creating pgvector extension if selected image contains 'vector' * [postgresql] Added older versions pgvector Dockerfiles
1 parent 9f41599 commit d80b865

File tree

9 files changed

+110
-67
lines changed

9 files changed

+110
-67
lines changed

charts/postgresql/Chart.yaml

Lines changed: 4 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -8,30 +8,13 @@ keywords:
88
home: https://www.postgresql.org/
99
sources:
1010
- https://github.com/InseeFrLab/helm-charts-databases/tree/master/charts/postgresql
11-
12-
# A chart can be either an 'application' or a 'library' chart.
13-
#
14-
# Application charts are a collection of templates that can be packaged into versioned archives
15-
# to be deployed.
16-
#
17-
# Library charts provide useful utilities or functions for the chart developer. They're included as
18-
# a dependency of application charts to inject those utilities and functions into the rendering
19-
# pipeline. Library charts do not define any templates and therefore cannot be deployed.
2011
type: application
21-
22-
# This is the chart version. This version number should be incremented each time you make changes
23-
# to the chart and its templates, including the app version.
24-
# Versions are expected to follow Semantic Versioning (https://semver.org/)
25-
26-
version: 1.0.8
27-
28-
# This is the version number of the application being deployed. This version number should be
29-
# incremented each time you make changes to the application. Versions are not expected to
30-
# follow Semantic Versioning. They should reflect the version the application is using.
12+
version: 1.0.9
13+
appVersion: 17.5.0
3114
dependencies:
3215
- name: postgresql
33-
version: 16.2.5
16+
version: 16.7.11
3417
repository: https://charts.bitnami.com/bitnami
3518
- name: library-chart
36-
version: 1.5.33
19+
version: 1.7.3
3720
repository: https://inseefrlab.github.io/helm-charts-interactive-services
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
FROM pgvector/pgvector:pg13 AS builder
2+
3+
FROM bitnami/postgresql:13
4+
5+
COPY --from=builder /usr/lib/postgresql/13/lib/vector.so /opt/bitnami/postgresql/lib/
6+
COPY --from=builder /usr/share/postgresql/13/extension/vector* /opt/bitnami/postgresql/share/extension/
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
FROM pgvector/pgvector:pg14 AS builder
2+
3+
FROM bitnami/postgresql:14
4+
5+
COPY --from=builder /usr/lib/postgresql/14/lib/vector.so /opt/bitnami/postgresql/lib/
6+
COPY --from=builder /usr/share/postgresql/14/extension/vector* /opt/bitnami/postgresql/share/extension/
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
FROM pgvector/pgvector:pg15 AS builder
2+
3+
FROM bitnami/postgresql:15
4+
5+
COPY --from=builder /usr/lib/postgresql/15/lib/vector.so /opt/bitnami/postgresql/lib/
6+
COPY --from=builder /usr/share/postgresql/15/extension/vector* /opt/bitnami/postgresql/share/extension/
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
FROM pgvector/pgvector:pg16 AS builder
2+
3+
FROM bitnami/postgresql:16
4+
5+
COPY --from=builder /usr/lib/postgresql/16/lib/vector.so /opt/bitnami/postgresql/lib/
6+
COPY --from=builder /usr/share/postgresql/16/extension/vector* /opt/bitnami/postgresql/share/extension/
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
FROM pgvector/pgvector:pg17 AS builder
2+
3+
FROM bitnami/postgresql:17
4+
5+
COPY --from=builder /usr/lib/postgresql/17/lib/vector.so /opt/bitnami/postgresql/lib/
6+
COPY --from=builder /usr/share/postgresql/17/extension/vector* /opt/bitnami/postgresql/share/extension/
Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
11
apiVersion: v1
22
kind: ConfigMap
33
metadata:
4-
name: {{ include "library-chart.fullname" . }}
4+
name: {{ include "library-chart.fullname" .Subcharts.postgresql }}
55
labels:
66
{{- include "library-chart.labels" . | nindent 4 }}
77
data:
8-
{{- if .Values.postgresql.extensions.postgis }}
98
enable-extensions.sh: |
109
#!/bin/sh
1110
export PGPASSWORD=$POSTGRES_PASSWORD
11+
{{- if .Values.postgresql.extensions.postgis }}
1212
psql -U postgres -d $POSTGRES_DATABASE -c "CREATE EXTENSION postgis;"
1313
psql -U postgres -d $POSTGRES_DATABASE -c "CREATE EXTENSION postgis_topology;"
14-
{{ else }}
15-
enable-extensions.sh: |
16-
#!/bin/sh
17-
echo "No additional extensions created."
1814
{{- end -}}
15+
{{- if contains "vector" .Values.postgresql.image.repository }}
16+
psql -U postgres -d $POSTGRES_DATABASE -c "CREATE EXTENSION vector;"
17+
{{- end -}}
18+
echo "All extensions created."

charts/postgresql/values.schema.json

Lines changed: 65 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -2,48 +2,74 @@
22
"$schema": "http://json-schema.org/draft-07/schema",
33
"type": "object",
44
"properties": {
5+
"global": {
6+
"title": "Global configuration",
7+
"type": "object",
8+
"properties": {
9+
"security": {
10+
"title": "Security",
11+
"type": "object",
12+
"properties": {
13+
"allowInsecureImages": {
14+
"title": "Allow custom insecure images",
15+
"description": "Must be ticked to change the PostgreSQL image",
16+
"type": "boolean",
17+
"default": true
18+
}
19+
}
20+
}
21+
}
22+
},
523
"postgresql": {
6-
"description": "postgres specific configuration",
24+
"title": "PostgreSQL",
725
"type": "object",
826
"properties": {
927
"image": {
10-
"description": "image specific configuration",
28+
"title": "Image",
1129
"type": "object",
1230
"properties": {
31+
"repository": {
32+
"title": "Image name",
33+
"type": "string",
34+
"enum": [
35+
"bitnami/postgresql",
36+
"inseefrlab/onyxia-postgresql-pgvector"
37+
],
38+
"default": "bitnami/postgresql"
39+
},
1340
"tag": {
14-
"description": "postgresql major version",
41+
"title": "Version",
1542
"type": "string",
1643
"enum": [
17-
"10",
18-
"11",
19-
"12",
20-
"13",
21-
"14",
44+
"17",
45+
"16",
2246
"15",
23-
"16"
47+
"14",
48+
"13",
49+
"12",
50+
"11",
51+
"10"
2452
],
25-
"default": "16"
53+
"default": "17"
2654
}
2755
}
2856
},
2957
"primary": {
30-
"description": "primary configuration",
31-
"type": "object",
3258
"title": "Resources",
59+
"type": "object",
3360
"properties": {
3461
"persistence": {
35-
"description": "Configuration for persistence",
62+
"title": "Persistence",
3663
"type": "object",
3764
"properties": {
3865
"enabled": {
66+
"title": "Create a persistent volume",
3967
"type": "boolean",
40-
"description": "Create a persistent volume",
4168
"default": true
4269
},
4370
"size": {
44-
"type": "string",
4571
"title": "Persistent volume size",
46-
"description": "Size of the persistent volume",
72+
"type": "string",
4773
"default": "10Gi",
4874
"form": true,
4975
"render": "slider",
@@ -59,15 +85,16 @@
5985
}
6086
},
6187
"resources": {
62-
"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.",
88+
"title": "Resources (CPU/RAM)",
89+
"description": "Requested resources are reserved, even if unused, please be considerate of others. Limits are strict and may cause slowdowns or out-of-memory errors.",
6390
"type": "object",
6491
"properties": {
6592
"requests": {
6693
"description": "Guaranteed resources",
6794
"type": "object",
6895
"properties": {
6996
"cpu": {
70-
"description": "The amount of cpu guaranteed",
97+
"description": "Guaranteed CPU allocation",
7198
"title": "CPU",
7299
"type": "string",
73100
"default": "250m",
@@ -81,7 +108,7 @@
81108
"sliderRangeId": "cpu"
82109
},
83110
"memory": {
84-
"description": "The amount of memory guaranteed",
111+
"description": "Guaranteed memory allocation",
85112
"title": "memory",
86113
"type": "string",
87114
"default": "1Gi",
@@ -101,7 +128,7 @@
101128
"type": "object",
102129
"properties": {
103130
"cpu": {
104-
"description": "The maximum amount of cpu",
131+
"description": "Maximum CPU allocation",
105132
"title": "CPU",
106133
"type": "string",
107134
"default": "30000m",
@@ -115,7 +142,7 @@
115142
"sliderRangeId": "cpu"
116143
},
117144
"memory": {
118-
"description": "The maximum amount of memory",
145+
"description": "Maximum memory allocation",
119146
"title": "Memory",
120147
"type": "string",
121148
"default": "50Gi",
@@ -135,13 +162,12 @@
135162
}
136163
},
137164
"auth": {
138-
"description": "postgres authentification configuration",
165+
"title": "Database authentication",
139166
"type": "object",
140-
"title": "Database",
141167
"properties": {
142168
"postgresPassword": {
143-
"type": "string",
144169
"title": "Admin password",
170+
"type": "string",
145171
"default": "changeme",
146172
"render": "password",
147173
"x-form": {
@@ -152,8 +178,8 @@
152178
}
153179
},
154180
"username": {
181+
"title": "User name",
155182
"type": "string",
156-
"title": "User",
157183
"default": "admin",
158184
"x-form": {
159185
"value": "{{project.id}}"
@@ -163,8 +189,8 @@
163189
}
164190
},
165191
"password": {
166-
"type": "string",
167192
"title": "User password",
193+
"type": "string",
168194
"default": "changeme",
169195
"render": "password",
170196
"x-form": {
@@ -175,48 +201,48 @@
175201
}
176202
},
177203
"database": {
178-
"description": "Name for the default database to create.",
204+
"title": "Name for the default database",
205+
"description": "(will be created)",
179206
"type": "string",
180-
"title": "Database",
181207
"default": "defaultdb"
182208
}
183209
}
184210
},
185211
"extensions": {
186-
"description": "Postgres extensions to enable",
212+
"title": "Postgres extensions",
187213
"type": "object",
188214
"properties": {
189215
"postgis": {
216+
"title": "Enable PostGIS",
190217
"type": "boolean",
191-
"title": "PostGIS",
192218
"default": false
193219
}
194220
}
195221
}
196222
}
197223
},
198224
"security": {
199-
"description": "Security specific configuration",
225+
"title": "Security",
200226
"type": "object",
201227
"properties": {
202228
"networkPolicy": {
229+
"title": "Access to the service",
203230
"type": "object",
204-
"description": "Define access policy to the service",
205231
"x-onyxia": {
206232
"overwriteSchemaWith": "network-policy.json"
207233
},
208234
"properties": {
209235
"enabled": {
210-
"type": "boolean",
211236
"title": "Enable network policy",
212237
"description": "Only pod from the same namespace will be allowed",
238+
"type": "boolean",
213239
"default": false,
214240
"x-onyxia": {
215241
"overwriteDefaultWith": "region.defaultNetworkPolicy"
216242
}
217243
},
218244
"from": {
219-
"description": "Array of sources allowed to have network access to your service",
245+
"title": "Sources allowed to access to your service",
220246
"type": "array",
221247
"items": {
222248
"type": "object",
@@ -233,24 +259,24 @@
233259
}
234260
},
235261
"discovery": {
236-
"description": "Database discovery",
262+
"title": "Database discovery",
237263
"type": "object",
238264
"properties": {
239265
"enabled": {
240-
"type": "boolean",
241-
"title": "Enable discovery of this database",
266+
"title": "Enabled discovery",
242267
"description": "Allows clients to automatically preconfigure a connection to this database",
268+
"type": "boolean",
243269
"default": true
244270
}
245271
}
246272
},
247273
"userPreferences": {
248-
"description": "User Preferences",
274+
"title": "User Preferences",
249275
"type": "object",
250276
"properties": {
251277
"language": {
278+
"title": "Preferred language",
252279
"type": "string",
253-
"description": "Preferred language",
254280
"default": "en",
255281
"x-onyxia": {
256282
"hidden": true,

charts/postgresql/values.yaml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
1+
global:
2+
security:
3+
allowInsecureImages: true
14
postgresql:
25
image:
3-
tag: "16"
6+
repository: "bitnami/postgresql"
7+
tag: "17"
48
pullPolicy: IfNotPresent
59
service:
610
ports:

0 commit comments

Comments
 (0)