Files
homelab/k8s/apps/immich/deployments.yaml

175 lines
4.4 KiB
YAML

---
apiVersion: apps/v1
kind: Deployment
metadata:
name: immich-server
spec:
replicas: 1
selector:
matchLabels:
app: immich-server
template:
metadata:
labels:
app: immich-server
spec:
containers:
- name: immich-server
image: ghcr.io/immich-app/immich-server:release
imagePullPolicy: Always
ports:
- containerPort: 2283
env:
- name: UPLOAD_LOCATION
value: /usr/src/app/upload
- name: DB_URL
value: postgresql://postgres:postgres@immich-rw.immich:5432/immich
- name: REDIS_HOST
value: redis
- name: REDIS_PORT
value: "6379"
- name: TZ
value: Asia/Nicosia
volumeMounts:
- mountPath: /usr/src/app/upload
name: upload-storage
- mountPath: /GPHOTO
name: gphoto-storage
- mountPath: /etc/localtime
name: localtime
readOnly: true
affinity:
nodeAffinity:
preferredDuringSchedulingIgnoredDuringExecution:
- weight: 100
preference:
matchExpressions:
- key: kubernetes.io/hostname
operator: In
values:
- home.homenet
requiredDuringSchedulingIgnoredDuringExecution:
nodeSelectorTerms:
- matchExpressions:
- key: kubernetes.io/hostname
operator: In
values:
- home.homenet
- nas.homenet
volumes:
- name: upload-storage
nfs:
server: nas.homenet
path: /mnt/storage/Storage/k8s/immich/library/
readOnly: false
- name: gphoto-storage
nfs:
server: nas.homenet
path: /mnt/storage/Storage/k8s/immich/GPHOTO/
readOnly: false
- name: localtime
hostPath:
path: /etc/localtime
type: File
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: immich-machine-learning
spec:
replicas: 16
selector:
matchLabels:
app: immich-ml
template:
metadata:
labels:
app: immich-ml
spec:
affinity:
nodeAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
nodeSelectorTerms:
- matchExpressions:
- key: kubernetes.io/hostname
operator: In
values:
- home.homenet
- master.tail2fe2d.ts.net
- nas.homenet
preferredDuringSchedulingIgnoredDuringExecution:
- weight: 4
preference:
matchExpressions:
- key: kubernetes.io/hostname
operator: In
values:
- home.homenet
- weight: 4
preference:
matchExpressions:
- key: kubernetes.io/hostname
operator: In
values:
- master.tail2fe2d.ts.net
- weight: 1
preference:
matchExpressions:
- key: kubernetes.io/hostname
operator: In
values:
- nas.tail2fe2d.ts.net
topologySpreadConstraints:
- maxSkew: 2
topologyKey: kubernetes.io/hostname
whenUnsatisfiable: DoNotSchedule
labelSelector:
matchLabels:
app: immich-ml
containers:
- name: immich-ml
image: ghcr.io/immich-app/immich-machine-learning:release
imagePullPolicy: Always
env:
- name: TZ
value: Asia/Nicosia
- name: IMMICH_MACHINE_LEARNING_MODEL_FACE
value: buffalo_l
- name: IMMICH_MACHINE_LEARNING_MODEL_CLIP
value: ViT-L/14
- name: IMMICH_MACHINE_LEARNING_USE_GPU
value: "true"
volumeMounts:
- mountPath: /cache
name: model-cache
volumes:
- name: model-cache
emptyDir: {}
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: redis
spec:
replicas: 1
selector:
matchLabels:
app: redis
template:
metadata:
labels:
app: redis
spec:
containers:
- name: redis
image: redis:6.2-alpine
readinessProbe:
exec:
command: ["redis-cli", "ping"]
nodeSelector:
kubernetes.io/hostname: nas.homenet