diff --git a/apps/templates/immich-pvc.yaml b/apps/templates/immich-pvc.yaml new file mode 100644 index 0000000..291568a --- /dev/null +++ b/apps/templates/immich-pvc.yaml @@ -0,0 +1,13 @@ +apiVersion: v1 +kind: PersistentVolumeClaim +metadata: + labels: + io.kompose.service: immich-claim + name: immich-claim + namespace: immich +spec: + accessModes: + - ReadWriteOnce + resources: + requests: + storage: 400Gi diff --git a/apps/templates/restore-backup-folder.yaml b/apps/templates/restore-backup-folder.yaml index 852d8d8..ffd5080 100644 --- a/apps/templates/restore-backup-folder.yaml +++ b/apps/templates/restore-backup-folder.yaml @@ -1,19 +1,19 @@ -apiVersion: argoproj.io/v1alpha1 -kind: Application -metadata: - name: restore-backup-app - namespace: argocd - finalizers: - - resources-finalizer.argocd.argoproj.io -spec: - project: default - source: - repoURL: https://github.com/rubenhensen/k8scd.git - targetRevision: HEAD - path: restore-backup - destination: - server: https://kubernetes.default.svc - namespace: immich # Change too namespace where the volume is! - syncPolicy: - syncOptions: - - CreateNamespace=true \ No newline at end of file +# apiVersion: argoproj.io/v1alpha1 +# kind: Application +# metadata: +# name: restore-backup-app +# namespace: argocd +# finalizers: +# - resources-finalizer.argocd.argoproj.io +# spec: +# project: default +# source: +# repoURL: https://github.com/rubenhensen/k8scd.git +# targetRevision: HEAD +# path: restore-backup +# destination: +# server: https://kubernetes.default.svc +# namespace: immich # Change too namespace where the volume is! +# syncPolicy: +# syncOptions: +# - CreateNamespace=true \ No newline at end of file diff --git a/argocd/kustomization.yaml b/argocd/kustomization.yaml index 2ae2404..ea7c5a2 100644 --- a/argocd/kustomization.yaml +++ b/argocd/kustomization.yaml @@ -16,4 +16,4 @@ patches: kind: ReplicaSet name: argocd-notifications-controller path: overlays/argocd-notifications-controller-patch.yaml - - path: overlays/argocd-cm.patch.yaml \ No newline at end of file + # - path: overlays/argocd-cm.patch.yaml \ No newline at end of file diff --git a/immich/helm-immich.yaml b/immich/helm-immich.yaml index b95212e..28f0c6f 100644 --- a/immich/helm-immich.yaml +++ b/immich/helm-immich.yaml @@ -1,233 +1,132 @@ -# apiVersion: argoproj.io/v1alpha1 -# kind: Application -# metadata: -# name: helm-immich -# namespace: argocd -# finalizers: -# - resources-finalizer.argocd.argoproj.io -# spec: -# syncPolicy: -# syncOptions: -# - CreateNamespace=true -# automated: -# prune: true -# selfHeal: true -# project: default -# sources: -# - chart: immich -# repoURL: https://immich-app.github.io/immich-charts -# targetRevision: 0.8.5 # Chart version! https://argo-cd.readthedocs.io/en/latest/user-guide/application-specification/ -# helm: -# values: | -# env: -# REDIS_HOSTNAME: '{{ printf "%s-redis-master" .Release.Name }}' -# DB_HOSTNAME: "{{ .Release.Name }}-postgresql" -# DB_USERNAME: "{{ .Values.postgresql.global.postgresql.auth.username }}" -# DB_DATABASE_NAME: "{{ .Values.postgresql.global.postgresql.auth.database }}" -# # -- You should provide your own secret outside of this helm-chart and use `postgresql.global.postgresql.auth.existingSecret` to provide credentials to the postgresql instance -# DB_PASSWORD: "{{ .Values.postgresql.global.postgresql.auth.password }}" -# IMMICH_MACHINE_LEARNING_URL: '{{ printf "http://%s-machine-learning:3003" .Release.Name }}' +apiVersion: argoproj.io/v1alpha1 +kind: Application +metadata: + name: helm-immich + namespace: argocd + finalizers: + - resources-finalizer.argocd.argoproj.io +spec: + syncPolicy: + syncOptions: + - CreateNamespace=true + automated: + prune: true + selfHeal: true + project: default + sources: + - chart: immich + repoURL: https://immich-app.github.io/immich-charts + targetRevision: 0.8.5 # Chart version! https://argo-cd.readthedocs.io/en/latest/user-guide/application-specification/ + helm: + values: | + env: + REDIS_HOSTNAME: '{{ printf "%s-redis-master" .Release.Name }}' + DB_HOSTNAME: "{{ .Release.Name }}-postgresql" + DB_USERNAME: "{{ .Values.postgresql.global.postgresql.auth.username }}" + DB_DATABASE_NAME: "{{ .Values.postgresql.global.postgresql.auth.database }}" + # -- You should provide your own secret outside of this helm-chart and use `postgresql.global.postgresql.auth.existingSecret` to provide credentials to the postgresql instance + DB_PASSWORD: "{{ .Values.postgresql.global.postgresql.auth.password }}" + IMMICH_MACHINE_LEARNING_URL: '{{ printf "http://%s-machine-learning:3003" .Release.Name }}' -# image: -# tag: v1.119.0 + image: + tag: v1.119.0 + startupProbe: {} -# immich: -# metrics: -# # Enabling this will create the service monitors needed to monitor immich with the prometheus operator -# enabled: false -# persistence: -# # Main data store for all photos shared between different components. -# library: -# # Automatically creating the library volume is not supported by this chart -# # You have to specify an existing PVC to use -# existingClaim: immich-claim - -# # configuration is immich-config.json converted to yaml -# # ref: https://immich.app/docs/install/config-file/ -# # -# configuration: {} -# # trash: -# # enabled: false -# # days: 30 -# # storageTemplate: -# # enabled: true -# # template: "{{y}}/{{y}}-{{MM}}-{{dd}}/{{filename}}" + immich: + metrics: + # Enabling this will create the service monitors needed to monitor immich with the prometheus operator + enabled: false + persistence: + # Main data store for all photos shared between different components. + library: + # Automatically creating the library volume is not supported by this chart + # You have to specify an existing PVC to use + existingClaim: immich-claim + probes: + startup: + enabled: false + + # configuration is immich-config.json converted to yaml + # ref: https://immich.app/docs/install/config-file/ + # + configuration: {} + # trash: + # enabled: false + # days: 30 + # storageTemplate: + # enabled: true + # template: "{{y}}/{{y}}-{{MM}}-{{dd}}/{{filename}}" -# # Dependencies + # Dependencies -# postgresql: -# enabled: true -# image: -# repository: tensorchord/pgvecto-rs -# tag: pg14-v0.2.0 -# global: -# postgresql: -# auth: -# username: immich -# database: immich -# password: immich -# primary: -# containerSecurityContext: -# readOnlyRootFilesystem: false -# initdb: -# scripts: -# create-extensions.sql: | -# CREATE EXTENSION cube; -# CREATE EXTENSION earthdistance; -# CREATE EXTENSION vectors; + postgresql: + enabled: true + image: + repository: tensorchord/pgvecto-rs + tag: pg14-v0.2.0 + global: + postgresql: + auth: + username: immich + database: immich + password: immich + primary: + containerSecurityContext: + readOnlyRootFilesystem: false + initdb: + scripts: + create-extensions.sql: | + CREATE EXTENSION cube; + CREATE EXTENSION earthdistance; + CREATE EXTENSION vectors; -# redis: -# enabled: true -# architecture: standalone -# auth: -# enabled: false + redis: + enabled: true + architecture: standalone + auth: + enabled: false -# # Immich components + # Immich components -# server: -# enabled: true -# image: -# repository: ghcr.io/immich-app/immich-server -# pullPolicy: IfNotPresent -# ingress: -# main: -# enabled: true -# ingressClassName: nginx -# annotations: -# # proxy-body-size is set to 0 to remove the body limit on file uploads -# nginx.ingress.kubernetes.io/proxy-body-size: "0" -# cert-manager.io/cluster-issuer: prod-cluster-issuer -# nginx.ingress.kubernetes.io/backend-protocol: "HTTP" -# hosts: -# - host: immich.hensen.io -# paths: -# - path: "/" -# tls: -# - secretName: letsencrypt-prod -# hosts: -# - immich.hensen.io + server: + enabled: true + image: + repository: ghcr.io/immich-app/immich-server + pullPolicy: IfNotPresent + ingress: + main: + enabled: true + ingressClassName: nginx + annotations: + # proxy-body-size is set to 0 to remove the body limit on file uploads + nginx.ingress.kubernetes.io/proxy-body-size: "0" + cert-manager.io/cluster-issuer: prod-cluster-issuer + nginx.ingress.kubernetes.io/backend-protocol: "HTTP" + hosts: + - host: immich.hensen.io + paths: + - path: "/" + tls: + - secretName: letsencrypt-prod + hosts: + - immich.hensen.io -# machine-learning: -# enabled: true -# image: -# repository: ghcr.io/immich-app/immich-machine-learning -# pullPolicy: IfNotPresent -# env: -# TRANSFORMERS_CACHE: /cache -# persistence: -# cache: -# enabled: true -# size: 10Gi -# # Optional: Set this to pvc to avoid downloading the ML models every start. -# type: emptyDir -# accessMode: ReadWriteMany -# # storageClass: your-class -# destination: -# server: https://kubernetes.default.svc -# namespace: immich - -# env: -# REDIS_HOSTNAME: '{{ printf "%s-redis-master" .Release.Name }}' -# DB_HOSTNAME: "{{ .Release.Name }}-postgresql" -# DB_USERNAME: "{{ .Values.postgresql.global.postgresql.auth.username }}" -# DB_DATABASE_NAME: "{{ .Values.postgresql.global.postgresql.auth.database }}" -# # -- You should provide your own secret outside of this helm-chart and use `postgresql.global.postgresql.auth.existingSecret` to provide credentials to the postgresql instance -# DB_PASSWORD: "{{ .Values.postgresql.global.postgresql.auth.password }}" -# IMMICH_MACHINE_LEARNING_URL: '{{ printf "http://%s-machine-learning:3003" .Release.Name }}' - -# image: -# tag: v1.119.0 - -# immich: -# metrics: -# # Enabling this will create the service monitors needed to monitor immich with the prometheus operator -# enabled: false -# persistence: -# # Main data store for all photos shared between different components. -# library: -# # Automatically creating the library volume is not supported by this chart -# # You have to specify an existing PVC to use -# existingClaim: immich-claim - -# # configuration is immich-config.json converted to yaml -# # ref: https://immich.app/docs/install/config-file/ -# # -# configuration: {} -# # trash: -# # enabled: false -# # days: 30 -# # storageTemplate: -# # enabled: true -# # template: "{{y}}/{{y}}-{{MM}}-{{dd}}/{{filename}}" - -# # Dependencies - -# postgresql: -# enabled: true -# image: -# repository: tensorchord/pgvecto-rs -# tag: pg14-v0.2.0 -# global: -# postgresql: -# auth: -# username: immich -# database: immich -# password: immich -# primary: -# containerSecurityContext: -# readOnlyRootFilesystem: false -# initdb: -# scripts: -# create-extensions.sql: | -# CREATE EXTENSION cube; -# CREATE EXTENSION earthdistance; -# CREATE EXTENSION vectors; - -# redis: -# enabled: true -# architecture: standalone -# auth: -# enabled: false - -# # Immich components - -# server: -# enabled: true -# image: -# repository: ghcr.io/immich-app/immich-server -# pullPolicy: IfNotPresent -# ingress: -# main: -# enabled: true -# ingressClassName: nginx -# annotations: -# # proxy-body-size is set to 0 to remove the body limit on file uploads -# nginx.ingress.kubernetes.io/proxy-body-size: "0" -# cert-manager.io/cluster-issuer: prod-cluster-issuer -# nginx.ingress.kubernetes.io/backend-protocol: "HTTP" -# hosts: -# - host: immich.hensen.io -# paths: -# - path: "/" -# tls: -# - secretName: letsencrypt-prod -# hosts: -# - immich.hensen.io - - -# machine-learning: -# enabled: true -# image: -# repository: ghcr.io/immich-app/immich-machine-learning -# pullPolicy: IfNotPresent -# env: -# TRANSFORMERS_CACHE: /cache -# persistence: -# cache: -# enabled: true -# size: 10Gi -# # Optional: Set this to pvc to avoid downloading the ML models every start. -# type: emptyDir -# accessMode: ReadWriteMany -# # storageClass: your-class \ No newline at end of file + machine-learning: + enabled: true + image: + repository: ghcr.io/immich-app/immich-machine-learning + pullPolicy: IfNotPresent + env: + TRANSFORMERS_CACHE: /cache + persistence: + cache: + enabled: true + size: 10Gi + # Optional: Set this to pvc to avoid downloading the ML models every start. + type: emptyDir + accessMode: ReadWriteMany + # storageClass: your-class + destination: + server: https://kubernetes.default.svc + namespace: immich \ No newline at end of file diff --git a/immich/immich-pvc.yaml b/immich/immich-pvc.yaml deleted file mode 100644 index 069a0de..0000000 --- a/immich/immich-pvc.yaml +++ /dev/null @@ -1,12 +0,0 @@ -# apiVersion: v1 -# kind: PersistentVolumeClaim -# metadata: -# labels: -# io.kompose.service: immich-claim -# name: immich-claim -# spec: -# accessModes: -# - ReadWriteOnce -# resources: -# requests: -# storage: 400Gi diff --git a/immich/immich.yaml b/immich/immich.yaml deleted file mode 100644 index 1ebe0ee..0000000 --- a/immich/immich.yaml +++ /dev/null @@ -1,1057 +0,0 @@ ---- -# Source: immich/charts/postgresql/templates/primary/networkpolicy.yaml -kind: NetworkPolicy -apiVersion: networking.k8s.io/v1 -metadata: - name: immich-postgresql - namespace: immich - labels: - app.kubernetes.io/instance: immich - app.kubernetes.io/managed-by: Helm - app.kubernetes.io/name: postgresql - app.kubernetes.io/version: 17.0.0 - helm.sh/chart: postgresql-16.0.0 - app.kubernetes.io/component: primary -spec: - podSelector: - matchLabels: - app.kubernetes.io/instance: immich - app.kubernetes.io/name: postgresql - app.kubernetes.io/component: primary - policyTypes: - - Ingress - - Egress - egress: - - {} - ingress: - - ports: - - port: 5432 ---- -# Source: immich/charts/redis/templates/networkpolicy.yaml -kind: NetworkPolicy -apiVersion: networking.k8s.io/v1 -metadata: - name: immich-redis - namespace: immich - labels: - app.kubernetes.io/instance: immich - app.kubernetes.io/managed-by: Helm - app.kubernetes.io/name: redis - app.kubernetes.io/version: 7.2.5 - helm.sh/chart: redis-19.5.3 -spec: - podSelector: - matchLabels: - app.kubernetes.io/instance: immich - app.kubernetes.io/name: redis - policyTypes: - - Ingress - - Egress - egress: - - {} - ingress: - # Allow inbound connections - - ports: - - port: 6379 ---- -# Source: immich/charts/postgresql/templates/primary/pdb.yaml -apiVersion: policy/v1 -kind: PodDisruptionBudget -metadata: - name: immich-postgresql - namespace: immich - labels: - app.kubernetes.io/instance: immich - app.kubernetes.io/managed-by: Helm - app.kubernetes.io/name: postgresql - app.kubernetes.io/version: 17.0.0 - helm.sh/chart: postgresql-16.0.0 - app.kubernetes.io/component: primary -spec: - maxUnavailable: 1 - selector: - matchLabels: - app.kubernetes.io/instance: immich - app.kubernetes.io/name: postgresql - app.kubernetes.io/component: primary ---- -# Source: immich/charts/redis/templates/master/pdb.yaml -apiVersion: policy/v1 -kind: PodDisruptionBudget -metadata: - name: immich-redis-master - namespace: immich - labels: - app.kubernetes.io/instance: immich - app.kubernetes.io/managed-by: Helm - app.kubernetes.io/name: redis - app.kubernetes.io/version: 7.2.5 - helm.sh/chart: redis-19.5.3 - app.kubernetes.io/component: master -spec: - maxUnavailable: 1 - selector: - matchLabels: - app.kubernetes.io/instance: immich - app.kubernetes.io/name: redis - app.kubernetes.io/component: master ---- -# Source: immich/charts/postgresql/templates/serviceaccount.yaml -apiVersion: v1 -kind: ServiceAccount -metadata: - name: immich-postgresql - namespace: immich - labels: - app.kubernetes.io/instance: immich - app.kubernetes.io/managed-by: Helm - app.kubernetes.io/name: postgresql - app.kubernetes.io/version: 17.0.0 - helm.sh/chart: postgresql-16.0.0 -automountServiceAccountToken: false ---- -# Source: immich/charts/redis/templates/master/serviceaccount.yaml -apiVersion: v1 -kind: ServiceAccount -automountServiceAccountToken: false -metadata: - name: immich-redis-master - namespace: immich - labels: - app.kubernetes.io/instance: immich - app.kubernetes.io/managed-by: Helm - app.kubernetes.io/name: redis - app.kubernetes.io/version: 7.2.5 - helm.sh/chart: redis-19.5.3 ---- -# Source: immich/charts/postgresql/templates/secrets.yaml -apiVersion: v1 -kind: Secret -metadata: - name: immich-postgresql - namespace: immich - labels: - app.kubernetes.io/instance: immich - app.kubernetes.io/managed-by: Helm - app.kubernetes.io/name: postgresql - app.kubernetes.io/version: 17.0.0 - helm.sh/chart: postgresql-16.0.0 -type: Opaque -data: - postgres-password: "WW9wY1hvWTNjUw==" - password: "aW1taWNo" - # We don't auto-generate LDAP password when it's not provided as we do for other passwords ---- -# Source: immich/charts/postgresql/templates/primary/initialization-configmap.yaml -apiVersion: v1 -kind: ConfigMap -metadata: - name: immich-postgresql-init-scripts - namespace: immich - labels: - app.kubernetes.io/instance: immich - app.kubernetes.io/managed-by: Helm - app.kubernetes.io/name: postgresql - app.kubernetes.io/version: 17.0.0 - helm.sh/chart: postgresql-16.0.0 -data: - create-extensions.sql: | - CREATE EXTENSION cube; - CREATE EXTENSION earthdistance; - CREATE EXTENSION vectors; ---- -# Source: immich/charts/redis/templates/configmap.yaml -apiVersion: v1 -kind: ConfigMap -metadata: - name: immich-redis-configuration - namespace: immich - labels: - app.kubernetes.io/instance: immich - app.kubernetes.io/managed-by: Helm - app.kubernetes.io/name: redis - app.kubernetes.io/version: 7.2.5 - helm.sh/chart: redis-19.5.3 -data: - redis.conf: |- - # User-supplied common configuration: - # Enable AOF https://redis.io/topics/persistence#append-only-file - appendonly yes - # Disable RDB persistence, AOF persistence already enabled. - save "" - # End of common configuration - master.conf: |- - dir /data - # User-supplied master configuration: - rename-command FLUSHDB "" - rename-command FLUSHALL "" - # End of master configuration - replica.conf: |- - dir /data - # User-supplied replica configuration: - rename-command FLUSHDB "" - rename-command FLUSHALL "" - # End of replica configuration ---- -# Source: immich/charts/redis/templates/health-configmap.yaml -apiVersion: v1 -kind: ConfigMap -metadata: - name: immich-redis-health - namespace: immich - labels: - app.kubernetes.io/instance: immich - app.kubernetes.io/managed-by: Helm - app.kubernetes.io/name: redis - app.kubernetes.io/version: 7.2.5 - helm.sh/chart: redis-19.5.3 -data: - ping_readiness_local.sh: |- - #!/bin/bash - - [[ -f $REDIS_PASSWORD_FILE ]] && export REDIS_PASSWORD="$(< "${REDIS_PASSWORD_FILE}")" - [[ -n "$REDIS_PASSWORD" ]] && export REDISCLI_AUTH="$REDIS_PASSWORD" - response=$( - timeout -s 15 $1 \ - redis-cli \ - -h localhost \ - -p $REDIS_PORT \ - ping - ) - if [ "$?" -eq "124" ]; then - echo "Timed out" - exit 1 - fi - if [ "$response" != "PONG" ]; then - echo "$response" - exit 1 - fi - ping_liveness_local.sh: |- - #!/bin/bash - - [[ -f $REDIS_PASSWORD_FILE ]] && export REDIS_PASSWORD="$(< "${REDIS_PASSWORD_FILE}")" - [[ -n "$REDIS_PASSWORD" ]] && export REDISCLI_AUTH="$REDIS_PASSWORD" - response=$( - timeout -s 15 $1 \ - redis-cli \ - -h localhost \ - -p $REDIS_PORT \ - ping - ) - if [ "$?" -eq "124" ]; then - echo "Timed out" - exit 1 - fi - responseFirstWord=$(echo $response | head -n1 | awk '{print $1;}') - if [ "$response" != "PONG" ] && [ "$responseFirstWord" != "LOADING" ] && [ "$responseFirstWord" != "MASTERDOWN" ]; then - echo "$response" - exit 1 - fi - ping_readiness_master.sh: |- - #!/bin/bash - - [[ -f $REDIS_MASTER_PASSWORD_FILE ]] && export REDIS_MASTER_PASSWORD="$(< "${REDIS_MASTER_PASSWORD_FILE}")" - [[ -n "$REDIS_MASTER_PASSWORD" ]] && export REDISCLI_AUTH="$REDIS_MASTER_PASSWORD" - response=$( - timeout -s 15 $1 \ - redis-cli \ - -h $REDIS_MASTER_HOST \ - -p $REDIS_MASTER_PORT_NUMBER \ - ping - ) - if [ "$?" -eq "124" ]; then - echo "Timed out" - exit 1 - fi - if [ "$response" != "PONG" ]; then - echo "$response" - exit 1 - fi - ping_liveness_master.sh: |- - #!/bin/bash - - [[ -f $REDIS_MASTER_PASSWORD_FILE ]] && export REDIS_MASTER_PASSWORD="$(< "${REDIS_MASTER_PASSWORD_FILE}")" - [[ -n "$REDIS_MASTER_PASSWORD" ]] && export REDISCLI_AUTH="$REDIS_MASTER_PASSWORD" - response=$( - timeout -s 15 $1 \ - redis-cli \ - -h $REDIS_MASTER_HOST \ - -p $REDIS_MASTER_PORT_NUMBER \ - ping - ) - if [ "$?" -eq "124" ]; then - echo "Timed out" - exit 1 - fi - responseFirstWord=$(echo $response | head -n1 | awk '{print $1;}') - if [ "$response" != "PONG" ] && [ "$responseFirstWord" != "LOADING" ]; then - echo "$response" - exit 1 - fi - ping_readiness_local_and_master.sh: |- - script_dir="$(dirname "$0")" - exit_status=0 - "$script_dir/ping_readiness_local.sh" $1 || exit_status=$? - "$script_dir/ping_readiness_master.sh" $1 || exit_status=$? - exit $exit_status - ping_liveness_local_and_master.sh: |- - script_dir="$(dirname "$0")" - exit_status=0 - "$script_dir/ping_liveness_local.sh" $1 || exit_status=$? - "$script_dir/ping_liveness_master.sh" $1 || exit_status=$? - exit $exit_status ---- -# Source: immich/charts/redis/templates/scripts-configmap.yaml -apiVersion: v1 -kind: ConfigMap -metadata: - name: immich-redis-scripts - namespace: immich - labels: - app.kubernetes.io/instance: immich - app.kubernetes.io/managed-by: Helm - app.kubernetes.io/name: redis - app.kubernetes.io/version: 7.2.5 - helm.sh/chart: redis-19.5.3 -data: - start-master.sh: | - #!/bin/bash - - [[ -f $REDIS_PASSWORD_FILE ]] && export REDIS_PASSWORD="$(< "${REDIS_PASSWORD_FILE}")" - if [[ -f /opt/bitnami/redis/mounted-etc/master.conf ]];then - cp /opt/bitnami/redis/mounted-etc/master.conf /opt/bitnami/redis/etc/master.conf - fi - if [[ -f /opt/bitnami/redis/mounted-etc/redis.conf ]];then - cp /opt/bitnami/redis/mounted-etc/redis.conf /opt/bitnami/redis/etc/redis.conf - fi - ARGS=("--port" "${REDIS_PORT}") - ARGS+=("--protected-mode" "no") - ARGS+=("--include" "/opt/bitnami/redis/etc/redis.conf") - ARGS+=("--include" "/opt/bitnami/redis/etc/master.conf") - exec redis-server "${ARGS[@]}" ---- -# Source: immich/charts/postgresql/templates/primary/svc-headless.yaml -apiVersion: v1 -kind: Service -metadata: - name: immich-postgresql-hl - namespace: immich - labels: - app.kubernetes.io/instance: immich - app.kubernetes.io/managed-by: Helm - app.kubernetes.io/name: postgresql - app.kubernetes.io/version: 17.0.0 - helm.sh/chart: postgresql-16.0.0 - app.kubernetes.io/component: primary - annotations: -spec: - type: ClusterIP - clusterIP: None - # We want all pods in the StatefulSet to have their addresses published for - # the sake of the other Postgresql pods even before they're ready, since they - # have to be able to talk to each other in order to become ready. - publishNotReadyAddresses: true - ports: - - name: tcp-postgresql - port: 5432 - targetPort: tcp-postgresql - selector: - app.kubernetes.io/instance: immich - app.kubernetes.io/name: postgresql - app.kubernetes.io/component: primary ---- -# Source: immich/charts/postgresql/templates/primary/svc.yaml -apiVersion: v1 -kind: Service -metadata: - name: immich-postgresql - namespace: immich - labels: - app.kubernetes.io/instance: immich - app.kubernetes.io/managed-by: Helm - app.kubernetes.io/name: postgresql - app.kubernetes.io/version: 17.0.0 - helm.sh/chart: postgresql-16.0.0 - app.kubernetes.io/component: primary -spec: - type: ClusterIP - sessionAffinity: None - ports: - - name: tcp-postgresql - port: 5432 - targetPort: tcp-postgresql - nodePort: null - selector: - app.kubernetes.io/instance: immich - app.kubernetes.io/name: postgresql - app.kubernetes.io/component: primary ---- -# Source: immich/charts/redis/templates/headless-svc.yaml -apiVersion: v1 -kind: Service -metadata: - name: immich-redis-headless - namespace: immich - labels: - app.kubernetes.io/instance: immich - app.kubernetes.io/managed-by: Helm - app.kubernetes.io/name: redis - app.kubernetes.io/version: 7.2.5 - helm.sh/chart: redis-19.5.3 -spec: - type: ClusterIP - clusterIP: None - ports: - - name: tcp-redis - port: 6379 - targetPort: redis - selector: - app.kubernetes.io/instance: immich - app.kubernetes.io/name: redis ---- -# Source: immich/charts/redis/templates/master/service.yaml -apiVersion: v1 -kind: Service -metadata: - name: immich-redis-master - namespace: immich - labels: - app.kubernetes.io/instance: immich - app.kubernetes.io/managed-by: Helm - app.kubernetes.io/name: redis - app.kubernetes.io/version: 7.2.5 - helm.sh/chart: redis-19.5.3 - app.kubernetes.io/component: master -spec: - type: ClusterIP - internalTrafficPolicy: Cluster - sessionAffinity: None - ports: - - name: tcp-redis - port: 6379 - targetPort: redis - nodePort: null - selector: - app.kubernetes.io/instance: immich - app.kubernetes.io/name: redis - app.kubernetes.io/component: master ---- -# Source: immich/templates/machine-learning.yaml -apiVersion: v1 -kind: Service -metadata: - name: immich-machine-learning - labels: - app.kubernetes.io/service: immich-machine-learning - app.kubernetes.io/instance: immich - app.kubernetes.io/managed-by: Helm - app.kubernetes.io/name: machine-learning - app.kubernetes.io/version: v1.119.0 - helm.sh/chart: immich-0.8.5 - annotations: -spec: - type: ClusterIP - ports: - - port: 3003 - targetPort: http - protocol: TCP - name: http - selector: - app.kubernetes.io/instance: immich - app.kubernetes.io/name: machine-learning ---- -# Source: immich/templates/server.yaml -apiVersion: v1 -kind: Service -metadata: - name: immich-server - labels: - app.kubernetes.io/service: immich-server - app.kubernetes.io/instance: immich - app.kubernetes.io/managed-by: Helm - app.kubernetes.io/name: server - app.kubernetes.io/version: v1.119.0 - helm.sh/chart: immich-0.8.5 - annotations: -spec: - type: ClusterIP - ports: - - port: 2283 - targetPort: http - protocol: TCP - name: http - selector: - app.kubernetes.io/instance: immich - app.kubernetes.io/name: server ---- -# Source: immich/templates/machine-learning.yaml -apiVersion: apps/v1 -kind: Deployment -metadata: - name: immich-machine-learning - labels: - app.kubernetes.io/instance: immich - app.kubernetes.io/managed-by: Helm - app.kubernetes.io/name: machine-learning - app.kubernetes.io/version: v1.119.0 - helm.sh/chart: immich-0.8.5 -spec: - revisionHistoryLimit: 3 - replicas: 1 - strategy: - type: Recreate - selector: - matchLabels: - app.kubernetes.io/name: machine-learning - app.kubernetes.io/instance: immich - template: - metadata: - labels: - app.kubernetes.io/name: machine-learning - app.kubernetes.io/instance: immich - spec: - - serviceAccountName: default - automountServiceAccountToken: true - dnsPolicy: ClusterFirst - enableServiceLinks: true - containers: - - name: immich-machine-learning - image: ghcr.io/immich-app/immich-machine-learning:v1.119.0 - imagePullPolicy: IfNotPresent - env: - - name: DB_DATABASE_NAME - value: immich - - name: DB_HOSTNAME - value: immich-postgresql - - name: DB_PASSWORD - value: immich - - name: DB_USERNAME - value: immich - - name: IMMICH_MACHINE_LEARNING_URL - value: http://immich-machine-learning:3003 - - name: REDIS_HOSTNAME - value: immich-redis-master - - name: TRANSFORMERS_CACHE - value: /cache - ports: - - name: http - containerPort: 3003 - protocol: TCP - volumeMounts: - - name: cache - mountPath: /cache - livenessProbe: - failureThreshold: 3 - httpGet: - path: /ping - port: http - initialDelaySeconds: 0 - periodSeconds: 10 - timeoutSeconds: 1 - readinessProbe: - failureThreshold: 3 - httpGet: - path: /ping - port: http - initialDelaySeconds: 0 - periodSeconds: 10 - timeoutSeconds: 1 - startupProbe: - failureThreshold: 60 - httpGet: - path: /ping - port: http - initialDelaySeconds: 0 - periodSeconds: 10 - timeoutSeconds: 1 - volumes: - - name: cache - emptyDir: - {} ---- -# Source: immich/templates/server.yaml -apiVersion: apps/v1 -kind: Deployment -metadata: - name: immich-server - labels: - app.kubernetes.io/instance: immich - app.kubernetes.io/managed-by: Helm - app.kubernetes.io/name: server - app.kubernetes.io/version: v1.119.0 - helm.sh/chart: immich-0.8.5 -spec: - revisionHistoryLimit: 3 - replicas: 1 - strategy: - type: Recreate - selector: - matchLabels: - app.kubernetes.io/name: server - app.kubernetes.io/instance: immich - template: - metadata: - labels: - app.kubernetes.io/name: server - app.kubernetes.io/instance: immich - spec: - - serviceAccountName: default - automountServiceAccountToken: true - dnsPolicy: ClusterFirst - enableServiceLinks: true - containers: - - name: immich-server - image: ghcr.io/immich-app/immich-server:v1.119.0 - imagePullPolicy: IfNotPresent - env: - - name: DB_DATABASE_NAME - value: immich - - name: DB_HOSTNAME - value: immich-postgresql - - name: DB_PASSWORD - value: immich - - name: DB_USERNAME - value: immich - - name: IMMICH_MACHINE_LEARNING_URL - value: http://immich-machine-learning:3003 - - name: REDIS_HOSTNAME - value: immich-redis-master - ports: - - name: http - containerPort: 2283 - protocol: TCP - volumeMounts: - - name: library - mountPath: /usr/src/app/upload - livenessProbe: - failureThreshold: 3 - httpGet: - path: /api/server/ping - port: http - initialDelaySeconds: 0 - periodSeconds: 10 - timeoutSeconds: 1 - readinessProbe: - failureThreshold: 3 - httpGet: - path: /api/server/ping - port: http - initialDelaySeconds: 0 - periodSeconds: 10 - timeoutSeconds: 1 - startupProbe: - failureThreshold: 100 - httpGet: - path: /api/server/ping - port: http - initialDelaySeconds: 120 - periodSeconds: 10 - timeoutSeconds: 1 - volumes: - - name: library - persistentVolumeClaim: - claimName: immich-claim ---- -# Source: immich/charts/postgresql/templates/primary/statefulset.yaml -apiVersion: apps/v1 -kind: StatefulSet -metadata: - name: immich-postgresql - namespace: immich - labels: - app.kubernetes.io/instance: immich - app.kubernetes.io/managed-by: Helm - app.kubernetes.io/name: postgresql - app.kubernetes.io/version: 17.0.0 - helm.sh/chart: postgresql-16.0.0 - app.kubernetes.io/component: primary -spec: - replicas: 1 - serviceName: immich-postgresql-hl - updateStrategy: - rollingUpdate: {} - type: RollingUpdate - selector: - matchLabels: - app.kubernetes.io/instance: immich - app.kubernetes.io/name: postgresql - app.kubernetes.io/component: primary - template: - metadata: - name: immich-postgresql - labels: - app.kubernetes.io/instance: immich - app.kubernetes.io/managed-by: Helm - app.kubernetes.io/name: postgresql - app.kubernetes.io/version: 17.0.0 - helm.sh/chart: postgresql-16.0.0 - app.kubernetes.io/component: primary - spec: - serviceAccountName: immich-postgresql - - automountServiceAccountToken: false - affinity: - podAffinity: - - podAntiAffinity: - preferredDuringSchedulingIgnoredDuringExecution: - - podAffinityTerm: - labelSelector: - matchLabels: - app.kubernetes.io/instance: immich - app.kubernetes.io/name: postgresql - app.kubernetes.io/component: primary - topologyKey: kubernetes.io/hostname - weight: 1 - nodeAffinity: - - securityContext: - fsGroup: 1001 - fsGroupChangePolicy: Always - supplementalGroups: [] - sysctls: [] - hostNetwork: false - hostIPC: false - containers: - - name: postgresql - image: docker.io/tensorchord/pgvecto-rs:pg14-v0.2.0 - imagePullPolicy: "IfNotPresent" - securityContext: - allowPrivilegeEscalation: false - capabilities: - drop: - - ALL - privileged: false - readOnlyRootFilesystem: false - runAsGroup: 1001 - runAsNonRoot: true - runAsUser: 1001 - seLinuxOptions: {} - seccompProfile: - type: RuntimeDefault - env: - - name: BITNAMI_DEBUG - value: "false" - - name: POSTGRESQL_PORT_NUMBER - value: "5432" - - name: POSTGRESQL_VOLUME_DIR - value: "/bitnami/postgresql" - - name: PGDATA - value: "/bitnami/postgresql/data" - # Authentication - - name: POSTGRES_USER - value: "immich" - - name: POSTGRES_PASSWORD - valueFrom: - secretKeyRef: - name: immich-postgresql - key: password - - name: POSTGRES_POSTGRES_PASSWORD - valueFrom: - secretKeyRef: - name: immich-postgresql - key: postgres-password - - name: POSTGRES_DATABASE - value: "immich" - # LDAP - - name: POSTGRESQL_ENABLE_LDAP - value: "no" - # TLS - - name: POSTGRESQL_ENABLE_TLS - value: "no" - # Audit - - name: POSTGRESQL_LOG_HOSTNAME - value: "false" - - name: POSTGRESQL_LOG_CONNECTIONS - value: "false" - - name: POSTGRESQL_LOG_DISCONNECTIONS - value: "false" - - name: POSTGRESQL_PGAUDIT_LOG_CATALOG - value: "off" - # Others - - name: POSTGRESQL_CLIENT_MIN_MESSAGES - value: "error" - - name: POSTGRESQL_SHARED_PRELOAD_LIBRARIES - value: "pgaudit" - ports: - - name: tcp-postgresql - containerPort: 5432 - livenessProbe: - failureThreshold: 6 - initialDelaySeconds: 30 - periodSeconds: 10 - successThreshold: 1 - timeoutSeconds: 5 - exec: - command: - - /bin/sh - - -c - - exec pg_isready -U "immich" -d "dbname=immich" -h 127.0.0.1 -p 5432 - readinessProbe: - failureThreshold: 6 - initialDelaySeconds: 5 - periodSeconds: 10 - successThreshold: 1 - timeoutSeconds: 5 - exec: - command: - - /bin/sh - - -c - - -e - - | - exec pg_isready -U "immich" -d "dbname=immich" -h 127.0.0.1 -p 5432 - resources: - limits: - cpu: 150m - ephemeral-storage: 2Gi - memory: 192Mi - requests: - cpu: 100m - ephemeral-storage: 50Mi - memory: 128Mi - volumeMounts: - - name: empty-dir - mountPath: /tmp - subPath: tmp-dir - - name: empty-dir - mountPath: /opt/bitnami/postgresql/conf - subPath: app-conf-dir - - name: empty-dir - mountPath: /opt/bitnami/postgresql/tmp - subPath: app-tmp-dir - - name: custom-init-scripts - mountPath: /docker-entrypoint-initdb.d/ - - name: dshm - mountPath: /dev/shm - - name: data - mountPath: /bitnami/postgresql - volumes: - - name: empty-dir - emptyDir: {} - - name: custom-init-scripts - configMap: - name: immich-postgresql-init-scripts - - name: dshm - emptyDir: - medium: Memory - volumeClaimTemplates: - - apiVersion: v1 - kind: PersistentVolumeClaim - metadata: - name: data - spec: - accessModes: - - "ReadWriteOnce" - resources: - requests: - storage: "8Gi" ---- -# Source: immich/charts/redis/templates/master/application.yaml -apiVersion: apps/v1 -kind: StatefulSet -metadata: - name: immich-redis-master - namespace: immich - labels: - app.kubernetes.io/instance: immich - app.kubernetes.io/managed-by: Helm - app.kubernetes.io/name: redis - app.kubernetes.io/version: 7.2.5 - helm.sh/chart: redis-19.5.3 - app.kubernetes.io/component: master -spec: - replicas: 1 - selector: - matchLabels: - app.kubernetes.io/instance: immich - app.kubernetes.io/name: redis - app.kubernetes.io/component: master - serviceName: immich-redis-headless - updateStrategy: - type: RollingUpdate - template: - metadata: - labels: - app.kubernetes.io/instance: immich - app.kubernetes.io/managed-by: Helm - app.kubernetes.io/name: redis - app.kubernetes.io/version: 7.2.5 - helm.sh/chart: redis-19.5.3 - app.kubernetes.io/component: master - annotations: - checksum/configmap: 86bcc953bb473748a3d3dc60b7c11f34e60c93519234d4c37f42e22ada559d47 - checksum/health: aff24913d801436ea469d8d374b2ddb3ec4c43ee7ab24663d5f8ff1a1b6991a9 - checksum/scripts: 43cdf68c28f3abe25ce017a82f74dbf2437d1900fd69df51a55a3edf6193d141 - checksum/secret: 44136fa355b3678a1146ad16f7e8649e94fb4fc21fe77e8310c060f61caaff8a - spec: - - securityContext: - fsGroup: 1001 - fsGroupChangePolicy: Always - supplementalGroups: [] - sysctls: [] - serviceAccountName: immich-redis-master - automountServiceAccountToken: false - affinity: - podAffinity: - - podAntiAffinity: - preferredDuringSchedulingIgnoredDuringExecution: - - podAffinityTerm: - labelSelector: - matchLabels: - app.kubernetes.io/instance: immich - app.kubernetes.io/name: redis - app.kubernetes.io/component: master - topologyKey: kubernetes.io/hostname - weight: 1 - nodeAffinity: - - enableServiceLinks: true - terminationGracePeriodSeconds: 30 - containers: - - name: redis - image: docker.io/bitnami/redis:7.2.5-debian-12-r0 - imagePullPolicy: "IfNotPresent" - securityContext: - allowPrivilegeEscalation: false - capabilities: - drop: - - ALL - readOnlyRootFilesystem: true - runAsGroup: 1001 - runAsNonRoot: true - runAsUser: 1001 - seLinuxOptions: {} - seccompProfile: - type: RuntimeDefault - command: - - /bin/bash - args: - - -c - - /opt/bitnami/scripts/start-scripts/start-master.sh - env: - - name: BITNAMI_DEBUG - value: "false" - - name: REDIS_REPLICATION_MODE - value: master - - name: ALLOW_EMPTY_PASSWORD - value: "yes" - - name: REDIS_TLS_ENABLED - value: "no" - - name: REDIS_PORT - value: "6379" - ports: - - name: redis - containerPort: 6379 - livenessProbe: - initialDelaySeconds: 20 - periodSeconds: 5 - # One second longer than command timeout should prevent generation of zombie processes. - timeoutSeconds: 6 - successThreshold: 1 - failureThreshold: 5 - exec: - command: - - sh - - -c - - /health/ping_liveness_local.sh 5 - readinessProbe: - initialDelaySeconds: 20 - periodSeconds: 5 - timeoutSeconds: 2 - successThreshold: 1 - failureThreshold: 5 - exec: - command: - - sh - - -c - - /health/ping_readiness_local.sh 1 - resources: - limits: - cpu: 150m - ephemeral-storage: 2Gi - memory: 192Mi - requests: - cpu: 100m - ephemeral-storage: 50Mi - memory: 128Mi - volumeMounts: - - name: start-scripts - mountPath: /opt/bitnami/scripts/start-scripts - - name: health - mountPath: /health - - name: redis-data - mountPath: /data - - name: config - mountPath: /opt/bitnami/redis/mounted-etc - - name: empty-dir - mountPath: /opt/bitnami/redis/etc/ - subPath: app-conf-dir - - name: empty-dir - mountPath: /tmp - subPath: tmp-dir - volumes: - - name: start-scripts - configMap: - name: immich-redis-scripts - defaultMode: 0755 - - name: health - configMap: - name: immich-redis-health - defaultMode: 0755 - - name: config - configMap: - name: immich-redis-configuration - - name: empty-dir - emptyDir: {} - volumeClaimTemplates: - - apiVersion: v1 - kind: PersistentVolumeClaim - metadata: - name: redis-data - labels: - app.kubernetes.io/instance: immich - app.kubernetes.io/name: redis - app.kubernetes.io/component: master - spec: - accessModes: - - "ReadWriteOnce" - resources: - requests: - storage: "8Gi" ---- -# Source: immich/templates/server.yaml -apiVersion: networking.k8s.io/v1 -kind: Ingress -metadata: - name: immich-server - labels: - app.kubernetes.io/instance: immich - app.kubernetes.io/managed-by: Helm - app.kubernetes.io/name: server - app.kubernetes.io/version: v1.119.0 - helm.sh/chart: immich-0.8.5 - annotations: - cert-manager.io/cluster-issuer: prod-cluster-issuer - nginx.ingress.kubernetes.io/backend-protocol: HTTP - nginx.ingress.kubernetes.io/proxy-body-size: "0" -spec: - ingressClassName: nginx - tls: - - hosts: - - "immich.hensen.io" - secretName: "letsencrypt-prod" - rules: - - host: "immich.hensen.io" - http: - paths: - - path: "/" - pathType: Prefix - backend: - service: - name: immich-server - port: - number: 2283 diff --git a/restore-backup/README.md b/restore-backup/README.md new file mode 100644 index 0000000..09c4460 --- /dev/null +++ b/restore-backup/README.md @@ -0,0 +1 @@ +Example container to restore files. See `Obsidian > Cluster > Restore longhorn backup` for more \ No newline at end of file diff --git a/restore-backup/restore-pvc.yaml b/restore-backup/restore-pvc.yaml deleted file mode 100644 index 069a0de..0000000 --- a/restore-backup/restore-pvc.yaml +++ /dev/null @@ -1,12 +0,0 @@ -# apiVersion: v1 -# kind: PersistentVolumeClaim -# metadata: -# labels: -# io.kompose.service: immich-claim -# name: immich-claim -# spec: -# accessModes: -# - ReadWriteOnce -# resources: -# requests: -# storage: 400Gi