feat(immich): BREAKING CHANGE - port to new common + multi-pod (#8801)

This commit is contained in:
Stavros Kois
2023-05-13 10:56:21 +03:00
committed by GitHub
parent 44c8538dfa
commit 45aff06439
16 changed files with 486 additions and 353 deletions
+1 -1
View File
@@ -1,6 +1,6 @@
remote: origin remote: origin
target-branch: master target-branch: master
helm-extra-args: --timeout 120s helm-extra-args: --timeout 180s
chart-yaml-schema: .github/chart_schema.yaml chart-yaml-schema: .github/chart_schema.yaml
chart-dirs: chart-dirs:
- charts/incubator - charts/incubator
+3 -8
View File
@@ -3,15 +3,11 @@ appVersion: "1.49.0"
dependencies: dependencies:
- name: common - name: common
repository: https://library-charts.truecharts.org repository: https://library-charts.truecharts.org
version: 11.1.2 version: 12.6.6
- condition: postgresql.enabled
name: postgresql
repository: https://deps.truecharts.org/
version: 11.0.31
- condition: redis.enabled - condition: redis.enabled
name: redis name: redis
repository: https://deps.truecharts.org repository: https://deps.truecharts.org
version: 5.0.33 version: 6.0.39
description: High performance self-hosted photo and video backup solution. description: High performance self-hosted photo and video backup solution.
home: https://truecharts.org/charts/stable/immich home: https://truecharts.org/charts/stable/immich
icon: https://truecharts.org/img/hotlink-ok/chart-icons/immich.png icon: https://truecharts.org/img/hotlink-ok/chart-icons/immich.png
@@ -26,9 +22,8 @@ name: immich
sources: sources:
- https://github.com/truecharts/charts/tree/master/charts/stable/immich - https://github.com/truecharts/charts/tree/master/charts/stable/immich
- https://github.com/immich-app/immich - https://github.com/immich-app/immich
version: 5.0.16 version: 6.0.0
annotations: annotations:
truecharts.org/catagories: | truecharts.org/catagories: |
- media - media
truecharts.org/SCALE-support: "true" truecharts.org/SCALE-support: "true"
truecharts.org/grade: U
+1
View File
@@ -0,0 +1 @@
{{- include "tc.v1.common.lib.chart.notes" $ -}}
@@ -0,0 +1,95 @@
{{- define "immich.config" -}}
{{- $fname := (include "tc.v1.common.lib.chart.names.fullname" .) -}}
{{- $secretName := printf "%s-secret" $fname -}}
{{- $jwtSecret := randAlphaNum 32 -}}
{{- $typesenseKey := randAlphaNum 32 -}}
{{- with (lookup "v1" "Secret" .Release.Namespace $secretName) -}}
{{- $jwtSecret = index .data "JWT_SECRET" | b64dec -}}
{{- $typesenseKey = index .data "TYPESENSE_API_KEY" | b64dec -}}
{{- end }}
configmap:
web-config:
enabled: true
data:
PORT: {{ .Values.service.web.ports.web.port | quote }}
server-config:
enabled: true
data:
{{/* User Defined */}}
DISABLE_REVERSE_GEOCODING: {{ .Values.immich.disable_reverse_geocoding | quote }}
REVERSE_GEOCODING_PRECISION: {{ .Values.immich.reverse_geocoding_precision | quote }}
ENABLE_MAPBOX: {{ .Values.immich.mapbox_enable | quote }}
SERVER_PORT: {{ .Values.service.server.ports.server.port | quote }}
micro-config:
enabled: true
data:
MICROSERVICES_PORT: {{ .Values.service.microservices.ports.microservices.port | quote }}
REVERSE_GEOCODING_DUMP_DIRECTORY: {{ .Values.persistence.microcache.targetSelector.microservices.microservices.mountPath }}
{{- if .Values.immich.enable_ml }}
ml-config:
enabled: true
data:
MACHINE_LEARNING_PORT: {{ .Values.service.machinelearning.ports.machinelearning.port | quote }}
TRANSFORMERS_CACHE: {{ .Values.persistence.mlcache.targetSelector.machinelearning.machinelearning.mountPath }}
{{- end }}
common-config:
enabled: true
data:
IMMICH_WEB_URL: {{ printf "http://%v-web:%v" $fname .Values.service.web.ports.web.port }}
IMMICH_SERVER_URL: {{ printf "http://%v-server:%v" $fname .Values.service.server.ports.server.port }}
{{- if .Values.immich.enable_ml }}
IMMICH_MACHINE_LEARNING_URL: {{ printf "http://%v-machinelearning:%v" $fname .Values.service.machinelearning.ports.machinelearning.port }}
{{- else }}
IMMICH_MACHINE_LEARNING_URL: "false"
{{- end }}
TYPESENSE_ENABLED: {{ .Values.immich.enable_typesense | quote }}
{{- if .Values.immich.enable_typesense }}
TYPESENSE_URL: {{ printf "http://%v-typesense:%v" $fname .Values.service.typesense.ports.typesense.port }}
TYPESENSE_PROTOCOL: http
TYPESENSE_HOST: {{ printf "%v-typesense" $fname }}
TYPESENSE_PORT: {{ .Values.service.typesense.ports.typesense.port | quote }}
{{- end }}
{{/*
Its unclear where this URL is being used, but poking in their code, seems to be used internally?
Its set to the value of IMMICH_SERVER_URL on their compose. If something doesnt work remotely,
This is the place to start looking
https://github.com/immich-app/immich/blob/b5d75e20167b92de12cc50a816da214779cb0807/web/src/api/api.ts#L55
*/}}
PUBLIC_IMMICH_SERVER_URL: {{ printf "http://%v-server:%v" $fname .Values.service.server.ports.server.port }}
NODE_ENV: production
{{/* User Defined */}}
{{- with .Values.immich.public_login_page_message }}
PUBLIC_LOGIN_PAGE_MESSAGE: {{ . }}
{{- end }}
LOG_LEVEL: {{ .Values.immich.log_level }}
secret:
typesense-secret:
enabled: true
data:
{{/* Secret Key */}}
TYPESENSE_API_KEY: {{ $typesenseKey }}
TYPESENSE_DATA_DIR: {{ .Values.persistence.typesense.targetSelector.typesense.typesense.mountPath }}
secret:
enabled: true
data:
{{/* Secret Key */}}
JWT_SECRET: {{ $jwtSecret }}
TYPESENSE_API_KEY: {{ $typesenseKey }}
{{- with .Values.immich.mapbox_key }}
MAPBOX_KEY: {{ . }}
{{- end }}
deps-secret:
enabled: true
data:
DB_USERNAME: {{ .Values.cnpg.main.user }}
DB_DATABASE_NAME: {{ .Values.cnpg.main.database }}
DB_HOSTNAME: {{ .Values.cnpg.main.creds.host }}
DB_PASSWORD: {{ .Values.cnpg.main.creds.password }}
DB_PORT: "5432"
REDIS_HOSTNAME: {{ .Values.redis.creds.plainhost }}
REDIS_PASSWORD: {{ .Values.redis.creds.redisPassword }}
REDIS_PORT: "6379"
REDIS_DBINDEX: "0"
{{- end -}}
@@ -1,51 +0,0 @@
{{/* Define the configmap */}}
{{- define "immich.config" -}}
{{- $serverConfigName := printf "%s-server-config" (include "tc.common.names.fullname" .) -}}
{{- $commonConfigName := printf "%s-common-config" (include "tc.common.names.fullname" .) -}}
{{- $proxyConfigName := printf "%s-proxy-config" (include "tc.common.names.fullname" .) }}
---
apiVersion: v1
kind: ConfigMap
metadata:
name: {{ $serverConfigName }}
labels:
{{- include "tc.common.labels" . | nindent 4 }}
data:
DB_HOSTNAME: {{ printf "%v-%v" .Release.Name "postgresql" }}
DB_USERNAME: {{ .Values.postgresql.postgresqlUsername }}
DB_DATABASE_NAME: {{ .Values.postgresql.postgresqlDatabase }}
DB_PORT: "5432"
REDIS_HOSTNAME: {{ printf "%v-%v" .Release.Name "redis" }}
REDIS_PORT: "6379"
REDIS_DBINDEX: "0"
{{/* User Defined */}}
DISABLE_REVERSE_GEOCODING: {{ .Values.immich.disable_reverse_geocoding | quote }}
REVERSE_GEOCODING_PRECISION: {{ .Values.immich.reverse_geocoding_precision | quote }}
ENABLE_MAPBOX: {{ .Values.immich.mapbox_enable | quote }}
---
apiVersion: v1
kind: ConfigMap
metadata:
name: {{ $commonConfigName }}
labels:
{{- include "tc.common.labels" . | nindent 4 }}
data:
IMMICH_WEB_URL: http://localhost:3000
IMMICH_SERVER_URL: http://localhost:3001
IMMICH_MACHINE_LEARNING_URL: http://localhost:3003
{{/*
It's unclear where this URL is being used, but poking in their code, seems to be used internally?
It's set to the value of IMMICH_SERVER_URL on their compose. If something doesn't work remotely,
This is the place to start looking
https://github.com/immich-app/immich/blob/b5d75e20167b92de12cc50a816da214779cb0807/web/src/api/api.ts#L55
*/}}
PUBLIC_IMMICH_SERVER_URL: http://localhost:3001
NODE_ENV: production
{{/* User Defined */}}
{{- with .Values.immich.public_login_page_message }}
PUBLIC_LOGIN_PAGE_MESSAGE: {{ . }}
{{- end }}
LOG_LEVEL: {{ .Values.immich.log_level }}
{{- end -}}
@@ -0,0 +1,54 @@
{{/* Define the machinelearning container */}}
{{- define "immich.machinelearning" -}}
enabled: true
type: Deployment
podSpec:
initContainers:
wait-server:
{{- include "immich.wait" (dict "variable" "IMMICH_SERVER_URL" "path" "server-info/ping") | nindent 6 }}
containers:
machinelearning:
enabled: true
primary: true
imageSelector: mlImage
envFrom:
- configMapRef:
name: common-config
- configMapRef:
name: server-config
- configMapRef:
name: ml-config
- secretRef:
name: deps-secret
- secretRef:
name: secret
probes:
readiness:
enabled: true
type: http
path: /ping
port: {{ .Values.service.machinelearning.ports.machinelearning.port }}
liveness:
enabled: true
type: http
path: /ping
port: {{ .Values.service.machinelearning.ports.machinelearning.port }}
startup:
enabled: true
type: http
path: /ping
port: {{ .Values.service.machinelearning.ports.machinelearning.port }}
{{- end -}}
{{- define "immich.machinelearning.service" -}}
enabled: true
type: ClusterIP
targetSelector: machinelearning
ports:
machinelearning:
enabled: true
primary: true
port: 10003
protocol: http
targetSelector: machinelearning
{{- end -}}
@@ -1,56 +1,64 @@
{{/* Define the ml container */}}
{{- define "immich.microservices" -}} {{- define "immich.microservices" -}}
image: {{ .Values.image.repository }}:{{ .Values.image.tag }} enabled: true
imagePullPolicy: {{ .Values.image.pullPolicy }} type: Deployment
securityContext: podSpec:
runAsUser: {{ .Values.podSecurityContext.runAsUser }} initContainers:
runAsGroup: {{ .Values.podSecurityContext.runAsGroup }} wait-server:
readOnlyRootFilesystem: {{ .Values.securityContext.readOnlyRootFilesystem }} {{- include "immich.wait" (dict "variable" "IMMICH_SERVER_URL" "path" "server-info/ping") | nindent 6 }}
runAsNonRoot: {{ .Values.securityContext.runAsNonRoot }} containers:
command: microservices:
- /bin/sh enabled: true
- ./start-microservices.sh primary: true
volumeMounts: imageSelector: image
- name: uploads command: /bin/sh
mountPath: {{ .Values.persistence.uploads.mountPath }} args: ./start-microservices.sh
envFrom: envFrom:
- secretRef: - secretRef:
name: '{{ include "tc.common.names.fullname" . }}-immich-secret' name: secret
- configMapRef: - secretRef:
name: '{{ include "tc.common.names.fullname" . }}-common-config' name: deps-secret
- configMapRef: - configMapRef:
name: '{{ include "tc.common.names.fullname" . }}-server-config' name: common-config
readinessProbe: - configMapRef:
exec: name: server-config
command: - configMapRef:
- /bin/sh name: micro-config
- -c probes:
- | readiness:
ps -a | grep -v grep | grep -q microservices || exit 1 enabled: true
initialDelaySeconds: {{ .Values.probes.readiness.spec.initialDelaySeconds }} type: exec
timeoutSeconds: {{ .Values.probes.readiness.spec.timeoutSeconds }} command:
periodSeconds: {{ .Values.probes.readiness.spec.periodSeconds }} - /bin/sh
failureThreshold: {{ .Values.probes.readiness.spec.failureThreshold }} - -c
livenessProbe: - |
exec: ps -a | grep -v grep | grep -q microservices
command: liveness:
- /bin/sh enabled: true
- -c type: exec
- | command:
ps -a | grep -v grep | grep -q microservices || exit 1 - /bin/sh
initialDelaySeconds: {{ .Values.probes.liveness.spec.initialDelaySeconds }} - -c
timeoutSeconds: {{ .Values.probes.liveness.spec.timeoutSeconds }} - |
periodSeconds: {{ .Values.probes.liveness.spec.periodSeconds }} ps -a | grep -v grep | grep -q microservices
failureThreshold: {{ .Values.probes.liveness.spec.failureThreshold }} startup:
startupProbe: enabled: true
exec: type: exec
command: command:
- /bin/sh - /bin/sh
- -c - -c
- | - |
ps -a | grep -v grep | grep -q microservices || exit 1 ps -a | grep -v grep | grep -q microservices
initialDelaySeconds: {{ .Values.probes.startup.spec.initialDelaySeconds }} {{- end -}}
timeoutSeconds: {{ .Values.probes.startup.spec.timeoutSeconds }}
periodSeconds: {{ .Values.probes.startup.spec.periodSeconds }} {{- define "immich.microservices.service" -}}
failureThreshold: {{ .Values.probes.startup.spec.failureThreshold }} enabled: true
type: ClusterIP
targetSelector: microservices
ports:
microservices:
enabled: true
primary: true
port: 10004
protocol: http
targetSelector: microservices
{{- end -}} {{- end -}}
-69
View File
@@ -1,69 +0,0 @@
{{/* Define the ml container */}}
{{- define "immich.ml" -}}
{{- if hasKey .Values "imageML" -}} {{/* For smooth upgrade, Remove later*/}}
{{- $img := .Values.imageML -}}
{{- $_ := set .Values "mlImage" (dict "repository" $img.repository "tag" $img.tag "pullPolicy" $img.pullPolicy) -}}
{{- end }}
image: {{ .Values.mlImage.repository }}:{{ .Values.mlImage.tag }}
imagePullPolicy: {{ .Values.mlImage.pullPolicy }}
securityContext:
runAsUser: {{ .Values.podSecurityContext.runAsUser }}
runAsGroup: {{ .Values.podSecurityContext.runAsGroup }}
readOnlyRootFilesystem: {{ .Values.securityContext.readOnlyRootFilesystem }}
runAsNonRoot: {{ .Values.securityContext.runAsNonRoot }}
command:
{{- if .Values.persistence.modelcache }}{{/* Only change command after upgrade */}}
- python
- src/main.py
{{- else }}
- /bin/sh
- ./entrypoint.sh
{{- end }}
volumeMounts:
- name: uploads
mountPath: {{ .Values.persistence.uploads.mountPath }}
{{- if .Values.persistence.modelcache }}
- name: modelcache
mountPath: {{ .Values.persistence.modelcache.mountPath }}
{{- end }}
envFrom:
- configMapRef:
name: '{{ include "tc.common.names.fullname" . }}-common-config'
- configMapRef:
name: '{{ include "tc.common.names.fullname" . }}-server-config'
- secretRef:
name: '{{ include "tc.common.names.fullname" . }}-immich-secret'
#readinessProbe:
# exec:
# command:
# - /bin/sh
# - -c
# - |
# grep -q main.js /proc/1/cmdline || exit 1
# initialDelaySeconds: {{ .Values.probes.readiness.spec.initialDelaySeconds }}
# timeoutSeconds: {{ .Values.probes.readiness.spec.timeoutSeconds }}
# periodSeconds: {{ .Values.probes.readiness.spec.periodSeconds }}
# failureThreshold: {{ .Values.probes.readiness.spec.failureThreshold }}
#livenessProbe:
# exec:
# command:
# - /bin/sh
# - -c
# - |
# grep -q main.js /proc/1/cmdline || exit 1
# initialDelaySeconds: {{ .Values.probes.liveness.spec.initialDelaySeconds }}
# timeoutSeconds: {{ .Values.probes.liveness.spec.timeoutSeconds }}
# periodSeconds: {{ .Values.probes.liveness.spec.periodSeconds }}
# failureThreshold: {{ .Values.probes.liveness.spec.failureThreshold }}
#startupProbe:
# exec:
# command:
# - /bin/sh
# - -c
# - |
# grep -q main.js /proc/1/cmdline || exit 1
# initialDelaySeconds: {{ .Values.probes.startup.spec.initialDelaySeconds }}
# timeoutSeconds: {{ .Values.probes.startup.spec.timeoutSeconds }}
# periodSeconds: {{ .Values.probes.startup.spec.periodSeconds }}
# failureThreshold: {{ .Values.probes.startup.spec.failureThreshold }}
{{- end -}}
+30 -45
View File
@@ -1,47 +1,32 @@
{{/* Define the proxy container */}}
{{- define "immich.proxy" -}} {{- define "immich.proxy" -}}
{{- if hasKey .Values "imageProxy" -}} {{/* For smooth upgrade, Remove later */}} enabled: true
{{- $img := .Values.imageProxy -}} type: Deployment
{{- $_ := set .Values "proxyImage" (dict "repository" $img.repository "tag" $img.tag "pullPolicy" $img.pullPolicy) -}} podSpec:
{{- end -}} initContainers:
{{- if not .Values.service.main.ports.main.targetPort -}} {{/* For smooth upgrade, Remove later */}} wait-server:
{{- $_ := set .Values.service.main.ports.main "targetPort" 8080 -}} {{- include "immich.wait" (dict "variable" "IMMICH_SERVER_URL" "path" "server-info/ping") | nindent 6 }}
{{- end }} containers:
image: {{ .Values.proxyImage.repository }}:{{ .Values.proxyImage.tag }} proxy:
imagePullPolicy: {{ .Values.proxyImage.pullPolicy }} enabled: true
securityContext: primary: true
runAsUser: {{ .Values.podSecurityContext.runAsUser }} imageSelector: proxyImage
runAsGroup: {{ .Values.podSecurityContext.runAsGroup }} envFrom:
readOnlyRootFilesystem: {{ .Values.securityContext.readOnlyRootFilesystem }} - configMapRef:
runAsNonRoot: {{ .Values.securityContext.runAsNonRoot }} name: common-config
envFrom: probes:
- configMapRef: readiness:
name: '{{ include "tc.common.names.fullname" . }}-common-config' enabled: true
ports: type: http
- containerPort: {{ .Values.service.main.ports.main.targetPort }} path: /api/server-info/ping
name: main port: {{ .Values.service.main.ports.main.targetPort }}
readinessProbe: liveness:
httpGet: enabled: true
path: /api/server-info/ping type: http
port: {{ .Values.service.main.ports.main.targetPort }} path: /api/server-info/ping
initialDelaySeconds: {{ .Values.probes.readiness.spec.initialDelaySeconds }} port: {{ .Values.service.main.ports.main.targetPort }}
timeoutSeconds: {{ .Values.probes.readiness.spec.timeoutSeconds }} startup:
periodSeconds: {{ .Values.probes.readiness.spec.periodSeconds }} enabled: true
failureThreshold: {{ .Values.probes.readiness.spec.failureThreshold }} type: http
livenessProbe: path: /api/server-info/ping
httpGet: port: {{ .Values.service.main.ports.main.targetPort }}
path: /api/server-info/ping
port: {{ .Values.service.main.ports.main.targetPort }}
initialDelaySeconds: {{ .Values.probes.liveness.spec.initialDelaySeconds }}
timeoutSeconds: {{ .Values.probes.liveness.spec.timeoutSeconds }}
periodSeconds: {{ .Values.probes.liveness.spec.periodSeconds }}
failureThreshold: {{ .Values.probes.liveness.spec.failureThreshold }}
startupProbe:
httpGet:
path: /api/server-info/ping
port: {{ .Values.service.main.ports.main.targetPort }}
initialDelaySeconds: {{ .Values.probes.startup.spec.initialDelaySeconds }}
timeoutSeconds: {{ .Values.probes.startup.spec.timeoutSeconds }}
periodSeconds: {{ .Values.probes.startup.spec.periodSeconds }}
failureThreshold: {{ .Values.probes.startup.spec.failureThreshold }}
{{- end -}} {{- end -}}
@@ -1,25 +0,0 @@
{{/* Define the secret */}}
{{- define "immich.secret" -}}
{{- $secretName := printf "%s-immich-secret" (include "tc.common.names.fullname" .) }}
---
apiVersion: v1
kind: Secret
type: Opaque
metadata:
name: {{ $secretName }}
labels:
{{- include "tc.common.labels" . | nindent 4 }}
data:
{{/* Secret Key */}}
{{- with (lookup "v1" "Secret" .Release.Namespace $secretName) }}
JWT_SECRET: {{ index .data "JWT_SECRET" }}
{{- else }}
JWT_SECRET: {{ randAlphaNum 32 | b64enc }}
{{- end }}
DB_PASSWORD: {{ .Values.postgresql.postgresqlPassword | trimAll "\"" | b64enc }}
REDIS_PASSWORD: {{ .Values.redis.redisPassword | trimAll "\"" | b64enc }}
{{- with .Values.immich.mapbox_key }}
MAPBOX_KEY: {{ . | b64enc}}
{{- end }}
{{- end }}
@@ -0,0 +1,32 @@
{{- define "immich.server" -}}
enabled: true
primary: true
imageSelector: image
command: /bin/sh
args: ./start-server.sh
envFrom:
- configMapRef:
name: server-config
- configMapRef:
name: common-config
- secretRef:
name: deps-secret
- secretRef:
name: secret
probes:
liveness:
enabled: true
type: http
path: /server-info/ping
port: {{ .Values.service.server.ports.server.port }}
readiness:
enabled: true
type: http
path: /server-info/ping
port: {{ .Values.service.server.ports.server.port }}
startup:
enabled: true
type: http
path: /server-info/ping
port: {{ .Values.service.server.ports.server.port }}
{{- end -}}
@@ -0,0 +1,46 @@
{{/* Define the typesense container */}}
{{- define "immich.typesense" -}}
enabled: true
type: Deployment
podSpec:
containers:
typesense:
enabled: true
primary: true
imageSelector: typesenseImage
envFrom:
- secretRef:
name: typesense-secret
args:
- --api-port
- {{ .Values.service.typesense.ports.typesense.port | quote }}
probes:
readiness:
enabled: true
type: http
path: /health
port: {{ .Values.service.typesense.ports.typesense.port }}
liveness:
enabled: true
type: http
path: /health
port: {{ .Values.service.typesense.ports.typesense.port }}
startup:
enabled: true
type: http
path: /health
port: {{ .Values.service.typesense.ports.typesense.port }}
{{- end -}}
{{- define "immich.typesense.service" -}}
enabled: true
type: ClusterIP
targetSelector: typesense
ports:
typesense:
enabled: true
primary: true
port: 10002
protocol: http
targetSelector: typesense
{{- end -}}
+20
View File
@@ -0,0 +1,20 @@
{{- define "immich.wait" -}}
{{- $path := .path | default "" }}
{{- $variable := .variable }}
enabled: true
type: init
imageSelector: alpineImage
envFrom:
- configMapRef:
name: common-config
command:
- /bin/ash
- -c
- |
echo "Pinging [${{ $variable }}/{{ $path }}] until it is ready..."
until wget --spider --quiet "${{ $variable }}/{{ $path }}"; do
echo "Waiting for [${{ $variable }}/{{ $path }}] to be ready..."
sleep 2
done
echo "URL [${{ $variable }}/{{ $path }}] is ready!"
{{- end -}}
+49 -41
View File
@@ -1,44 +1,52 @@
{{/* Define the web container */}} {{/* Define the web container */}}
{{- define "immich.web" -}} {{- define "immich.web" -}}
{{- if hasKey .Values "imageWeb" -}} {{/* For smooth upgrade, Remove later */}} enabled: true
{{- $img := .Values.imageWeb -}} type: Deployment
{{- $_ := set .Values "webImage" (dict "repository" $img.repository "tag" $img.tag "pullPolicy" $img.pullPolicy) -}} podSpec:
{{- end }} initContainers:
image: {{ .Values.webImage.repository }}:{{ .Values.webImage.tag }} wait-server:
imagePullPolicy: {{ .Values.webImage.pullPolicy }} {{- include "immich.wait" (dict "variable" "IMMICH_SERVER_URL" "path" "server-info/ping") | nindent 6 }}
securityContext: containers:
runAsUser: {{ .Values.podSecurityContext.runAsUser }} web:
runAsGroup: {{ .Values.podSecurityContext.runAsGroup }} enabled: true
readOnlyRootFilesystem: {{ .Values.securityContext.readOnlyRootFilesystem }} primary: true
runAsNonRoot: {{ .Values.securityContext.runAsNonRoot }} imageSelector: webImage
command: command: /bin/sh
- /bin/sh args: ./entrypoint.sh
- ./entrypoint.sh envFrom:
envFrom: - configMapRef:
- configMapRef: name: common-config
name: '{{ include "tc.common.names.fullname" . }}-common-config' - configMapRef:
readinessProbe: name: web-config
httpGet: - secretRef:
path: / name: deps-secret
port: 3000 probes:
initialDelaySeconds: {{ .Values.probes.readiness.spec.initialDelaySeconds }} readiness:
timeoutSeconds: {{ .Values.probes.readiness.spec.timeoutSeconds }} enabled: true
periodSeconds: {{ .Values.probes.readiness.spec.periodSeconds }} type: http
failureThreshold: {{ .Values.probes.readiness.spec.failureThreshold }} path: /robots.txt
livenessProbe: port: {{ .Values.service.web.ports.web.port }}
httpGet: liveness:
path: / enabled: true
port: 3000 type: http
initialDelaySeconds: {{ .Values.probes.liveness.spec.initialDelaySeconds }} path: /robots.txt
timeoutSeconds: {{ .Values.probes.liveness.spec.timeoutSeconds }} port: {{ .Values.service.web.ports.web.port }}
periodSeconds: {{ .Values.probes.liveness.spec.periodSeconds }} startup:
failureThreshold: {{ .Values.probes.liveness.spec.failureThreshold }} enabled: true
startupProbe: type: http
httpGet: path: /robots.txt
path: / port: {{ .Values.service.web.ports.web.port }}
port: 3000 {{- end -}}
initialDelaySeconds: {{ .Values.probes.startup.spec.initialDelaySeconds }}
timeoutSeconds: {{ .Values.probes.startup.spec.timeoutSeconds }} {{- define "immich.web.service" -}}
periodSeconds: {{ .Values.probes.startup.spec.periodSeconds }} enabled: true
failureThreshold: {{ .Values.probes.startup.spec.failureThreshold }} type: ClusterIP
targetSelector: web
ports:
web:
enabled: true
primary: true
port: 10000
protocol: http
targetSelector: web
{{- end -}} {{- end -}}
+28 -10
View File
@@ -1,18 +1,36 @@
{{/* Make sure all variables are set properly */}} {{/* Make sure all variables are set properly */}}
{{- include "tc.common.loader.init" . }} {{- include "tc.v1.common.loader.init" . }}
{{/* Render secret */}} {{- $_ := set .Values.workload "proxy" (include "immich.proxy" . | fromYaml) -}}
{{- include "immich.secret" . }}
{{/* Render config */}} {{- $_ := set .Values.workload.main.podSpec.containers "main" (include "immich.server" . | fromYaml) -}}
{{- include "immich.config" . }} {{- if .Values.immich.enable_typesense -}}
{{- $_ := set .Values.workload.main.podSpec.initContainers "wait-typesense" (include "immich.wait" (dict "variable" "TYPESENSE_URL" "path" "health") | fromYaml) -}}
{{- end -}}
{{- $_ := set .Values.additionalContainers "proxy" (include "immich.proxy" . | fromYaml) -}} {{- $_ := set .Values.service "web" (include "immich.web.service" . | fromYaml) -}}
{{- $_ := set .Values.additionalContainers "web" (include "immich.web" . | fromYaml) -}} {{- $_ := set .Values.workload "web" (include "immich.web" . | fromYaml) -}}
{{- $_ := set .Values.service "microservices" (include "immich.microservices.service" . | fromYaml) -}}
{{- $_ := set .Values.workload "microservices" (include "immich.microservices" . | fromYaml) -}}
{{- if .Values.immich.enable_ml -}} {{- if .Values.immich.enable_ml -}}
{{- $_ := set .Values.additionalContainers "ml" (include "immich.ml" . | fromYaml) -}} {{- $_ := set .Values.service "machinelearning" (include "immich.machinelearning.service" . | fromYaml) -}}
{{- $_ := set .Values.workload "machinelearning" (include "immich.machinelearning" . | fromYaml) -}}
{{- end -}}
{{- if .Values.immich.enable_typesense -}}
{{- $_ := set .Values.service "typesense" (include "immich.typesense.service" . | fromYaml) -}}
{{- $_ := set .Values.workload "typesense" (include "immich.typesense" . | fromYaml) -}}
{{- end -}}
{{/* Render configuration for immich
after services, as it has references
*/}}
{{- $config := include "immich.config" . | fromYaml -}}
{{- if $config -}}
{{- $_ := mustMergeOverwrite .Values $config -}}
{{- end -}} {{- end -}}
{{- $_ := set .Values.additionalContainers "microservices" (include "immich.microservices" . | fromYaml) -}}
{{/* Render the templates */}} {{/* Render the templates */}}
{{ include "tc.common.loader.apply" . }} {{ include "tc.v1.common.loader.apply" . }}
+65 -49
View File
@@ -1,37 +1,34 @@
image: image:
repository: tccr.io/truecharts/immich-server repository: tccr.io/truecharts/immich-server
tag: 1.49.0@sha256:baa95afb670ee0e8d013a29eacff6ddc96751998854ba6882c242ce257ac8fbd tag: 1.55.1@sha256:c53b10695ed95b26a098e20788dcf0599b18f09d23dc54dd97717ed189370393
pullPolicy: IfNotPresent pullPolicy: IfNotPresent
mlImage: mlImage:
repository: tccr.io/truecharts/immich-ml repository: tccr.io/truecharts/immich-ml
tag: 1.49.0@sha256:779e1d486d7ac5a1ed98b67b6f4a556e8e5baf334e4f0b9480315226384922c4 tag: 1.55.1@sha256:5253b8bedf856669ca0d260190640fccbe7d19a3ff56af61b70b1e587a76d383
pullPolicy: IfNotPresent pullPolicy: IfNotPresent
webImage: webImage:
repository: tccr.io/truecharts/immich-web repository: tccr.io/truecharts/immich-web
tag: 1.49.0@sha256:983a1f8b736ba337e7370fa19232febf0469c7748f670f15fb0ed4f35f9d88af tag: 1.55.1@sha256:9bd918a3c7e48e750867f16fc813913c5f00829fe0f187ec71168c789a3009db
pullPolicy: IfNotPresent pullPolicy: IfNotPresent
proxyImage: proxyImage:
repository: tccr.io/truecharts/immich-proxy repository: tccr.io/truecharts/immich-proxy
tag: 1.49.0@sha256:08e467d09e6f4abf10e4ea93e0310e6bc323e4ea6b0a6c05fb128bb46ed38578 tag: 1.55.1@sha256:794dd24898a12eb7ab91f6f7322743e0ef9fe1d224fbd62fb7ec1349246d55c4
pullPolicy: IfNotPresent
typesenseImage:
repository: tccr.io/truecharts/immich-typesense
tag: v0.24.1@sha256:1e46a13a98670c98b483e0cbbf66f05aa418146e7edf447446ae72f3bb8477ac
pullPolicy: IfNotPresent pullPolicy: IfNotPresent
command:
- /bin/sh
- ./start-server.sh
securityContext: securityContext:
readOnlyRootFilesystem: false container:
runAsNonRoot: false readOnlyRootFilesystem: false
runAsNonRoot: false
podSecurityContext: runAsUser: 0
runAsUser: 0 runAsGroup: 0
runAsGroup: 0
immich: immich:
enable_ml: true enable_ml: true
enable_typesense: true
public_login_page_message: Immich public_login_page_message: Immich
disable_reverse_geocoding: false disable_reverse_geocoding: false
reverse_geocoding_precision: 3 reverse_geocoding_precision: 3
@@ -40,54 +37,73 @@ immich:
mapbox_enable: false mapbox_enable: false
mapbox_key: "" mapbox_key: ""
envFrom:
- configMapRef:
name: '{{ include "tc.common.names.fullname" . }}-server-config'
- configMapRef:
name: '{{ include "tc.common.names.fullname" . }}-common-config'
- secretRef:
name: '{{ include "tc.common.names.fullname" . }}-immich-secret'
probes:
liveness:
path: /server-info/ping
type: HTTP
port: 3001
readiness:
path: /server-info/ping
type: HTTP
port: 3001
startup:
path: /server-info/ping
type: HTTP
port: 3001
service: service:
main: main:
# Main service targets the proxy
targetSelector: proxy
ports: ports:
main: main:
port: 10323 port: 10323
protocol: HTTP protocol: http
targetSelector: proxy
targetPort: 8080 targetPort: 8080
server:
enabled: true
type: ClusterIP
# Server is the main container
targetSelector: main
ports:
server:
enabled: true
primary: true
port: 10001
protocol: http
targetSelector: main
persistence: persistence:
uploads: uploads:
enabled: true enabled: true
mountPath: /usr/src/app/upload mountPath: /usr/src/app/upload
modelcache: targetSelector:
# Main pod/container is server
main:
main: {}
microservices:
microservices: {}
machinelearning:
machinelearning: {}
mlcache:
enabled: true enabled: true
type: emptyDir type: emptyDir
mountPath: /cache targetSelector:
machinelearning:
machinelearning:
mountPath: /mlcache
microcache:
enabled: true
type: emptyDir
targetSelector:
microservices:
microservices:
mountPath: /microcache
typesense:
enabled: true
type: emptyDir
targetSelector:
typesense:
typesense:
mountPath: /typesensedata
postgresql: cnpg:
enabled: true main:
existingSecret: dbcreds enabled: true
postgresqlUsername: immich user: immich
postgresqlDatabase: immich database: immich
redis: redis:
enabled: true enabled: true
existingSecret: rediscreds redisUsername: default
portal: portal:
enabled: true open:
enabled: true