-
-
Notifications
You must be signed in to change notification settings - Fork 11
Expand file tree
/
Copy pathresource-set.yaml
More file actions
151 lines (149 loc) · 4.46 KB
/
Copy pathresource-set.yaml
File metadata and controls
151 lines (149 loc) · 4.46 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
apiVersion: fluxcd.controlplane.io/v1
kind: ResourceSet
metadata:
name: immich-github-previews
namespace: preview
spec:
inputsFrom:
- apiVersion: fluxcd.controlplane.io/v1
kind: ResourceSetInputProvider
name: immich-github-prs
- apiVersion: fluxcd.controlplane.io/v1
kind: ResourceSetInputProvider
name: immich-github-branches
- apiVersion: fluxcd.controlplane.io/v1
kind: ResourceSetInputProvider
name: immich-github-tags
resourcesTemplate: |
<<- $ctx := dict >>
<<- if hasKey inputs "author" >>
<<- $name := list "pr" inputs.id | join "-" >>
<<- $_ := set $ctx "name" $name >>
<<- $tag := list "commit" inputs.sha | join "-" >>
<<- $_ := set $ctx "tag" $tag >>
<<- else if hasKey inputs "branch" >>
<<- $_ := set $ctx "name" inputs.branch >>
<<- $tag := list "commit" inputs.sha | join "-" >>
<<- $_ := set $ctx "tag" $tag >>
<<- else >>
<<- $_ := set $ctx "name" (inputs.tag | slugify) >>
<<- $_ := set $ctx "tag" inputs.tag >>
<<- end >>
---
apiVersion: postgresql.cnpg.io/v1
kind: Cluster
metadata:
name: << $ctx.name >>-preview-database
namespace: preview
spec:
instances: 1
imageName: ghcr.io/tensorchord/cloudnative-vectorchord:14.18-0.3.0
enableSuperuserAccess: true
bootstrap:
recovery:
backup:
name: preview-base-database-snapshot
postgresql:
shared_preload_libraries:
- "vchord.so"
storage:
size: 10Gi
storageClass: zfs
backup:
volumeSnapshot:
className: zfs
---
kind: PersistentVolumeClaim
apiVersion: v1
metadata:
name: << $ctx.name >>-preview-library
namespace: preview
spec:
dataSource:
name: preview-base-library-snapshot
kind: VolumeSnapshot
apiGroup: snapshot.storage.k8s.io
storageClassName: zfs
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 100Gi
---
apiVersion: helm.toolkit.fluxcd.io/v2
kind: HelmRelease
metadata:
name: << $ctx.name >>-preview
namespace: preview
spec:
interval: 5m
timeout: 20m
install:
disableWait: true
upgrade:
disableWait: true
chart:
spec:
chart: immich
# renovate: datasource=github-releases depName=immich-app/immich-charts
version: "0.10.3"
sourceRef:
kind: HelmRepository
name: immich-charts
namespace: flux-system
interval: 1m
values:
postgres:
enabled: false
valkey:
enabled: true
immich:
persistence:
library:
existingClaim: << $ctx.name >>-preview-library
controllers:
main:
containers:
main:
env:
DB_HOSTNAME:
valueFrom:
secretKeyRef:
name: << $ctx.name >>-preview-database-superuser
key: host
DB_USERNAME:
valueFrom:
secretKeyRef:
name: << $ctx.name >>-preview-database-superuser
key: user
DB_PASSWORD:
valueFrom:
secretKeyRef:
name: << $ctx.name >>-preview-database-superuser
key: password
DB_DATABASE_NAME:
valueFrom:
secretKeyRef:
name: << $ctx.name >>-preview-database-app
key: dbname
LOG_LEVEL: verbose
image:
tag: << $ctx.tag >>
pullPolicy: Always
server:
ingress:
main:
enabled: true
className: nginx
annotations:
cert-manager.io/cluster-issuer: letsencrypt-production
nginx.ingress.kubernetes.io/proxy-body-size: "0"
hosts:
- host: << $ctx.name >>.preview.internal.immich.build
paths:
- path: /
pathType: Prefix
tls:
- hosts:
- << $ctx.name >>.preview.internal.immich.build
secretName: << $ctx.name >>-preview-tls