Deploy immich db.
This commit is contained in:
parent
d8ecaf3c30
commit
ccb23dee0d
6 changed files with 155 additions and 0 deletions
17
kubernetes/apps/media/immich/app/kustomization.yaml
Normal file
17
kubernetes/apps/media/immich/app/kustomization.yaml
Normal file
|
@ -0,0 +1,17 @@
|
||||||
|
---
|
||||||
|
# yaml-language-server: $schema=https://json.schemastore.org/kustomization
|
||||||
|
apiVersion: kustomize.config.k8s.io/v1beta1
|
||||||
|
kind: Kustomization
|
||||||
|
resources:
|
||||||
|
# - ./externalsecret.yaml
|
||||||
|
- ./postgresCluster.yaml
|
||||||
|
# - ./pvc.yaml
|
||||||
|
# - ./helmrelease.yaml
|
||||||
|
configMapGenerator:
|
||||||
|
- name: immich-databse-init-sql
|
||||||
|
files:
|
||||||
|
- init.sql=./resources/init.sql
|
||||||
|
generatorOptions:
|
||||||
|
disableNameSuffixHash: true
|
||||||
|
annotations:
|
||||||
|
kustomize.toolkit.fluxcd.io/substitute: disabled
|
89
kubernetes/apps/media/immich/app/postgresCluster.yaml
Normal file
89
kubernetes/apps/media/immich/app/postgresCluster.yaml
Normal file
|
@ -0,0 +1,89 @@
|
||||||
|
---
|
||||||
|
# yaml-language-server: $schema=https://ks.hsn.dev/postgres-operator.crunchydata.com/postgrescluster_v1beta1.json
|
||||||
|
apiVersion: postgres-operator.crunchydata.com/v1beta1
|
||||||
|
kind: PostgresCluster
|
||||||
|
metadata:
|
||||||
|
name: &name "${APP}"
|
||||||
|
spec:
|
||||||
|
postgresVersion: 16
|
||||||
|
# dataSource:
|
||||||
|
# pgbackrest:
|
||||||
|
# stanza: db
|
||||||
|
# configuration:
|
||||||
|
# - secret:
|
||||||
|
# name: pgo-s3-creds
|
||||||
|
# global:
|
||||||
|
# repo1-path: "/${APP}/repo1"
|
||||||
|
# repo1-s3-uri-style: path
|
||||||
|
# repo:
|
||||||
|
# name: repo1
|
||||||
|
# s3:
|
||||||
|
# bucket: "crunchy-postgres"
|
||||||
|
# endpoint: "s3.hsn.dev"
|
||||||
|
# region: "us-east-1"
|
||||||
|
patroni:
|
||||||
|
dynamicConfiguration:
|
||||||
|
synchronous_mode: true
|
||||||
|
postgresql:
|
||||||
|
synchronous_commit: "on"
|
||||||
|
pg_hba:
|
||||||
|
- hostnossl all all 10.244.0.0/16 md5
|
||||||
|
- hostssl all all all md5
|
||||||
|
databaseInitSQL:
|
||||||
|
name: immich-databse-init-sql
|
||||||
|
key: init.sql
|
||||||
|
instances:
|
||||||
|
- name: postgres
|
||||||
|
metadata:
|
||||||
|
labels:
|
||||||
|
app.kubernetes.io/name: pgo-${APP}
|
||||||
|
replicas: 2
|
||||||
|
dataVolumeClaimSpec:
|
||||||
|
storageClassName: openebs-hostpath
|
||||||
|
accessModes:
|
||||||
|
- ReadWriteOnce
|
||||||
|
resources:
|
||||||
|
requests:
|
||||||
|
storage: 5Gi
|
||||||
|
topologySpreadConstraints:
|
||||||
|
- maxSkew: 1
|
||||||
|
topologyKey: "kubernetes.io/hostname"
|
||||||
|
whenUnsatisfiable: "DoNotSchedule"
|
||||||
|
labelSelector:
|
||||||
|
matchLabels:
|
||||||
|
postgres-operator.crunchydata.com/cluster: ${APP}
|
||||||
|
postgres-operator.crunchydata.com/data: postgres
|
||||||
|
users:
|
||||||
|
- name: "immich"
|
||||||
|
databases:
|
||||||
|
- "immich"
|
||||||
|
options: "SUPERUSER"
|
||||||
|
password:
|
||||||
|
type: AlphaNumeric
|
||||||
|
backups:
|
||||||
|
pgbackrest:
|
||||||
|
configuration:
|
||||||
|
- secret:
|
||||||
|
name: pgo-s3-creds
|
||||||
|
global:
|
||||||
|
archive-push-queue-max: 4GiB
|
||||||
|
repo1-retention-full: "14"
|
||||||
|
repo1-retention-full-type: time
|
||||||
|
repo1-path: "/${APP}/repo1"
|
||||||
|
repo1-s3-uri-style: path
|
||||||
|
manual:
|
||||||
|
repoName: repo1
|
||||||
|
options:
|
||||||
|
- --type=full
|
||||||
|
metadata:
|
||||||
|
labels:
|
||||||
|
app.kubernetes.io/name: pgo-${APP}-backup
|
||||||
|
repos:
|
||||||
|
- name: repo1
|
||||||
|
schedules:
|
||||||
|
full: "0 1 * * 0"
|
||||||
|
differential: "0 1 * * 1-6"
|
||||||
|
s3:
|
||||||
|
bucket: "crunchy-postgres"
|
||||||
|
endpoint: "s3.hsn.dev"
|
||||||
|
region: "us-east-1"
|
1
kubernetes/apps/media/immich/app/resources/init.sql
Normal file
1
kubernetes/apps/media/immich/app/resources/init.sql
Normal file
|
@ -0,0 +1 @@
|
||||||
|
CREATE EXTENSION vector;
|
30
kubernetes/apps/media/immich/ks.yaml
Normal file
30
kubernetes/apps/media/immich/ks.yaml
Normal file
|
@ -0,0 +1,30 @@
|
||||||
|
---
|
||||||
|
# yaml-language-server: $schema=https://ks.hsn.dev/kustomize.toolkit.fluxcd.io/kustomization_v1.json
|
||||||
|
apiVersion: kustomize.toolkit.fluxcd.io/v1
|
||||||
|
kind: Kustomization
|
||||||
|
metadata:
|
||||||
|
name: &app immich
|
||||||
|
namespace: flux-system
|
||||||
|
spec:
|
||||||
|
targetNamespace: media
|
||||||
|
commonMetadata:
|
||||||
|
labels:
|
||||||
|
app.kubernetes.io/name: *app
|
||||||
|
dependsOn:
|
||||||
|
- name: crunchy-postgres-operator
|
||||||
|
- name: external-secrets-stores
|
||||||
|
- name: dragonfly
|
||||||
|
path: ./kubernetes/apps/media/immich/app
|
||||||
|
prune: true
|
||||||
|
sourceRef:
|
||||||
|
kind: GitRepository
|
||||||
|
name: homelab
|
||||||
|
wait: false
|
||||||
|
interval: 30m
|
||||||
|
retryInterval: 1m
|
||||||
|
timeout: 5m
|
||||||
|
postBuild:
|
||||||
|
substitute:
|
||||||
|
APP: *app
|
||||||
|
DB_NAME: immich
|
||||||
|
DB_USER: immich
|
9
kubernetes/apps/media/kustomization.yaml
Normal file
9
kubernetes/apps/media/kustomization.yaml
Normal file
|
@ -0,0 +1,9 @@
|
||||||
|
---
|
||||||
|
# yaml-language-server: $schema=https://json.schemastore.org/kustomization.json
|
||||||
|
apiVersion: kustomize.config.k8s.io/v1beta1
|
||||||
|
kind: Kustomization
|
||||||
|
resources:
|
||||||
|
# Pre Flux-Kustomizations
|
||||||
|
- ./namespace.yaml
|
||||||
|
# Flux-Kustomizations
|
||||||
|
- ./immich/ks.yaml
|
9
kubernetes/apps/media/namespace.yaml
Normal file
9
kubernetes/apps/media/namespace.yaml
Normal file
|
@ -0,0 +1,9 @@
|
||||||
|
---
|
||||||
|
apiVersion: v1
|
||||||
|
kind: Namespace
|
||||||
|
metadata:
|
||||||
|
name: media
|
||||||
|
labels:
|
||||||
|
kustomize.toolkit.fluxcd.io/prune: disabled
|
||||||
|
volsync.backube/privileged-movers: "true"
|
||||||
|
pgo-enabled-hsn.dev: "true"
|
Loading…
Reference in a new issue