From 7f8980400ace5cb4fad647c1a46aba30c27d60c5 Mon Sep 17 00:00:00 2001 From: Black Napalm Date: Sun, 30 Jun 2024 16:30:56 +0300 Subject: [PATCH 1/2] feat: allow split microservices --- charts/immich/templates/microservices.yaml | 59 ++++++++++++++++++++++ charts/immich/templates/server.yaml | 7 ++- charts/immich/values.yaml | 9 ++++ 3 files changed, 74 insertions(+), 1 deletion(-) create mode 100644 charts/immich/templates/microservices.yaml diff --git a/charts/immich/templates/microservices.yaml b/charts/immich/templates/microservices.yaml new file mode 100644 index 0000000..81f9d4c --- /dev/null +++ b/charts/immich/templates/microservices.yaml @@ -0,0 +1,59 @@ +{{- define "immich.microservices.hardcodedValues" -}} +global: + nameOverride: microservices + +env: + IMMICH_WORKERS_INCLUDE: microservices + {{- if .Values.immich.metrics.enabled }} + IMMICH_METRICS: true + {{- end }} + {{- if .Values.immich.configuration }} + IMMICH_CONFIG_FILE: /config/immich-config.yaml + {{- end }} + +{{- if .Values.immich.configuration }} +podAnnotations: + checksum/config: {{ .Values.immich.configuration | toYaml | sha256sum }} +{{- end }} + +service: + main: + enabled: {{ .Values.immich.metrics.enabled }} + type: ClusterIP + ports: + http: + enabled: false + primary: true + port: 3001 + protocol: HTTP + metrics: + enabled: {{ .Values.immich.metrics.enabled }} + port: 8082 + protocol: HTTP + +serviceMonitor: + main: + enabled: {{ .Values.immich.metrics.enabled }} + endpoints: + - port: metrics + scheme: http + +persistence: +{{- if .Values.immich.configuration }} + config: + enabled: true + type: configMap + name: {{ .Release.Name }}-immich-config +{{- end }} + library: + enabled: true + mountPath: /usr/src/app/upload + existingClaim: {{ .Values.immich.persistence.library.existingClaim }} +{{- end }} + +{{ if .Values.microservices.enabled }} +{{- $ctx := deepCopy . -}} +{{- $_ := get .Values "microservices" | mergeOverwrite $ctx.Values -}} +{{- $_ = include "immich.microservices.hardcodedValues" . | fromYaml | merge $ctx.Values -}} +{{- include "bjw-s.common.loader.all" $ctx }} +{{ end }} diff --git a/charts/immich/templates/server.yaml b/charts/immich/templates/server.yaml index d78e4f6..39afee3 100644 --- a/charts/immich/templates/server.yaml +++ b/charts/immich/templates/server.yaml @@ -9,6 +9,9 @@ env: {{- if .Values.immich.configuration }} IMMICH_CONFIG_FILE: /config/immich-config.yaml {{- end }} + {{- if .Values.microservices.enabled }} + IMMICH_WORKERS_EXCLUDE: microservices + {{- end }} {{- if .Values.immich.configuration }} podAnnotations: @@ -31,7 +34,7 @@ service: port: 8081 protocol: HTTP metrics-ms: - enabled: {{ .Values.immich.metrics.enabled }} + enabled: {{ and .Values.immich.metrics.enabled ( not .Values.microservices.enabled ) }} port: 8082 protocol: HTTP @@ -42,8 +45,10 @@ serviceMonitor: endpoints: - port: metrics-api scheme: http +{{- if not .Values.microservices.enabled}} - port: metrics-ms scheme: http +{{- end }} probes: liveness: &probes diff --git a/charts/immich/values.yaml b/charts/immich/values.yaml index 01184bc..0ed4248 100644 --- a/charts/immich/values.yaml +++ b/charts/immich/values.yaml @@ -83,6 +83,15 @@ server: - path: "/" tls: [] +microservices: + # setting this will split api and microservices workers, by disabling + # microservices in the main server and launching separate deployment for + # microservices + enabled: false + image: + repository: ghcr.io/immich-app/immich-server + pullPolicy: IfNotPresent + machine-learning: enabled: true image: From 91ba3c9dfccf77b7596eb8713d43951aee40cf03 Mon Sep 17 00:00:00 2001 From: Black Napalm Date: Sun, 30 Jun 2024 16:31:27 +0300 Subject: [PATCH 2/2] chore: bump chart version --- charts/immich/Chart.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/charts/immich/Chart.yaml b/charts/immich/Chart.yaml index 06ab650..e21f3f1 100644 --- a/charts/immich/Chart.yaml +++ b/charts/immich/Chart.yaml @@ -2,7 +2,7 @@ apiVersion: v2 description: A chart to power Immich (immich.app) running on kubernetes name: immich -version: 0.7.0 +version: 0.8.0 appVersion: v1.106.1 home: https://immich.app/ icon: https://raw.githubusercontent.com/immich-app/immich/main/design/immich-logo.svg