diff --git a/apps/immich/README.md b/apps/immich/README.md new file mode 100644 index 0000000..5787be4 --- /dev/null +++ b/apps/immich/README.md @@ -0,0 +1 @@ +# Immich App diff --git a/apps/immich/config/example.env b/apps/immich/config/example.env new file mode 100644 index 0000000..c78df0d --- /dev/null +++ b/apps/immich/config/example.env @@ -0,0 +1,32 @@ +# Config +IMMICH_DOMAIN=immich.$DOMAIN +IMMICH_STORAGE=100Gi +IMMICH_CACHE_STORAGE=10Gi +TZ=UTC + +# Docker Images +IMMICH_SERVER_IMAGE=ghcr.io/immich-app/immich-server:release +IMMICH_ML_IMAGE=ghcr.io/immich-app/immich-machine-learning:release + +# Database Configuration +DB_HOSTNAME=postgres.postgres +DB_PORT=5432 +DB_USERNAME=immich +DB_DATABASE_NAME=immich +POSTGRES_ADMIN_USER=$POSTGRES_USER + +# Redis Configuration +REDIS_HOSTNAME=redis.redis +REDIS_PORT=6379 + +# Machine Learning Configuration +MACHINE_LEARNING_WORKERS=1 +MACHINE_LEARNING_MODEL_TTL=300 + +# Immich Configuration +IMMICH_ENV=production +IMMICH_LOG_LEVEL=info + +# Secrets (populate these in config.env and secrets.env) +DB_PASSWORD= +POSTGRES_ADMIN_PASSWORD=$POSTGRES_PASSWORD \ No newline at end of file diff --git a/apps/immich/deployment.yaml b/apps/immich/deployment.yaml new file mode 100644 index 0000000..0c7fbd1 --- /dev/null +++ b/apps/immich/deployment.yaml @@ -0,0 +1,138 @@ +--- +apiVersion: apps/v1 +kind: Deployment +metadata: + name: immich-server +spec: + replicas: 1 + selector: + matchLabels: + app: immich-server + strategy: + rollingUpdate: + maxSurge: 0 + maxUnavailable: 1 + type: RollingUpdate + template: + metadata: + labels: + app: immich-server + component: server + spec: + containers: + - image: ghcr.io/immich-app/immich-server:release + name: immich-server + ports: + - containerPort: 2283 + protocol: TCP + envFrom: + - secretRef: + name: secrets + - configMapRef: + name: config + env: + - name: REDIS_HOSTNAME + value: redis.redis + - name: DB_HOSTNAME + value: postgres.postgres + - name: TZ + valueFrom: + configMapKeyRef: + key: TZ + name: config + volumeMounts: + - mountPath: /usr/src/app/upload + name: immich-storage + readOnly: false + volumes: + - name: immich-storage + persistentVolumeClaim: + claimName: immich-pvc +--- +apiVersion: apps/v1 +kind: Deployment +metadata: + name: immich-microservices +spec: + replicas: 1 + selector: + matchLabels: + app: immich-microservices + strategy: + rollingUpdate: + maxSurge: 0 + maxUnavailable: 1 + type: RollingUpdate + template: + metadata: + labels: + app: immich-microservices + component: microservices + spec: + containers: + - image: ghcr.io/immich-app/immich-server:release + name: immich-microservices + envFrom: + - secretRef: + name: secrets + - configMapRef: + name: config + env: + - name: REDIS_HOSTNAME + value: redis.redis + - name: DB_HOSTNAME + value: postgres.postgres + - name: TZ + valueFrom: + configMapKeyRef: + key: TZ + name: config + - name: IMMICH_WORKERS_INCLUDE + value: api + volumeMounts: + - mountPath: /usr/src/app/upload + name: immich-storage + readOnly: false + volumes: + - name: immich-storage + persistentVolumeClaim: + claimName: immich-pvc +--- +apiVersion: apps/v1 +kind: Deployment +metadata: + name: immich-machine-learning +spec: + replicas: 1 + selector: + matchLabels: + app: immich-machine-learning + template: + metadata: + labels: + app: immich-machine-learning + component: machine-learning + spec: + containers: + - image: ghcr.io/immich-app/immich-machine-learning:release + name: immich-machine-learning + ports: + - containerPort: 3003 + protocol: TCP + envFrom: + - configMapRef: + name: config + env: + - name: TZ + valueFrom: + configMapKeyRef: + key: TZ + name: config + volumeMounts: + - mountPath: /cache + name: immich-cache + readOnly: false + volumes: + - name: immich-cache + persistentVolumeClaim: + claimName: immich-cache-pvc \ No newline at end of file diff --git a/apps/immich/ingress.yaml b/apps/immich/ingress.yaml new file mode 100644 index 0000000..c956c77 --- /dev/null +++ b/apps/immich/ingress.yaml @@ -0,0 +1,24 @@ +--- +apiVersion: networking.k8s.io/v1 +kind: Ingress +metadata: + name: immich-public + annotations: + external-dns.alpha.kubernetes.io/target: your.immich.domain + external-dns.alpha.kubernetes.io/cloudflare-proxied: "false" +spec: + rules: + - host: your.immich.domain + http: + paths: + - path: / + pathType: Prefix + backend: + service: + name: immich-server + port: + number: 3001 + tls: + - secretName: wildcard-internal-sovereign-cloud-tls + hosts: + - your.immich.domain \ No newline at end of file diff --git a/apps/immich/init/db-init-job.yaml b/apps/immich/init/db-init-job.yaml new file mode 100644 index 0000000..4ce3854 --- /dev/null +++ b/apps/immich/init/db-init-job.yaml @@ -0,0 +1,62 @@ +apiVersion: batch/v1 +kind: Job +metadata: + name: immich-db-init +spec: + template: + spec: + containers: + - name: db-init + image: postgres:15 + command: ["/bin/bash", "-c"] + args: + - | + PGPASSWORD=${POSTGRES_ADMIN_PASSWORD} psql -h ${DB_HOSTNAME} -U postgres <