diff --git a/apps/immich/base/ingress.yaml b/apps/immich/base/ingress.yaml new file mode 100644 index 0000000..57cd519 --- /dev/null +++ b/apps/immich/base/ingress.yaml @@ -0,0 +1,15 @@ +apiVersion: traefik.io/v1alpha1 +kind: IngressRoute +metadata: + name: immich + namespace: immich +spec: + entryPoints: + - websecure-local + tls: {} + routes: + - match: Host(`embyk.steffenillium.de`) + kind: Rule + services: + - name: immich-server + port: http diff --git a/apps/immich/base/kustomization.yaml b/apps/immich/base/kustomization.yaml new file mode 100644 index 0000000..f4cda5b --- /dev/null +++ b/apps/immich/base/kustomization.yaml @@ -0,0 +1,6 @@ +apiVersion: kustomize.config.k8s.io/v1beta1 +kind: Kustomization +resources: +- ingress.yaml +- pvc.yaml +- service.yaml diff --git a/apps/immich/base/pvc.yaml b/apps/immich/base/pvc.yaml new file mode 100644 index 0000000..ee2ba4e --- /dev/null +++ b/apps/immich/base/pvc.yaml @@ -0,0 +1,27 @@ +apiVersion: v1 +kind: PersistentVolumeClaim +metadata: + labels: + app: pgdata + name: pgdata +spec: + storageClassName: rook-cephfs + accessModes: + - ReadWriteMany + resources: + requests: + storage: 10Gi +--- +apiVersion: v1 +kind: PersistentVolumeClaim +metadata: + labels: + app: model-cache + name: model-cache +spec: + storageClassName: rook-cephfs + accessModes: + - ReadWriteMany + resources: + requests: + storage: 5Gi \ No newline at end of file diff --git a/apps/immich/base/service.yaml b/apps/immich/base/service.yaml new file mode 100644 index 0000000..7f3b8e5 --- /dev/null +++ b/apps/immich/base/service.yaml @@ -0,0 +1,13 @@ +apiVersion: v1 +kind: Service +metadata: + labels: + app: immich-server + name: immich-server +spec: + ports: + - name: "http" + port: 2283 + targetPort: 3001 + selector: + app: immich-server diff --git a/apps/immich/deployment/database.yaml b/apps/immich/deployment/database.yaml new file mode 100644 index 0000000..77beb9c --- /dev/null +++ b/apps/immich/deployment/database.yaml @@ -0,0 +1,33 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + labels: + app: database + name: database +spec: + replicas: 1 + selector: + matchLabels: + app: database + strategy: + type: Recreate + template: + metadata: + labels: + app: database + spec: + containers: + - image: registry.hub.docker.com/tensorchord/pgvecto-rs:pg14-v0.2.0@sha256:90724186f0a3517cf6914295b5ab410db9ce23190a2d9d0b9dd6463e3fa298f0 + name: immich-postgres + envFrom: + - secretRef: + name: immich-secret + resources: {} + volumeMounts: + - mountPath: /var/lib/postgresql/data + name: pgdata + restartPolicy: Always + volumes: + - name: pgdata + persistentVolumeClaim: + claimName: pgdata \ No newline at end of file diff --git a/apps/immich/deployment/kustomization.yaml b/apps/immich/deployment/kustomization.yaml new file mode 100644 index 0000000..256a77e --- /dev/null +++ b/apps/immich/deployment/kustomization.yaml @@ -0,0 +1,8 @@ +apiVersion: kustomize.config.k8s.io/v1beta1 +kind: Kustomization +resources: +- database.yaml +- machine-learning.yaml +- microservices.yaml +- redis.yaml +- server.yaml diff --git a/apps/immich/deployment/machine-learning.yaml b/apps/immich/deployment/machine-learning.yaml new file mode 100644 index 0000000..3809a03 --- /dev/null +++ b/apps/immich/deployment/machine-learning.yaml @@ -0,0 +1,30 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + labels: + app: immich-machine-learning + name: immich-machine-learning +spec: + replicas: 1 + selector: + matchLabels: + app: immich-machine-learning + strategy: + type: Recreate + template: + metadata: + labels: + app: immich-machine-learning + spec: + containers: + - image: ghcr.io/immich-app/immich-machine-learning:release + name: immich-machine-learning + resources: {} + volumeMounts: + - mountPath: /cache + name: model-cache + restartPolicy: Always + volumes: + - name: model-cache + persistentVolumeClaim: + claimName: model-cache \ No newline at end of file diff --git a/apps/immich/deployment/microservices.yaml b/apps/immich/deployment/microservices.yaml new file mode 100644 index 0000000..a4d9687 --- /dev/null +++ b/apps/immich/deployment/microservices.yaml @@ -0,0 +1,40 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + labels: + app: immich-microservices + name: immich-microservices +spec: + replicas: 1 + selector: + matchLabels: + app: immich-microservices + strategy: + type: Recreate + template: + metadata: + labels: + app: immich-microservices + spec: + containers: + - args: + - start.sh + - microservices + envFrom: + - secretRef: + name: immich-secret + image: ghcr.io/immich-app/immich-server:release + name: immich-microservices + resources: {} + volumeMounts: + - mountPath: /usr/src/app/upload + name: photos + subPath: upload + - mountPath: /usr/src/app/external + name: photos + restartPolicy: Always + volumes: + - name: photos + nfs: + server: 192.168.178.4 + path: /mnt/photos \ No newline at end of file diff --git a/apps/immich/deployment/redis.yaml b/apps/immich/deployment/redis.yaml new file mode 100644 index 0000000..7797a32 --- /dev/null +++ b/apps/immich/deployment/redis.yaml @@ -0,0 +1,22 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + labels: + app: redis + name: redis +spec: + replicas: 1 + selector: + matchLabels: + app: redis + strategy: {} + template: + metadata: + labels: + app: redis + spec: + containers: + - image: registry.hub.docker.com/library/redis:6.2-alpine@sha256:84882e87b54734154586e5f8abd4dce69fe7311315e2fc6d67c29614c8de2672 + name: immich-redis + resources: {} + restartPolicy: Always \ No newline at end of file diff --git a/apps/immich/deployment/server.yaml b/apps/immich/deployment/server.yaml new file mode 100644 index 0000000..982e393 --- /dev/null +++ b/apps/immich/deployment/server.yaml @@ -0,0 +1,46 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + labels: + app: immich-server + name: immich-server +spec: + replicas: 1 + selector: + matchLabels: + app: immich-server + strategy: + type: Recreate + template: + metadata: + labels: + app: immich-server + spec: + containers: + - args: + - start.sh + - immich + envFrom: + - secretRef: + name: immich-secret + image: ghcr.io/immich-app/immich-server:release + name: immich-server + ports: + - name: http + containerPort: 3001 + hostPort: 2283 + protocol: TCP + resources: {} + volumeMounts: + - mountPath: /usr/src/app/upload + name: photos + subPath: upload + - mountPath: /usr/src/app/external + name: photos + restartPolicy: Always + volumes: + - name: photos + nfs: + server: 192.168.178.4 + path: /mnt/photos + readOnly: true \ No newline at end of file diff --git a/apps/immich/kustomization.yaml b/apps/immich/kustomization.yaml new file mode 100644 index 0000000..f303ef6 --- /dev/null +++ b/apps/immich/kustomization.yaml @@ -0,0 +1,8 @@ +apiVersion: kustomize.config.k8s.io/v1beta1 +kind: Kustomization + +namespace: immich + +resources: +- base +- deployment