mirror of
https://github.com/rubenhensen/k8scd.git
synced 2026-11-17 06:29:09 +01:00
Compare commits
4
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
e7696107c0 | ||
|
|
a8a186b4d3 | ||
|
|
8596e8a428 | ||
|
|
251f22c46f |
No files matched your search
@@ -139,8 +139,34 @@ snapshots after every step. Fresh Velero backup before starting.
|
|||||||
solver. The Ingresses were pruned with `PrunePropagationPolicy=orphan`
|
solver. The Ingresses were pruned with `PrunePropagationPolicy=orphan`
|
||||||
so the Certificates stayed. Gatus now expects a 302 from Longhorn
|
so the Certificates stayed. Gatus now expects a 302 from Longhorn
|
||||||
|
|
||||||
Out of scope here but due: the immich PostgreSQL 14 cluster reaches end of
|
## 9. immich: PostgreSQL 14 with pgvecto.rs → 17 with VectorChord
|
||||||
life on 2026-11-12.
|
|
||||||
|
PostgreSQL 14 reaches end of life on 2026-11-12, and immich 3.0 drops
|
||||||
|
pgvecto.rs. Done 2026-10-24, about an hour of immich downtime:
|
||||||
|
|
||||||
|
- [x] Safety net: Longhorn snapshot and NAS backup `immich-pg14-pre-vchord`
|
||||||
|
of the old volume, plus `pg_dump -Fc` (447 MB) in
|
||||||
|
`~/immich-pg14-pre-vchord.dump` on opti1
|
||||||
|
- [x] immich server to 0 replicas (through git)
|
||||||
|
- [x] On the old cluster, immich's manual migration in one transaction:
|
||||||
|
drop `clip_index` and `face_index`, `embedding` columns to `real[]`,
|
||||||
|
`DROP EXTENSION vectors`, `DROP SCHEMA vectors`, reset the database's
|
||||||
|
`search_path` (it included `vectors`)
|
||||||
|
- [x] New cluster `immich-postgres-17` (`immich/postgresql-cluster-17.yaml`):
|
||||||
|
`cloudnative-vectorchord:17.11-1.1.1` (pgvector 0.8.6, VectorChord
|
||||||
|
1.1.1), filled by a CNPG microservice import, then `vchord` created and
|
||||||
|
the columns back to `vector(512)`. An in-place `pg_upgrade` wasn't
|
||||||
|
possible: the pgvecto.rs image is Debian bullseye, the VectorChord ones
|
||||||
|
bookworm. Tables, indexes and row counts matched the old database
|
||||||
|
- [x] immich pointed at `immich-postgres-17-rw` and its own app secret.
|
||||||
|
v2.4.1 refused to start (it only accepts VectorChord <0.6); v2.5.0 and up
|
||||||
|
accept <2, so immich went to v2.7.5, the last 2.x. It rebuilt both
|
||||||
|
indexes as `vchordrq` in about 1.5 minutes
|
||||||
|
- [ ] After a few days without problems: delete the old cluster
|
||||||
|
(`immich/postgresql-cluster.yaml`), the snapshot/backup and the dump.
|
||||||
|
Rolling back means reverting the old volume to the snapshot, since its
|
||||||
|
embeddings are now `real[]` without pgvecto.rs
|
||||||
|
- [ ] immich 3.x, separately (pgvecto.rs no longer matters for it)
|
||||||
|
|
||||||
## k8s-dqlite write stalls (found 2026-10-22)
|
## k8s-dqlite write stalls (found 2026-10-22)
|
||||||
|
|
||||||
|
|||||||
@@ -24,18 +24,18 @@ spec:
|
|||||||
containers:
|
containers:
|
||||||
main:
|
main:
|
||||||
image:
|
image:
|
||||||
tag: v2.4.1
|
tag: v2.7.5
|
||||||
env:
|
env:
|
||||||
REDIS_HOSTNAME: '{{ printf "%s-valkey" .Release.Name }}'
|
REDIS_HOSTNAME: '{{ printf "%s-valkey" .Release.Name }}'
|
||||||
IMMICH_MACHINE_LEARNING_URL: '{{ printf "http://%s-machine-learning:3003" .Release.Name }}'
|
IMMICH_MACHINE_LEARNING_URL: '{{ printf "http://%s-machine-learning:3003" .Release.Name }}'
|
||||||
# External PostgreSQL (CloudNativePG)
|
# External PostgreSQL (CloudNativePG)
|
||||||
DB_HOSTNAME: "immich-postgres-rw"
|
DB_HOSTNAME: "immich-postgres-17-rw"
|
||||||
DB_USERNAME: "immich"
|
DB_USERNAME: "immich"
|
||||||
DB_DATABASE_NAME: "immich"
|
DB_DATABASE_NAME: "immich"
|
||||||
DB_PASSWORD:
|
DB_PASSWORD:
|
||||||
valueFrom:
|
valueFrom:
|
||||||
secretKeyRef:
|
secretKeyRef:
|
||||||
name: immich-postgres-app
|
name: immich-postgres-17-app
|
||||||
key: password
|
key: password
|
||||||
|
|
||||||
immich:
|
immich:
|
||||||
@@ -86,9 +86,6 @@ spec:
|
|||||||
enabled: true
|
enabled: true
|
||||||
controllers:
|
controllers:
|
||||||
main:
|
main:
|
||||||
# Stopped while the database moves to PostgreSQL 17 with
|
|
||||||
# VectorChord, see docs/upgrade-k8s-1.33.md
|
|
||||||
replicas: 0
|
|
||||||
containers:
|
containers:
|
||||||
main:
|
main:
|
||||||
image:
|
image:
|
||||||
|
|||||||
@@ -0,0 +1,50 @@
|
|||||||
|
apiVersion: postgresql.cnpg.io/v1
|
||||||
|
kind: Cluster
|
||||||
|
metadata:
|
||||||
|
name: immich-postgres-17
|
||||||
|
namespace: immich
|
||||||
|
spec:
|
||||||
|
instances: 1
|
||||||
|
|
||||||
|
# CNPG image with VectorChord and pgvector, which immich 2.x and 3.x use
|
||||||
|
# for its vector indexes (pgvecto.rs is gone in immich 3.0).
|
||||||
|
imageName: ghcr.io/tensorchord/cloudnative-vectorchord:17.11-1.1.1
|
||||||
|
|
||||||
|
postgresql:
|
||||||
|
shared_preload_libraries:
|
||||||
|
- "vchord.so"
|
||||||
|
|
||||||
|
# Filled once from the PostgreSQL 14 cluster (immich-postgres) after its
|
||||||
|
# embedding columns were turned into real[] and pgvecto.rs was dropped,
|
||||||
|
# see docs/upgrade-k8s-1.33.md.
|
||||||
|
bootstrap:
|
||||||
|
initdb:
|
||||||
|
database: immich
|
||||||
|
owner: immich
|
||||||
|
import:
|
||||||
|
type: microservice
|
||||||
|
databases:
|
||||||
|
- immich
|
||||||
|
source:
|
||||||
|
externalCluster: immich-postgres
|
||||||
|
postImportApplicationSQL:
|
||||||
|
- CREATE EXTENSION IF NOT EXISTS vchord CASCADE;
|
||||||
|
- ALTER TABLE public.smart_search ALTER COLUMN embedding SET DATA TYPE vector(512);
|
||||||
|
- ALTER TABLE public.face_search ALTER COLUMN embedding SET DATA TYPE vector(512);
|
||||||
|
# immich manages its own extensions and migrations
|
||||||
|
- ALTER USER immich WITH SUPERUSER;
|
||||||
|
|
||||||
|
externalClusters:
|
||||||
|
- name: immich-postgres
|
||||||
|
connectionParameters:
|
||||||
|
host: immich-postgres-rw
|
||||||
|
user: immich
|
||||||
|
dbname: immich
|
||||||
|
sslmode: require
|
||||||
|
password:
|
||||||
|
name: immich-postgres-app
|
||||||
|
key: password
|
||||||
|
|
||||||
|
storage:
|
||||||
|
size: 20Gi
|
||||||
|
storageClass: longhorn
|
||||||
Reference in new issue
Block a user