feat(common): Add CNPG Vectorchord extension (#40702)

**Description**
<!--
Please include a summary of the change and which issue is fixed. Please
also include relevant motivation and context. List any dependencies that
are required for this change.
-->
https://github.com/tensorchord/cloudnative-pgvecto.rs
Is depricated and VectorChord serves as the successor to
[pgvecto.rs](https://github.com/tensorchord/pgvecto.rs) with better
stability and performance.
https://github.com/tensorchord/cloudnative-vectorchord
Also needed when you want to use for example immich with this database
extension type.


⚒️ Fixes  # <!--(issue)-->

**⚙️ Type of change**

- [x] ⚙️ Feature/App addition
- [ ] 🪛 Bugfix
- [ ] ⚠️ Breaking change (fix or feature that would cause existing
functionality to not work as expected)
- [ ] 🔃 Refactor of current code
- [ ] 📜 Documentation Changes

**🧪 How Has This Been Tested?**
<!--
Please describe the tests that you ran to verify your changes. Provide
instructions so we can reproduce. Please also list any relevant details
for your test configuration
-->
Added the tests in the common.

**📃 Notes:**
<!-- Please enter any other relevant information here -->

**✔️ Checklist:**

- [ ] ⚖️ My code follows the style guidelines of this project
- [x] 👀 I have performed a self-review of my own code
- [ ] #️⃣ I have commented my code, particularly in hard-to-understand
areas
- [ ] 📄 I have made changes to the documentation
- [ ] 🧪 I have added tests to this description that prove my fix is
effective or that my feature works
- [ ] ⬆️ I increased versions for any altered app according to semantic
versioning
- [x] I made sure the title starts with `feat(chart-name):`,
`fix(chart-name):`, `chore(chart-name):`, `docs(chart-name):` or
`fix(docs):`

** App addition**

If this PR is an app addition please make sure you have done the
following.

- [ ] 🖼️ I have added an icon in the Chart's root directory called
`icon.png`

---

_Please don't blindly check all the boxes. Read them and only check
those that apply.
Those checkboxes are there for the reviewer to see what is this all
about and
the status of this PR with a quick glance._
This commit is contained in:
Boemeltrein
2025-10-18 00:05:13 +02:00
committed by GitHub
parent 8235616b1b
commit e818f936ef
6 changed files with 70 additions and 2 deletions
@@ -572,6 +572,55 @@ tests:
- CREATE EXTENSION IF NOT EXISTS vectors;
- CREATE EXTENSION IF NOT EXISTS some-extension;
- it: should pass with vectorchord
set:
postgresVectorchord16Image:
repository: docker.io/vectorchord/vectorchord
tag: "some-tag"
cnpg:
my-pg:
enabled: true
user: app
database: app
password: test-password
type: vectorchord
cluster:
initdb:
postInitApplicationSQL:
- CREATE EXTENSION IF NOT EXISTS some-extension;
postgresql:
key1: value1
key2: '{{ printf "test-tpl" }}'
preloadLibraries:
- pg_stat_statements
- pg_cron
asserts:
- documentIndex: *clusterDoc
isKind:
of: Cluster
- documentIndex: *clusterDoc
isSubset:
path: spec
content:
postgresql:
parameters:
key1: value1
key2: test-tpl
shared_preload_libraries:
- pg_stat_statements
- pg_cron
- vchord.so
bootstrap:
initdb:
secret:
name: test-release-name-common-test-cnpg-my-pg-user
database: app
owner: app
dataChecksums: true
postInitApplicationSQL:
- CREATE EXTENSION IF NOT EXISTS vchord CASCADE;
- CREATE EXTENSION IF NOT EXISTS some-extension;
- it: should pass with enabled monitoring
set:
postgresTimescaledb16Image:
@@ -88,7 +88,7 @@ tests:
type: invalid
asserts:
- failedTemplate:
errorMessage: CNPG Cluster - Expected [type] to be one of [postgres, postgis, timescaledb, vectors], but got [invalid]
errorMessage: CNPG Cluster - Expected [type] to be one of [postgres, postgis, timescaledb, vectors, vectorchord], but got [invalid]
- it: should fail with invalid log level
set:
@@ -123,6 +123,9 @@
{{- if eq $objectData.type "vectors" -}}
{{- $preloadLibraries = mustAppend $preloadLibraries "vectors.so" -}}
{{- end -}}
{{- if eq $objectData.type "vectorchord" -}}
{{- $preloadLibraries = mustAppend $preloadLibraries "vchord.so" -}}
{{- end -}}
{{/* Storage */}}
{{- with $objectData.cluster.storage.size -}}
@@ -33,6 +33,11 @@
"CREATE EXTENSION IF NOT EXISTS vectors;") -}}
{{- end -}}
{{- if eq $objectData.type "vectorchord" -}}
{{- $postInitApplicationSQL = concat $postInitApplicationSQL (list
"CREATE EXTENSION IF NOT EXISTS vchord CASCADE;") -}}
{{- end -}}
{{- if $objectData.cluster.initdb -}}
{{- $postInitApplicationSQL = concat $postInitApplicationSQL ( $objectData.cluster.initdb.postInitApplicationSQL | default list ) -}}
{{- $postInitSQL = concat $postInitSQL ( $objectData.cluster.initdb.postInitSQL | default list ) -}}
@@ -39,7 +39,7 @@
{{- end -}}
{{- if (hasKey $objectData "type") -}}
{{- $validTypes := (list "postgres" "postgis" "timescaledb" "vectors") -}}
{{- $validTypes := (list "postgres" "postgis" "timescaledb" "vectors" "vectorchord") -}}
{{- if not (mustHas $objectData.type $validTypes) -}}
{{- fail (printf "CNPG Cluster - Expected [type] to be one of [%s], but got [%s]" (join ", " $validTypes) $objectData.type) -}}
{{- end -}}
+11
View File
@@ -662,6 +662,16 @@ postgresVectors16Image:
tag: "16.3-v0.2.1"
pullPolicy: IfNotPresent
postgresVectorchord15Image:
repository: ghcr.io/tensorchord/cloudnative-vectorchord
tag: "15.14-0.5.3"
pullPolicy: IfNotPresent
postgresVectorchord16Image:
repository: ghcr.io/tensorchord/cloudnative-vectorchord
tag: "16.10-0.5.3"
pullPolicy: IfNotPresent
# -- OpenVPN specific configuration
# @default -- See below
openvpnImage:
@@ -1139,6 +1149,7 @@ cnpg:
# * `postgis`
# * `timescaledb`
# * `vectors`
# * `vectorchord`
type: postgres
# Version of Postgresql to use, changes cluster naming scheme