diff --git a/.github/workflows/charts_tests.yaml b/.github/workflows/charts_tests.yaml index 640fc768f4..3383a842a1 100644 --- a/.github/workflows/charts_tests.yaml +++ b/.github/workflows/charts_tests.yaml @@ -20,7 +20,7 @@ jobs: helm-version: - v3.9.4 - v3.10.3 - - v3.12.0 + - v3.12.1 steps: - name: Checkout uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b # tag=v3 @@ -87,7 +87,7 @@ jobs: # We run tests on Helm version of latest SCALE release, SCALE nightly and manually defined "latest" helm-version: - v3.9.4 - - v3.12.0 + - v3.12.1 # We run tests on k3s version of latest SCALE release, SCALE nightly and manually defined "latest" k3s-version: - v1.25.3+k3s1 diff --git a/.github/workflows/common_library_tests.yaml b/.github/workflows/common_library_tests.yaml index cde33cb063..5843d01166 100644 --- a/.github/workflows/common_library_tests.yaml +++ b/.github/workflows/common_library_tests.yaml @@ -19,7 +19,7 @@ jobs: helm-version: - v3.9.4 - v3.10.3 - - v3.12.0 + - v3.12.1 steps: - name: Checkout uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b # tag=v3 @@ -57,7 +57,7 @@ jobs: helm-version: - v3.9.4 - v3.10.3 - - v3.12.0 + - v3.12.1 steps: - name: Checkout uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b # tag=v3 @@ -97,7 +97,7 @@ jobs: - v1.25.3+k3s1 # We run tests on Helm version of latest SCALE release, SCALE nightly and manually defined "latest" helm-version: - - v3.12.0 + - v3.12.1 values: - basic-values.yaml - configmap-values.yaml diff --git a/library/common/Chart.yaml b/library/common/Chart.yaml index e5113d9da7..7adb20e369 100644 --- a/library/common/Chart.yaml +++ b/library/common/Chart.yaml @@ -2,7 +2,7 @@ apiVersion: v2 name: common description: A library chart for iX Official Catalog type: library -version: 1.0.9 +version: 1.0.10 appVersion: v1 annotations: title: Common Library Chart diff --git a/library/common/templates/app_functions/_redis.tpl b/library/common/templates/app_functions/_redis.tpl new file mode 100644 index 0000000000..06a6bec9b8 --- /dev/null +++ b/library/common/templates/app_functions/_redis.tpl @@ -0,0 +1,93 @@ +{{/* Returns a redis pod with init container for fixing permissions +and a pre-upgrade job to backup the database */}} +{{/* Call this template: +{{ include "ix.v1.common.app.redis" (dict "name" "redis" "secretName" "redis-creds" "resources" .Values.resources) }} + +name (optional): Name of the redis pod/container (default: redis) +secretName (required): Name of the secret containing the redis credentials +resources (required): Resources for the redis container +*/}} +{{- define "ix.v1.common.app.redis" -}} + {{- $name := .name | default "redis" -}} + {{- $secretName := (required "Redis - Secret Name is required" .secretName) -}} + {{- $resources := (required "Redis - Resources are required" .resources) }} +{{ $name }}: + enabled: true + type: Deployment + podSpec: + securityContext: + fsGroup: 1001 + containers: + {{ $name }}: + enabled: true + primary: true + imageSelector: redisImage + securityContext: + runAsUser: 1001 + runAsGroup: 0 + runAsNonRoot: false + readOnlyRootFilesystem: false + resources: + limits: + cpu: {{ $resources.limits.cpu }} + memory: {{ $resources.limits.memory }} + envFrom: + - secretRef: + name: {{ $secretName }} + probes: + liveness: + enabled: true + type: exec + command: + - /bin/sh + - -c + - redis-cli -a "$REDIS_PASSWORD" -p ${REDIS_PORT_NUMBER:-6379} ping | grep -q PONG + readiness: + enabled: true + type: exec + command: + - /bin/sh + - -c + - redis-cli -a "$REDIS_PASSWORD" -p ${REDIS_PORT_NUMBER:-6379} ping | grep -q PONG + startup: + enabled: true + type: exec + command: + - /bin/sh + - -c + - redis-cli -a "$REDIS_PASSWORD" -p ${REDIS_PORT_NUMBER:-6379} ping | grep -q PONG +{{- end -}} + +{{/* Returns a redis-wait container for waiting for redis to be ready */}} +{{/* Call this template: +{{ include "ix.v1.common.app.redisWait" (dict "name" "redis-wait" "secretName" "redis-creds") }} + +name (optional): Name of the redis-wait container (default: redis-wait) +secretName (required): Name of the secret containing the redis credentials +*/}} + +{{- define "ix.v1.common.app.redisWait" -}} + {{- $name := .name | default "redis-wait" -}} + {{- $secretName := (required "Redis-Wait - Secret Name is required" .secretName) }} +{{ $name }}: + enabled: true + type: init + imageSelector: redisImage + envFrom: + - secretRef: + name: {{ $secretName }} + resources: + limits: + cpu: 500m + memory: 256Mi + command: bash + args: + - -c + - | + echo "Waiting for redis to be ready" + until redis-cli -h "$REDIS_HOST" -a "$REDIS_PASSWORD" -p ${REDIS_PORT_NUMBER:-6379} ping | grep -q PONG; do + echo "Waiting for redis to be ready. Sleeping 2 seconds..." + sleep 2 + done + echo "Redis is ready!" +{{- end -}} diff --git a/library/common/templates/lib/container/_resources.tpl b/library/common/templates/lib/container/_resources.tpl index 9cd47285e3..3021101fcc 100644 --- a/library/common/templates/lib/container/_resources.tpl +++ b/library/common/templates/lib/container/_resources.tpl @@ -8,7 +8,7 @@ objectData: The object data to be used to render the container. {{- $rootCtx := .rootCtx -}} {{- $objectData := .objectData -}} - {{- $resources := $rootCtx.Values.resources -}} + {{- $resources := mustDeepCopy $rootCtx.Values.resources -}} {{- if $objectData.resources -}} {{- $resources = mustMergeOverwrite $resources $objectData.resources -}} diff --git a/library/common/values.yaml b/library/common/values.yaml index 9b11deb4c5..f01965e437 100644 --- a/library/common/values.yaml +++ b/library/common/values.yaml @@ -51,6 +51,11 @@ mariadbImage: tag: "10.6.14" pullPolicy: IfNotPresent +redisImage: + repository: bitnami/redis + tag: "7.0.11" + pullPolicy: IfNotPresent + # -- (docs/README.md) securityContext: container: diff --git a/library/ix-dev/community/immich/Chart.lock b/library/ix-dev/community/immich/Chart.lock new file mode 100644 index 0000000000..c9acb307f3 --- /dev/null +++ b/library/ix-dev/community/immich/Chart.lock @@ -0,0 +1,6 @@ +dependencies: +- name: common + repository: file://../../../common + version: 1.0.10 +digest: sha256:06709bd6d9a8dbb721eec437a52f8c24aeecefbbc57e6f8617e53b29570d5512 +generated: "2023-06-20T18:37:14.983325697+03:00" diff --git a/library/ix-dev/community/immich/Chart.yaml b/library/ix-dev/community/immich/Chart.yaml new file mode 100644 index 0000000000..41cc814cd9 --- /dev/null +++ b/library/ix-dev/community/immich/Chart.yaml @@ -0,0 +1,26 @@ +name: immich +description: Immich +annotations: + title: Immich +type: application +version: 1.0.0 +apiVersion: v2 +appVersion: '1.61.1' +kubeVersion: '>=1.16.0-0' +maintainers: + - name: truenas + url: https://www.truenas.com/ + email: dev@ixsystems.com +dependencies: + - name: common + repository: file://../../../common + version: 1.0.10 +home: https://immich.app +icon: https://github.com/immich-app/immich/raw/main/design/immich-logo.svg +sources: + - https://immich.app + - https://github.com/truenas/charts/tree/master/community/immich + - https://github.com/immich-app/immich +keywords: + - photos + - backup diff --git a/library/ix-dev/community/immich/README.md b/library/ix-dev/community/immich/README.md new file mode 100644 index 0000000000..88f8be3f9c --- /dev/null +++ b/library/ix-dev/community/immich/README.md @@ -0,0 +1,3 @@ +# Immich + +[Immich](https://immich.app) - Self-hosted backup solution for photos and videos on mobile device diff --git a/library/ix-dev/community/immich/app-readme.md b/library/ix-dev/community/immich/app-readme.md new file mode 100644 index 0000000000..88f8be3f9c --- /dev/null +++ b/library/ix-dev/community/immich/app-readme.md @@ -0,0 +1,3 @@ +# Immich + +[Immich](https://immich.app) - Self-hosted backup solution for photos and videos on mobile device diff --git a/library/ix-dev/community/immich/charts/common-1.0.10.tgz b/library/ix-dev/community/immich/charts/common-1.0.10.tgz new file mode 100644 index 0000000000..cc6c1096b0 Binary files /dev/null and b/library/ix-dev/community/immich/charts/common-1.0.10.tgz differ diff --git a/library/ix-dev/community/immich/ci/basic-values.yaml b/library/ix-dev/community/immich/ci/basic-values.yaml new file mode 100644 index 0000000000..c19bb28d0d --- /dev/null +++ b/library/ix-dev/community/immich/ci/basic-values.yaml @@ -0,0 +1,22 @@ +immichStorage: + uploads: + type: hostPath + hostPath: /mnt/{{ .Release.Name }}/uploads + library: + type: hostPath + hostPath: /mnt/{{ .Release.Name }}/library + thumbs: + type: hostPath + hostPath: /mnt/{{ .Release.Name }}/thumbs + profile: + type: hostPath + hostPath: /mnt/{{ .Release.Name }}/profile + video: + type: hostPath + hostPath: /mnt/{{ .Release.Name }}/video + pgData: + type: hostPath + hostPath: /mnt/{{ .Release.Name }}/pgData + pgBackup: + type: hostPath + hostPath: /mnt/{{ .Release.Name }}/pgBackup diff --git a/library/ix-dev/community/immich/ci/no-extra-values.yaml b/library/ix-dev/community/immich/ci/no-extra-values.yaml new file mode 100644 index 0000000000..ec9d1d0fd1 --- /dev/null +++ b/library/ix-dev/community/immich/ci/no-extra-values.yaml @@ -0,0 +1,26 @@ +immichStorage: + uploads: + type: hostPath + hostPath: /mnt/{{ .Release.Name }}/uploads + library: + type: hostPath + hostPath: /mnt/{{ .Release.Name }}/library + thumbs: + type: hostPath + hostPath: /mnt/{{ .Release.Name }}/thumbs + profile: + type: hostPath + hostPath: /mnt/{{ .Release.Name }}/profile + video: + type: hostPath + hostPath: /mnt/{{ .Release.Name }}/video + pgData: + type: hostPath + hostPath: /mnt/{{ .Release.Name }}/pgData + pgBackup: + type: hostPath + hostPath: /mnt/{{ .Release.Name }}/pgBackup + +immichConfig: + enableML: false + enableTypesense: false diff --git a/library/ix-dev/community/immich/ci/no-ml-values.yaml b/library/ix-dev/community/immich/ci/no-ml-values.yaml new file mode 100644 index 0000000000..6708cd5e09 --- /dev/null +++ b/library/ix-dev/community/immich/ci/no-ml-values.yaml @@ -0,0 +1,25 @@ +immichStorage: + uploads: + type: hostPath + hostPath: /mnt/{{ .Release.Name }}/uploads + library: + type: hostPath + hostPath: /mnt/{{ .Release.Name }}/library + thumbs: + type: hostPath + hostPath: /mnt/{{ .Release.Name }}/thumbs + profile: + type: hostPath + hostPath: /mnt/{{ .Release.Name }}/profile + video: + type: hostPath + hostPath: /mnt/{{ .Release.Name }}/video + pgData: + type: hostPath + hostPath: /mnt/{{ .Release.Name }}/pgData + pgBackup: + type: hostPath + hostPath: /mnt/{{ .Release.Name }}/pgBackup + +immichConfig: + enableML: false diff --git a/library/ix-dev/community/immich/ci/no-typesenes-values.yaml b/library/ix-dev/community/immich/ci/no-typesenes-values.yaml new file mode 100644 index 0000000000..16749e2525 --- /dev/null +++ b/library/ix-dev/community/immich/ci/no-typesenes-values.yaml @@ -0,0 +1,25 @@ +immichStorage: + uploads: + type: hostPath + hostPath: /mnt/{{ .Release.Name }}/uploads + library: + type: hostPath + hostPath: /mnt/{{ .Release.Name }}/library + thumbs: + type: hostPath + hostPath: /mnt/{{ .Release.Name }}/thumbs + profile: + type: hostPath + hostPath: /mnt/{{ .Release.Name }}/profile + video: + type: hostPath + hostPath: /mnt/{{ .Release.Name }}/video + pgData: + type: hostPath + hostPath: /mnt/{{ .Release.Name }}/pgData + pgBackup: + type: hostPath + hostPath: /mnt/{{ .Release.Name }}/pgBackup + +immichConfig: + enableTypesense: false diff --git a/library/ix-dev/community/immich/item.yaml b/library/ix-dev/community/immich/item.yaml new file mode 100644 index 0000000000..2a13ecd76e --- /dev/null +++ b/library/ix-dev/community/immich/item.yaml @@ -0,0 +1,7 @@ +icon_url: https://github.com/immich-app/immich/raw/main/design/immich-logo.svg +categories: + - media +screenshots: [] +tags: + - photos + - backup diff --git a/library/ix-dev/community/immich/metadata.yaml b/library/ix-dev/community/immich/metadata.yaml new file mode 100644 index 0000000000..651d05224b --- /dev/null +++ b/library/ix-dev/community/immich/metadata.yaml @@ -0,0 +1,14 @@ +runAsContext: + - userName: root + groupName: root + gid: 0 + uid: 0 + description: Immich runs as root user in order to spawn different sub-processes. +capabilities: + - name: CHOWN + description: Immich Proxy is able to chown files. + - name: SETUID + description: Immich Proxy and Web is able to set user ID for it's sub-processes. + - name: SETGID + description: Immich Proxy and Web is able to set group ID for it's sub-processes. +hostMounts: [] diff --git a/library/ix-dev/community/immich/questions.yaml b/library/ix-dev/community/immich/questions.yaml new file mode 100644 index 0000000000..30ed92a274 --- /dev/null +++ b/library/ix-dev/community/immich/questions.yaml @@ -0,0 +1,410 @@ +groups: + - name: Immich Configuration + description: Configure Immich + - name: Network Configuration + description: Configure Network for Immich + - name: Storage Configuration + description: Configure Storage for Immich + - name: Resources Configuration + description: Configure Resources for Immich + +portals: + web_portal: + protocols: + - "$kubernetes-resource_configmap_portal_protocol" + host: + - "$kubernetes-resource_configmap_portal_host" + ports: + - "$kubernetes-resource_configmap_portal_port" + path: "$kubernetes-resource_configmap_portal_path" + +questions: + - variable: TZ + group: Immich Configuration + label: Timezone + schema: + type: string + default: Etc/UTC + required: true + $ref: + - definitions/timezone + + - variable: immichConfig + label: "" + group: Immich Configuration + schema: + type: dict + attrs: + - variable: disableReverseGeocoding + label: Disable Reverse Geocoding + schema: + type: boolean + default: false + show_subquestions_if: true + subquestions: + - variable: reverseGeocodingPrecision + label: Reverse Geocoding Precision + description: | + The precision of the reverse geocoding. The higher the number, the more precise the reverse geocoding will be.
+ This ranges from 0-3 with 3 being the most precise
+ - 3 - Cities > 500 population: ~200MB RAM
+ - 2 - Cities > 1000 population: ~150MB RAM
+ - 1 - Cities > 5000 population: ~80MB RAM
+ - 0 - Cities > 15000 population: ~40MB RAM + schema: + type: int + default: 3 + min: 0 + max: 3 + required: true + - variable: publicLoginMessage + label: Public Login Message + description: | + The message that will be displayed on the login page. + schema: + type: string + default: "" + - variable: enableML + label: Enable Machine Learning + description: | + Enable Machine Learning + schema: + type: boolean + default: true + - variable: enableTypesense + label: Enable Typesense + description: | + Enable Typesense + schema: + type: boolean + default: true + + - variable: immichNetwork + label: "" + group: Network Configuration + schema: + type: dict + attrs: + - variable: webuiPort + label: Web Port + description: The port for the Immich WebUI. + schema: + type: int + default: 30041 + min: 9000 + max: 65535 + required: true + + - variable: immichStorage + label: "" + group: Storage Configuration + schema: + type: dict + attrs: + - variable: uploads + label: Immich Uploads Storage + description: The path to store Immich uploads. + schema: + type: dict + attrs: + - variable: type + label: Type + description: | + ixVolume: Is dataset created automatically by the system.
+ Host Path: Is a path that already exists on the system. + schema: + type: string + required: true + default: ixVolume + enum: + - value: hostPath + description: Host Path (Path that already exists on the system) + - value: ixVolume + description: ixVolume (Dataset created automatically by the system) + - variable: datasetName + label: Dataset Name + schema: + type: string + show_if: [["type", "=", "ixVolume"]] + required: true + hidden: true + immutable: true + default: uploads + $ref: + - "normalize/ixVolume" + - variable: hostPath + label: Host Path + schema: + type: hostpath + show_if: [["type", "=", "hostPath"]] + immutable: true + required: true + - variable: library + label: Immich Library Storage + description: The path to store Immich library. + schema: + type: dict + attrs: + - variable: type + label: Type + description: | + ixVolume: Is dataset created automatically by the system.
+ Host Path: Is a path that already exists on the system. + schema: + type: string + required: true + default: ixVolume + enum: + - value: hostPath + description: Host Path (Path that already exists on the system) + - value: ixVolume + description: ixVolume (Dataset created automatically by the system) + - variable: datasetName + label: Dataset Name + schema: + type: string + show_if: [["type", "=", "ixVolume"]] + required: true + hidden: true + immutable: true + default: library + $ref: + - "normalize/ixVolume" + - variable: hostPath + label: Host Path + schema: + type: hostpath + show_if: [["type", "=", "hostPath"]] + immutable: true + required: true + - variable: thumbs + label: Immich Thumbs Storage + description: The path to store Immich Thumbs. + schema: + type: dict + attrs: + - variable: type + label: Type + description: | + ixVolume: Is dataset created automatically by the system.
+ Host Path: Is a path that already exists on the system. + schema: + type: string + required: true + default: ixVolume + enum: + - value: hostPath + description: Host Path (Path that already exists on the system) + - value: ixVolume + description: ixVolume (Dataset created automatically by the system) + - variable: datasetName + label: Dataset Name + schema: + type: string + show_if: [["type", "=", "ixVolume"]] + required: true + hidden: true + immutable: true + default: thumbs + $ref: + - "normalize/ixVolume" + - variable: hostPath + label: Host Path + schema: + type: hostpath + show_if: [["type", "=", "hostPath"]] + immutable: true + required: true + - variable: profile + label: Immich Profile Storage + description: The path to store Immich Profile. + schema: + type: dict + attrs: + - variable: type + label: Type + description: | + ixVolume: Is dataset created automatically by the system.
+ Host Path: Is a path that already exists on the system. + schema: + type: string + required: true + default: ixVolume + enum: + - value: hostPath + description: Host Path (Path that already exists on the system) + - value: ixVolume + description: ixVolume (Dataset created automatically by the system) + - variable: datasetName + label: Dataset Name + schema: + type: string + show_if: [["type", "=", "ixVolume"]] + required: true + hidden: true + immutable: true + default: profile + $ref: + - "normalize/ixVolume" + - variable: hostPath + label: Host Path + schema: + type: hostpath + show_if: [["type", "=", "hostPath"]] + immutable: true + required: true + - variable: video + label: Immich Video Storage + description: The path to store Immich Video. + schema: + type: dict + attrs: + - variable: type + label: Type + description: | + ixVolume: Is dataset created automatically by the system.
+ Host Path: Is a path that already exists on the system. + schema: + type: string + required: true + default: ixVolume + enum: + - value: hostPath + description: Host Path (Path that already exists on the system) + - value: ixVolume + description: ixVolume (Dataset created automatically by the system) + - variable: datasetName + label: Dataset Name + schema: + type: string + show_if: [["type", "=", "ixVolume"]] + required: true + hidden: true + immutable: true + default: video + $ref: + - "normalize/ixVolume" + - variable: hostPath + label: Host Path + schema: + type: hostpath + show_if: [["type", "=", "hostPath"]] + immutable: true + required: true + - variable: pgData + label: Immich Postgres Data Storage + description: The path to store Immich Postgres Data. + schema: + type: dict + attrs: + - variable: type + label: Type + description: | + ixVolume: Is dataset created automatically by the system.
+ Host Path: Is a path that already exists on the system. + schema: + type: string + required: true + default: ixVolume + enum: + - value: hostPath + description: Host Path (Path that already exists on the system) + - value: ixVolume + description: ixVolume (Dataset created automatically by the system) + - variable: datasetName + label: Dataset Name + schema: + type: string + show_if: [["type", "=", "ixVolume"]] + required: true + hidden: true + immutable: true + default: pgData + $ref: + - "normalize/ixVolume" + - variable: hostPath + label: Host Path + schema: + type: hostpath + show_if: [["type", "=", "hostPath"]] + immutable: true + required: true + - variable: pgBackup + label: Immich Postgres Backup Storage + description: The path to store Immich Postgres Backup. + schema: + type: dict + attrs: + - variable: type + label: Type + description: | + ixVolume: Is dataset created automatically by the system.
+ Host Path: Is a path that already exists on the system. + schema: + type: string + required: true + default: ixVolume + enum: + - value: hostPath + description: Host Path (Path that already exists on the system) + - value: ixVolume + description: ixVolume (Dataset created automatically by the system) + - variable: datasetName + label: Dataset Name + schema: + type: string + show_if: [["type", "=", "ixVolume"]] + required: true + hidden: true + immutable: true + default: pgBackup + $ref: + - "normalize/ixVolume" + - variable: hostPath + label: Host Path + schema: + type: hostpath + show_if: [["type", "=", "hostPath"]] + immutable: true + required: true + + - variable: resources + label: "" + group: Resources Configuration + schema: + type: dict + attrs: + - variable: limits + label: Limits + schema: + type: dict + attrs: + - variable: cpu + label: CPU + description: CPU limit for Immich. + schema: + type: string + max_length: 6 + valid_chars: '^(0\.[1-9]|[1-9][0-9]*)(\.[0-9]|m?)$' + valid_chars_error: | + Valid CPU limit formats are
+ - Plain Integer - eg. 1
+ - Float - eg. 0.5
+ - Milicpu - eg. 500m + default: "4000m" + required: true + - variable: memory + label: Memory + description: Memory limit for Immich. + schema: + type: string + max_length: 12 + valid_chars: '^[1-9][0-9]*([EPTGMK]i?|e[0-9]+)?$' + valid_chars_error: | + Valid Memory limit formats are
+ - Suffixed with E/P/T/G/M/K - eg. 1G
+ - Suffixed with Ei/Pi/Ti/Gi/Mi/Ki - eg. 1Gi
+ - Plain Integer in bytes - eg. 1024
+ - Exponent - eg. 134e6 + default: "8Gi" + required: true diff --git a/library/ix-dev/community/immich/templates/NOTES.txt b/library/ix-dev/community/immich/templates/NOTES.txt new file mode 100644 index 0000000000..ba4e01146c --- /dev/null +++ b/library/ix-dev/community/immich/templates/NOTES.txt @@ -0,0 +1 @@ +{{ include "ix.v1.common.lib.chart.notes" $ }} diff --git a/library/ix-dev/community/immich/templates/_configuration.tpl b/library/ix-dev/community/immich/templates/_configuration.tpl new file mode 100644 index 0000000000..1434df7b72 --- /dev/null +++ b/library/ix-dev/community/immich/templates/_configuration.tpl @@ -0,0 +1,125 @@ +{{- define "immich.configuration" -}} + {{- $fullname := (include "ix.v1.common.lib.chart.names.fullname" $) -}} + + {{- $dbHost := (printf "%s-postgres" $fullname) -}} + {{- $dbUser := "immich" -}} + {{- $dbName := "immich" -}} + + {{- $dbPass := randAlphaNum 32 -}} + {{- with (lookup "v1" "Secret" .Release.Namespace (printf "%s-postgres-creds" $fullname)) -}} + {{- $dbPass = ((index .data "POSTGRES_PASSWORD") | b64dec) -}} + {{- end -}} + + {{- $redisHost := (printf "%s-redis" $fullname) -}} + + {{- $redisPass := randAlphaNum 32 -}} + {{- with (lookup "v1" "Secret" .Release.Namespace (printf "%s-redis-creds" $fullname)) -}} + {{- $redisPass = ((index .data "REDIS_PASSWORD") | b64dec) -}} + {{- end -}} + + {{- $dbURL := (printf "postgres://%s:%s@%s:5432/%s?sslmode=disable" $dbUser $dbPass $dbHost $dbName) -}} + + {{- $typesenseKey := randAlphaNum 32 -}} + {{- with (lookup "v1" "Secret" .Release.Namespace (printf "%s-immich-creds" $fullname)) -}} + {{- $typesenseKey = ((index .data "TYPESENSE_API_KEY") | b64dec) -}} + {{- end -}} + + {{- $mlURL := "false" -}} + {{- if .Values.immichConfig.enableML -}} + {{- $mlURL = printf "http://%v-machinelearning:%v" $fullname .Values.immichNetwork.microservicesPort -}} + {{- end }} + +secret: + postgres-creds: + enabled: true + data: + POSTGRES_USER: {{ $dbUser }} + POSTGRES_DB: {{ $dbName }} + POSTGRES_PASSWORD: {{ $dbPass }} + POSTGRES_HOST: {{ $dbHost }} + POSTGRES_URL: {{ $dbURL }} + + redis-creds: + enabled: true + data: + ALLOW_EMPTY_PASSWORD: "no" + REDIS_PASSWORD: {{ $redisPass }} + REDIS_HOST: {{ $redisHost }} + + {{/* Server & Microservices */}} + immich-creds: + enabled: true + data: + IMMICH_MACHINE_LEARNING_URL: {{ $mlURL | quote }} + TYPESENSE_ENABLED: {{ .Values.immichConfig.enableTypesense | quote }} + TYPESENSE_API_KEY: {{ $typesenseKey }} + {{- if .Values.immichConfig.enableTypesense }} + TYPESENSE_PROTOCOL: http + TYPESENSE_HOST: {{ printf "%v-typesense" $fullname }} + TYPESENSE_PORT: {{ .Values.immichNetwork.typesensePort | quote }} + {{- end }} + DB_USERNAME: {{ $dbUser }} + DB_PASSWORD: {{ $dbPass }} + DB_HOSTNAME: {{ $dbHost }} + DB_DATABASE_NAME: {{ $dbName }} + DB_PORT: "5432" + REDIS_HOSTNAME: {{ $redisHost }} + REDIS_PASSWORD: {{ $redisPass }} + REDIS_PORT: "6379" + REDIS_DBINDEX: "0" + + {{- if .Values.immichConfig.enableTypesense }} + typesense-creds: + enabled: true + data: + TYPESENSE_API_KEY: {{ $typesenseKey }} + TYPESENSE_DATA_DIR: /typesense-data + {{- end }} + +configmap: + server-config: + enabled: true + data: + LOG_LEVEL: log + NODE_ENV: production + SERVER_PORT: {{ .Values.immichNetwork.serverPort | quote }} + + micro-config: + enabled: true + data: + LOG_LEVEL: log + NODE_ENV: production + MICROSERVICES_PORT: {{ .Values.immichNetwork.microservicesPort | quote }} + DISABLE_REVERSE_GEOCODING: {{ .Values.immichConfig.disableReverseGeocoding | quote }} + {{- if not .Values.immichConfig.disableReverseGeocoding }} + REVERSE_GEOCODING_PRECISION: {{ .Values.immichConfig.reverseGeocodingPrecision | quote }} + {{- end }} + REVERSE_GEOCODING_DUMP_DIRECTORY: /microcache + + web-config: + enabled: true + data: + NODE_ENV: production + PORT: {{ .Values.immichNetwork.webPort | quote }} + IMMICH_SERVER_URL: {{ printf "http://%v-server:%v" $fullname .Values.immichNetwork.serverPort }} + PUBLIC_IMMICH_SERVER_URL: {{ printf "http://%v-server:%v" $fullname .Values.immichNetwork.serverPort }} + {{- with .Values.immichConfig.publicLoginMessage }} + PUBLIC_LOGIN_PAGE_MESSAGE: {{ . | quote }} + {{- end }} + + proxy-config: + enabled: true + data: + IMMICH_WEB_URL: {{ printf "http://%v-web:%v" $fullname .Values.immichNetwork.webPort }} + IMMICH_SERVER_URL: {{ printf "http://%v-server:%v" $fullname .Values.immichNetwork.serverPort }} + + {{- if .Values.immichConfig.enableML }} + ml-config: + enabled: true + data: + NODE_ENV: production + MACHINE_LEARNING_PORT: {{ .Values.immichNetwork.machinelearningPort | quote }} + MACHINE_LEARNING_CACHE_FOLDER: /mlcache + TRANSFORMERS_CACHE: /mlcache + {{- end }} +{{- end -}} diff --git a/library/ix-dev/community/immich/templates/_immich-machinelearning.tpl b/library/ix-dev/community/immich/templates/_immich-machinelearning.tpl new file mode 100644 index 0000000000..1f6479b9be --- /dev/null +++ b/library/ix-dev/community/immich/templates/_immich-machinelearning.tpl @@ -0,0 +1,41 @@ +{{- define "immich.machinelearning.workload" -}} +{{- $fullname := (include "ix.v1.common.lib.chart.names.fullname" $) -}} +{{- $url := printf "http://%v-server:%v/server-info/ping" $fullname .Values.immichNetwork.serverPort }} +workload: + machinelearning: + enabled: true + type: Deployment + podSpec: + hostNetwork: false + containers: + machinelearning: + enabled: true + primary: true + imageSelector: mlImage + securityContext: + runAsUser: 0 + runAsGroup: 0 + runAsNonRoot: false + readOnlyRootFilesystem: false + envFrom: + - configMapRef: + name: ml-config + probes: + liveness: + enabled: true + type: http + port: {{ .Values.immichNetwork.machinelearningPort }} + path: /ping + readiness: + enabled: true + type: http + port: {{ .Values.immichNetwork.machinelearningPort }} + path: /ping + startup: + enabled: true + type: http + port: {{ .Values.immichNetwork.machinelearningPort }} + path: /ping + initContainers: + {{- include "immich.wait.init" (dict "url" $url) | indent 8 }} +{{- end -}} diff --git a/library/ix-dev/community/immich/templates/_immich-microservices.tpl b/library/ix-dev/community/immich/templates/_immich-microservices.tpl new file mode 100644 index 0000000000..9eb88034b7 --- /dev/null +++ b/library/ix-dev/community/immich/templates/_immich-microservices.tpl @@ -0,0 +1,57 @@ +{{- define "immich.microservices.workload" -}} +{{- $fullname := (include "ix.v1.common.lib.chart.names.fullname" $) -}} +{{- $url := printf "http://%v-server:%v/server-info/ping" $fullname .Values.immichNetwork.serverPort }} +workload: + microservices: + enabled: true + type: Deployment + podSpec: + hostNetwork: false + containers: + microservices: + enabled: true + primary: true + imageSelector: image + securityContext: + runAsUser: 0 + runAsGroup: 0 + runAsNonRoot: false + readOnlyRootFilesystem: false + args: start-microservices.sh + envFrom: + - secretRef: + name: immich-creds + - configMapRef: + name: micro-config + probes: + liveness: + enabled: true + type: exec + command: + - /bin/sh + - -c + - | + ps -a | grep -v grep | grep -q microservices + readiness: + enabled: true + type: exec + command: + - /bin/sh + - -c + - | + ps -a | grep -v grep | grep -q microservices + startup: + enabled: true + type: exec + command: + - /bin/sh + - -c + - | + ps -a | grep -v grep | grep -q microservices + initContainers: + {{- include "ix.v1.common.app.postgresWait" (dict "name" "postgres-wait" + "secretName" "postgres-creds") | nindent 8 }} + {{- include "ix.v1.common.app.redisWait" (dict "name" "redis-wait" + "secretName" "redis-creds") | nindent 8 }} + {{- include "immich.wait.init" (dict "url" $url) | indent 8 }} +{{- end -}} diff --git a/library/ix-dev/community/immich/templates/_immich-proxy.tpl b/library/ix-dev/community/immich/templates/_immich-proxy.tpl new file mode 100644 index 0000000000..95feed8cd7 --- /dev/null +++ b/library/ix-dev/community/immich/templates/_immich-proxy.tpl @@ -0,0 +1,48 @@ +{{- define "immich.proxy.workload" -}} +{{- $fullname := (include "ix.v1.common.lib.chart.names.fullname" $) -}} +{{- $serverUrl := printf "http://%v-server:%v/server-info/ping" $fullname .Values.immichNetwork.serverPort -}} +{{- $webUrl := printf "http://%v-web:%v/robots.txt" $fullname .Values.immichNetwork.webPort }} +workload: + proxy: + enabled: true + type: Deployment + podSpec: + hostNetwork: false + containers: + proxy: + enabled: true + primary: true + imageSelector: proxyImage + securityContext: + runAsUser: 0 + runAsGroup: 0 + runAsNonRoot: false + readOnlyRootFilesystem: false + capabilities: + add: + - CHOWN + - SETUID + - SETGID + envFrom: + - configMapRef: + name: proxy-config + probes: + liveness: + enabled: true + type: http + path: /api/server-info/ping + port: 8080 + readiness: + enabled: true + type: http + path: /api/server-info/ping + port: 8080 + startup: + enabled: true + type: http + path: /api/server-info/ping + port: 8080 + initContainers: + {{- include "immich.wait.init" (dict "url" $serverUrl) | indent 8 }} + {{- include "immich.wait.init" (dict "url" $webUrl) | indent 8 }} +{{- end -}} diff --git a/library/ix-dev/community/immich/templates/_immich-server.tpl b/library/ix-dev/community/immich/templates/_immich-server.tpl new file mode 100644 index 0000000000..41c1377ed8 --- /dev/null +++ b/library/ix-dev/community/immich/templates/_immich-server.tpl @@ -0,0 +1,51 @@ +{{- define "immich.server.workload" -}} +{{- $fullname := (include "ix.v1.common.lib.chart.names.fullname" $) -}} +{{- $typesenseUrl := printf "http://%v-typesense:%v/health" $fullname .Values.immichNetwork.typesensePort }} +workload: + server: + enabled: true + primary: true + type: Deployment + podSpec: + hostNetwork: false + containers: + server: + enabled: true + primary: true + imageSelector: image + securityContext: + runAsUser: 0 + runAsGroup: 0 + runAsNonRoot: false + readOnlyRootFilesystem: false + args: start-server.sh + envFrom: + - secretRef: + name: immich-creds + - configMapRef: + name: server-config + probes: + liveness: + enabled: true + type: http + path: /server-info/ping + port: {{ .Values.immichNetwork.serverPort }} + readiness: + enabled: true + type: http + path: /server-info/ping + port: {{ .Values.immichNetwork.serverPort }} + startup: + enabled: true + type: http + path: /server-info/ping + port: {{ .Values.immichNetwork.serverPort }} + initContainers: + {{- include "ix.v1.common.app.postgresWait" (dict "name" "postgres-wait" + "secretName" "postgres-creds") | nindent 8 }} + {{- include "ix.v1.common.app.redisWait" (dict "name" "redis-wait" + "secretName" "redis-creds") | nindent 8 }} + {{- if .Values.immichConfig.enableTypesense }} + {{- include "immich.wait.init" (dict "url" $typesenseUrl) | indent 8 }} + {{- end }} +{{- end -}} diff --git a/library/ix-dev/community/immich/templates/_immich-typesense.tpl b/library/ix-dev/community/immich/templates/_immich-typesense.tpl new file mode 100644 index 0000000000..53dd8958a4 --- /dev/null +++ b/library/ix-dev/community/immich/templates/_immich-typesense.tpl @@ -0,0 +1,42 @@ +{{- define "immich.typesense.workload" -}} +{{- $fullname := (include "ix.v1.common.lib.chart.names.fullname" $) -}} +{{- $url := printf "http://%v-server:%v/server-info/ping" $fullname .Values.immichNetwork.serverPort }} +workload: + typesense: + enabled: true + type: Deployment + podSpec: + hostNetwork: false + containers: + typesense: + enabled: true + primary: true + imageSelector: typesenseImage + args: + - --api-port + - {{ .Values.immichNetwork.typesensePort | quote }} + securityContext: + runAsUser: 0 + runAsGroup: 0 + runAsNonRoot: false + readOnlyRootFilesystem: false + envFrom: + - secretRef: + name: typesense-creds + probes: + liveness: + enabled: true + type: http + path: /health + port: {{ .Values.immichNetwork.typesensePort }} + readiness: + enabled: true + type: http + path: /health + port: {{ .Values.immichNetwork.typesensePort }} + startup: + enabled: true + type: http + path: /health + port: {{ .Values.immichNetwork.typesensePort }} +{{- end -}} diff --git a/library/ix-dev/community/immich/templates/_immich-web.tpl b/library/ix-dev/community/immich/templates/_immich-web.tpl new file mode 100644 index 0000000000..a932895c32 --- /dev/null +++ b/library/ix-dev/community/immich/templates/_immich-web.tpl @@ -0,0 +1,45 @@ +{{- define "immich.web.workload" -}} +{{- $fullname := (include "ix.v1.common.lib.chart.names.fullname" $) -}} +{{- $url := printf "http://%v-server:%v/server-info/ping" $fullname .Values.immichNetwork.serverPort }} +workload: + web: + enabled: true + type: Deployment + podSpec: + hostNetwork: false + containers: + web: + enabled: true + primary: true + imageSelector: webImage + securityContext: + runAsUser: 0 + runAsGroup: 0 + runAsNonRoot: false + readOnlyRootFilesystem: false + capabilities: + add: + - SETUID + - SETGID + envFrom: + - configMapRef: + name: web-config + probes: + liveness: + enabled: true + type: http + path: /robots.txt + port: {{ .Values.immichNetwork.webPort }} + readiness: + enabled: true + type: http + path: /robots.txt + port: {{ .Values.immichNetwork.webPort }} + startup: + enabled: true + type: http + path: /robots.txt + port: {{ .Values.immichNetwork.webPort }} + initContainers: + {{- include "immich.wait.init" (dict "url" $url) | indent 8 }} +{{- end -}} diff --git a/library/ix-dev/community/immich/templates/_persistence.tpl b/library/ix-dev/community/immich/templates/_persistence.tpl new file mode 100644 index 0000000000..e9c2bff8df --- /dev/null +++ b/library/ix-dev/community/immich/templates/_persistence.tpl @@ -0,0 +1,137 @@ +{{- define "immich.persistence" -}} +persistence: + {{/* Data */}} + library: + enabled: true + type: {{ .Values.immichStorage.library.type }} + datasetName: {{ .Values.immichStorage.library.datasetName | default "" }} + hostPath: {{ .Values.immichStorage.library.hostPath | default "" }} + targetSelector: + server: + server: + mountPath: /usr/src/app/upload/library + microservices: + microservices: + mountPath: /usr/src/app/upload/library + uploads: + enabled: true + type: {{ .Values.immichStorage.uploads.type }} + datasetName: {{ .Values.immichStorage.uploads.datasetName | default "" }} + hostPath: {{ .Values.immichStorage.uploads.hostPath | default "" }} + targetSelector: + server: + server: + mountPath: /usr/src/app/upload/upload + microservices: + microservices: + mountPath: /usr/src/app/upload/upload + thumbs: + enabled: true + type: {{ .Values.immichStorage.thumbs.type }} + datasetName: {{ .Values.immichStorage.thumbs.datasetName | default "" }} + hostPath: {{ .Values.immichStorage.thumbs.hostPath | default "" }} + targetSelector: + server: + server: + mountPath: /usr/src/app/upload/thumbs + microservices: + microservices: + mountPath: /usr/src/app/upload/thumbs + profile: + enabled: true + type: {{ .Values.immichStorage.profile.type }} + datasetName: {{ .Values.immichStorage.profile.datasetName | default "" }} + hostPath: {{ .Values.immichStorage.profile.hostPath | default "" }} + targetSelector: + server: + server: + mountPath: /usr/src/app/upload/profile + microservices: + microservices: + mountPath: /usr/src/app/upload/profile + video: + enabled: true + type: {{ .Values.immichStorage.video.type }} + datasetName: {{ .Values.immichStorage.video.datasetName | default "" }} + hostPath: {{ .Values.immichStorage.video.hostPath | default "" }} + targetSelector: + server: + server: + mountPath: /usr/src/app/upload/encoded-video + microservices: + microservices: + mountPath: /usr/src/app/upload/encoded-video + + {{/* Caches */}} + microcache: + enabled: true + type: emptyDir + targetSelector: + microservices: + microservices: + mountPath: /microcache + {{- if .Values.immichConfig.enableTypesense }} + typsense: + enabled: true + type: emptyDir + targetSelector: + typesense: + typesense: + mountPath: /typesense-data + {{- end -}} + {{- if .Values.immichConfig.enableML }} + mlcache: + enabled: true + type: emptyDir + targetSelector: + machinelearning: + machinelearning: + mountPath: /mlcache + {{- end }} + redis: + enabled: true + type: emptyDir + targetSelector: + redis: + redis: + mountPath: /bitnami/redis/data + tmp: + enabled: true + type: emptyDir + targetSelector: + redis: + redis: + mountPath: /tmp + + {{/* Database */}} + postgresdata: + enabled: true + type: {{ .Values.immichStorage.pgData.type }} + datasetName: {{ .Values.immichStorage.pgData.datasetName | default "" }} + hostPath: {{ .Values.immichStorage.pgData.hostPath | default "" }} + targetSelector: + # Postgres pod + postgres: + # Postgres container + postgres: + mountPath: /var/lib/postgresql/data + # Postgres - Permissions container + # Different than the 01-permissions + permissions: + mountPath: /mnt/directories/postgres_data + postgresbackup: + enabled: true + type: {{ .Values.immichStorage.pgBackup.type }} + datasetName: {{ .Values.immichStorage.pgBackup.datasetName | default "" }} + hostPath: {{ .Values.immichStorage.pgBackup.hostPath | default "" }} + targetSelector: + # Postgres backup pod + postgresbackup: + # Postgres backup container + postgresbackup: + mountPath: /postgres_backup + # Postgres - Permissions container + # Different than the 01-permissions + permissions: + mountPath: /mnt/directories/postgres_backup +{{- end -}} diff --git a/library/ix-dev/community/immich/templates/_portal.tpl b/library/ix-dev/community/immich/templates/_portal.tpl new file mode 100644 index 0000000000..acc267a33e --- /dev/null +++ b/library/ix-dev/community/immich/templates/_portal.tpl @@ -0,0 +1,12 @@ +{{- define "immich.portal" -}} +--- +apiVersion: v1 +kind: ConfigMap +metadata: + name: portal +data: + path: / + port: {{ .Values.immichNetwork.webuiPort | quote }} + protocol: http + host: $node_ip +{{- end -}} diff --git a/library/ix-dev/community/immich/templates/_postgres.tpl b/library/ix-dev/community/immich/templates/_postgres.tpl new file mode 100644 index 0000000000..0e7ac05894 --- /dev/null +++ b/library/ix-dev/community/immich/templates/_postgres.tpl @@ -0,0 +1,7 @@ +{{- define "postgres.workload" -}} +workload: +{{- include "ix.v1.common.app.postgres" (dict "secretName" "postgres-creds" + "resources" .Values.resources + "ixChartContext" .Values.ixChartContext) | nindent 2 }} + +{{- end -}} diff --git a/library/ix-dev/community/immich/templates/_redis.tpl b/library/ix-dev/community/immich/templates/_redis.tpl new file mode 100644 index 0000000000..c90b61b2be --- /dev/null +++ b/library/ix-dev/community/immich/templates/_redis.tpl @@ -0,0 +1,6 @@ +{{- define "redis.workload" -}} +workload: +{{- include "ix.v1.common.app.redis" (dict "secretName" "redis-creds" + "resources" .Values.resources) | nindent 2 }} + +{{- end -}} diff --git a/library/ix-dev/community/immich/templates/_service.tpl b/library/ix-dev/community/immich/templates/_service.tpl new file mode 100644 index 0000000000..5c8333143f --- /dev/null +++ b/library/ix-dev/community/immich/templates/_service.tpl @@ -0,0 +1,105 @@ +{{- define "immich.service" -}} +service: + proxy: + enabled: true + primary: true + type: NodePort + targetSelector: proxy + ports: + proxy: + enabled: true + primary: true + port: {{ .Values.immichNetwork.webuiPort }} + nodePort: {{ .Values.immichNetwork.webuiPort }} + protocol: http + targetPort: 8080 + targetSelector: proxy + + server: + enabled: true + type: ClusterIP + targetSelector: server + ports: + server: + enabled: true + primary: true + port: {{ .Values.immichNetwork.serverPort }} + protocol: http + targetSelector: server + + web: + enabled: true + type: ClusterIP + targetSelector: web + ports: + web: + enabled: true + primary: true + port: {{ .Values.immichNetwork.webPort }} + protocol: http + targetSelector: web + + microservices: + enabled: true + type: ClusterIP + targetSelector: microservices + ports: + microservices: + enabled: true + primary: true + port: {{ .Values.immichNetwork.microservicesPort }} + protocol: http + targetSelector: microservices + + {{- if .Values.immichConfig.enableML }} + machinelearning: + enabled: true + type: ClusterIP + targetSelector: machinelearning + ports: + machinelearning: + enabled: true + primary: true + port: {{ .Values.immichNetwork.machinelearningPort }} + protocol: http + targetSelector: machinelearning + {{- end -}} + + {{- if .Values.immichConfig.enableTypesense }} + typesense: + enabled: true + type: ClusterIP + targetSelector: typesense + ports: + typesense: + enabled: true + primary: true + port: {{ .Values.immichNetwork.typesensePort }} + protocol: http + targetSelector: typesense + {{- end }} + + redis: + enabled: true + type: ClusterIP + targetSelector: redis + ports: + redis: + enabled: true + primary: true + port: 6379 + targetPort: 6379 + targetSelector: redis + + postgres: + enabled: true + type: ClusterIP + targetSelector: postgres + ports: + postgres: + enabled: true + primary: true + port: 5432 + targetPort: 5432 + targetSelector: postgres +{{- end -}} diff --git a/library/ix-dev/community/immich/templates/_waitURL.tpl b/library/ix-dev/community/immich/templates/_waitURL.tpl new file mode 100644 index 0000000000..7c109c0000 --- /dev/null +++ b/library/ix-dev/community/immich/templates/_waitURL.tpl @@ -0,0 +1,17 @@ +{{- define "immich.wait.init" -}} +{{- $url := .url }} +wait-url: + enabled: true + type: init + imageSelector: bashImage + command: + - /bin/ash + - -c + - | + echo "Pinging [{{ $url }}] until it is ready..." + until wget --spider --quiet "{{ $url }}"; do + echo "Waiting for [{{ $url }}] to be ready..." + sleep 2 + done + echo "URL [{{ $url }}] is ready!" +{{- end -}} diff --git a/library/ix-dev/community/immich/templates/common.yaml b/library/ix-dev/community/immich/templates/common.yaml new file mode 100644 index 0000000000..3a4b911709 --- /dev/null +++ b/library/ix-dev/community/immich/templates/common.yaml @@ -0,0 +1,23 @@ +{{- include "ix.v1.common.loader.init" . -}} + +{{/* Merge the templates with Values */}} +{{- $_ := mustMergeOverwrite .Values (include "immich.configuration" $ | fromYaml) -}} +{{- $_ := mustMergeOverwrite .Values (include "immich.server.workload" $ | fromYaml) -}} +{{- $_ := mustMergeOverwrite .Values (include "immich.microservices.workload" $ | fromYaml) -}} +{{- if .Values.immichConfig.enableML -}} + {{- $_ := mustMergeOverwrite .Values (include "immich.machinelearning.workload" $ | fromYaml) -}} +{{- end -}} +{{- $_ := mustMergeOverwrite .Values (include "immich.web.workload" $ | fromYaml) -}} +{{- $_ := mustMergeOverwrite .Values (include "immich.proxy.workload" $ | fromYaml) -}} +{{- if .Values.immichConfig.enableTypesense -}} + {{- $_ := mustMergeOverwrite .Values (include "immich.typesense.workload" $ | fromYaml) -}} +{{- end -}} +{{- $_ := mustMergeOverwrite .Values (include "immich.persistence" $ | fromYaml) -}} +{{- $_ := mustMergeOverwrite .Values (include "immich.service" $ | fromYaml) -}} +{{- $_ := mustMergeOverwrite .Values (include "postgres.workload" $ | fromYaml) -}} +{{- $_ := mustMergeOverwrite .Values (include "redis.workload" $ | fromYaml) -}} + +{{/* Create the configmap for portal manually*/}} +{{- include "immich.portal" $ -}} + +{{- include "ix.v1.common.loader.apply" . -}} diff --git a/library/ix-dev/community/immich/upgrade_info.json b/library/ix-dev/community/immich/upgrade_info.json new file mode 100644 index 0000000000..dc39e91f41 --- /dev/null +++ b/library/ix-dev/community/immich/upgrade_info.json @@ -0,0 +1,4 @@ +{ + "filename": "values.yaml", + "keys": ["image", "webImage", "proxyImage", "mlImage", "typesenseImage"] +} diff --git a/library/ix-dev/community/immich/upgrade_strategy b/library/ix-dev/community/immich/upgrade_strategy new file mode 100755 index 0000000000..17637327d7 --- /dev/null +++ b/library/ix-dev/community/immich/upgrade_strategy @@ -0,0 +1,58 @@ +#!/usr/bin/python3 +import json +import re +import sys + +from catalog_update.upgrade_strategy import semantic_versioning + + +RE_STABLE_VERSION_BASE = r'\d+\.\d+\.\d+' +ENUMS = { + 'typesenseImage': { + 'RE_STABLE_VERSION': re.compile(RE_STABLE_VERSION_BASE), + 'STRIP_TEXT': '' + }, + 'default': { + 'RE_STABLE_VERSION': re.compile(rf'v{RE_STABLE_VERSION_BASE}'), + 'STRIP_TEXT': 'v' + } +} + + +def newer_mapping(image_tags): + + output = { + "tags": {}, + "app_version": "" + } + + for key in image_tags.keys(): + STRIP_TEXT = ENUMS[key].get('STRIP_TEXT', None) \ + if key in ENUMS else ENUMS.get('default', None).get('STRIP_TEXT', None) + RE_STABLE_VERSION = ENUMS[key].get('RE_STABLE_VERSION') \ + if key in ENUMS else ENUMS.get('default', None).get('RE_STABLE_VERSION', None) + + if (STRIP_TEXT is None) or (RE_STABLE_VERSION is None): + continue + + tags = {t.strip(STRIP_TEXT): t for t in image_tags[key] if RE_STABLE_VERSION.fullmatch(t)} + version = semantic_versioning(list(tags)) + + if not version: + continue + + if key == 'image': + output['app_version'] = version + + output['tags'][key] = tags[version] + + return output + + +if __name__ == '__main__': + try: + versions_json = json.loads(sys.stdin.read()) + except ValueError: + raise ValueError('Invalid json specified') + + print(json.dumps(newer_mapping(versions_json))) diff --git a/library/ix-dev/community/immich/values.yaml b/library/ix-dev/community/immich/values.yaml new file mode 100644 index 0000000000..4787fa1058 --- /dev/null +++ b/library/ix-dev/community/immich/values.yaml @@ -0,0 +1,70 @@ +image: + repository: altran1502/immich-server + pullPolicy: IfNotPresent + tag: v1.66.1 + +webImage: + repository: altran1502/immich-web + pullPolicy: IfNotPresent + tag: v1.66.1 + +proxyImage: + repository: altran1502/immich-proxy + pullPolicy: IfNotPresent + tag: v1.66.1 + +mlImage: + repository: altran1502/immich-machine-learning + pullPolicy: IfNotPresent + tag: v1.66.1 + +typesenseImage: + repository: typesense/typesense + pullPolicy: IfNotPresent + tag: 0.24.1 + +resources: + limits: + cpu: 4000m + memory: 8Gi + +immichConfig: + disableReverseGeocoding: false + reverseGeocodingPrecision: 3 + publicLoginMessage: '' + enableML: true + enableTypesense: true + +immichNetwork: + webuiPort: 30041 + # Not user configurable, will be hidden on UI + # Putting it here in case it needs to be configurable + # in the future. + serverPort: 32000 + webPort: 32001 + machinelearningPort: 32002 + microservicesPort: 32003 + typesensePort: 32004 + +immichStorage: + uploads: + type: ixVolume + datasetName: uploads + library: + type: ixVolume + datasetName: library + thumbs: + type: ixVolume + datasetName: thumbs + profile: + type: ixVolume + datasetName: profile + video: + type: ixVolume + datasetName: video + pgData: + type: ixVolume + datasetName: pgData + pgBackup: + type: ixVolume + datasetName: pgBackup