Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for separate workers #105

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion charts/immich/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
59 changes: 59 additions & 0 deletions charts/immich/templates/microservices.yaml
Original file line number Diff line number Diff line change
@@ -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 }}
7 changes: 6 additions & 1 deletion charts/immich/templates/server.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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

Expand All @@ -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
Expand Down
9 changes: 9 additions & 0 deletions charts/immich/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down