Mercurial > code > home > repos > photoprism
diff deploy.yaml @ 1:9dc67ae8b507
update
author | drewp@bigasterisk.com |
---|---|
date | Sat, 14 Jan 2023 18:18:35 -0800 |
parents | 1e65c0f57ff6 |
children | 781290b4a683 |
line wrap: on
line diff
--- a/deploy.yaml Mon Dec 06 22:34:49 2021 -0800 +++ b/deploy.yaml Sat Jan 14 18:18:35 2023 -0800 @@ -1,4 +1,3 @@ ---- apiVersion: v1 kind: PersistentVolume metadata: @@ -6,11 +5,12 @@ labels: { type: local } spec: storageClassName: manual - hostPath: { path: "/opt/photoprism/storage" } + hostPath: { path: "/d4/photoprism" } capacity: { storage: 5Gi } accessModes: ["ReadWriteOnce"] persistentVolumeReclaimPolicy: Retain claimRef: { namespace: default, name: photoprism-storage } + --- apiVersion: v1 kind: PersistentVolume @@ -19,11 +19,12 @@ labels: { type: local } spec: storageClassName: manual - hostPath: { path: "/my/pic/phonecam" } + hostPath: { path: "/my/pic" } capacity: { storage: 5Gi } accessModes: ["ReadWriteOnce"] persistentVolumeReclaimPolicy: Retain claimRef: { namespace: default, name: photoprism-originals } + --- apiVersion: v1 kind: PersistentVolumeClaim @@ -33,6 +34,7 @@ volumeName: "photoprism-storage" accessModes: ["ReadWriteOnce"] resources: { requests: { storage: 5Gi } } + --- apiVersion: v1 kind: PersistentVolumeClaim @@ -42,6 +44,7 @@ volumeName: "photoprism-originals" accessModes: ["ReadWriteOnce"] resources: { requests: { storage: 5Gi } } + --- apiVersion: apps/v1 kind: Deployment @@ -56,28 +59,72 @@ metadata: labels: app: photoprism + annotations: + prometheus.io/scrape: "false" spec: volumes: - { name: photoprism-storage, persistentVolumeClaim: { claimName: photoprism-storage } } - { name: photoprism-originals, persistentVolumeClaim: { claimName: photoprism-originals } } + - { name: run-mysqld, emptyDir: {}} containers: - name: photoprism - image: photoprism/photoprism + # https://github.com/photoprism/photoprism/releases + image: docker.io/photoprism/photoprism:221118-jammy env: - { name: PHOTOPRISM_UPLOAD_NSFW, value: "true" } - { name: PHOTOPRISM_READONLY, value: "true" } - { name: PHOTOPRISM_LOG_LEVEL, value: "info" } - { name: PHOTOPRISM_SITE_URL, value: "https://bigasterisk.com/photoprism/" } + - { name: PHOTOPRISM_AUTH_MODE, value: "public" } + - { name: PHOTOPRISM_WORKERS, value: "4" } + + - { name: PHOTOPRISM_DISABLE_WEBDAV, value: "true" } + - { name: PHOTOPRISM_DISABLE_CLASSIFICATION, value: "true" } + - { name: PHOTOPRISM_DISABLE_RAW, value: "true" } + - { name: PHOTOPRISM_JPEG_SIZE, value: "720" } + - { name: PHOTOPRISM_THUMB_SIZE, value: "720" } + + - { name: PHOTOPRISM_DATABASE_DRIVER, value: "mysql" } + - { name: PHOTOPRISM_DATABASE_SERVER, value: "/run/mysqld/mysqld.sock" } + - { name: PHOTOPRISM_DATABASE_NAME, value: "photoprism" } + - { name: PHOTOPRISM_DATABASE_USER, value: "photoprism" } + - { name: PHOTOPRISM_DATABASE_PASSWORD, value: "insecure" } + ports: - containerPort: 2342 volumeMounts: - { name: photoprism-storage, mountPath: "/photoprism/storage" } - { name: photoprism-originals, mountPath: "/photoprism/originals" } + - { name: run-mysqld, mountPath: "/run/mysqld" } resources: limits: # tensorflow analysis goes to like 1200Mi memory: 2500Mi - + - name: mariadb + image: docker.io/mariadb:10.10.2 + securityContext: + runAsUser: 1000 + # let https://github.com/MariaDB/mariadb-docker/blob/749c720c63306d1572849afc6ab1cfa02fd08338/10.8/docker-entrypoint.sh + # do the startup. We could write to /etc/mysql/mariadb.conf.d if we really needed to config things. + # command: suggested from photoprism docs + # - mysqld + # - --innodb-buffer-pool-size=512M + # - --transaction-isolation=READ-COMMITTED + # - --character-set-server=utf8mb4 + # - --collation-server=utf8mb4_unicode_ci + # - --max-connections=512 + # - --innodb-rollback-on-timeout=OFF + # - --innodb-lock-wait-timeout=120 + volumeMounts: + - { name: photoprism-storage, subPath: "mariadb", mountPath: "/var/lib/mysql" } + - { name: run-mysqld, mountPath: "/run/mysqld" } + env: + - { name: MARIADB_AUTO_UPGRADE, value: "1" } + - { name: MARIADB_INITDB_SKIP_TZINFO, value: "1" } + - { name: MARIADB_DATABASE, value: "photoprism" } + - { name: MARIADB_USER, value: "photoprism" } + - { name: MARIADB_PASSWORD, value: "insecure" } + - { name: MARIADB_ROOT_PASSWORD, value: "insecure" } affinity: nodeAffinity: requiredDuringSchedulingIgnoredDuringExecution: @@ -86,6 +133,7 @@ - key: "kubernetes.io/hostname" operator: In values: ["bang"] + --- apiVersion: v1 kind: Service