Mercurial > code > home > repos > photoprism
annotate deploy.yaml @ 8:55a0dc78fc3a default tip
user fix
author | drewp@bigasterisk.com |
---|---|
date | Sat, 25 Mar 2023 15:24:14 -0700 |
parents | 07aa4c3cddc4 |
children |
rev | line source |
---|---|
0 | 1 apiVersion: v1 |
2 kind: PersistentVolume | |
3 metadata: | |
4 name: photoprism-storage | |
5 labels: { type: local } | |
6 spec: | |
7 storageClassName: manual | |
3 | 8 hostPath: { path: "/photoprism" } |
0 | 9 capacity: { storage: 5Gi } |
10 accessModes: ["ReadWriteOnce"] | |
11 persistentVolumeReclaimPolicy: Retain | |
12 claimRef: { namespace: default, name: photoprism-storage } | |
1 | 13 |
0 | 14 --- |
15 apiVersion: v1 | |
16 kind: PersistentVolume | |
17 metadata: | |
18 name: photoprism-originals | |
19 labels: { type: local } | |
20 spec: | |
21 storageClassName: manual | |
1 | 22 hostPath: { path: "/my/pic" } |
0 | 23 capacity: { storage: 5Gi } |
24 accessModes: ["ReadWriteOnce"] | |
25 persistentVolumeReclaimPolicy: Retain | |
26 claimRef: { namespace: default, name: photoprism-originals } | |
1 | 27 |
0 | 28 --- |
29 apiVersion: v1 | |
30 kind: PersistentVolumeClaim | |
31 metadata: { name: photoprism-storage } | |
32 spec: | |
33 storageClassName: "" | |
34 volumeName: "photoprism-storage" | |
35 accessModes: ["ReadWriteOnce"] | |
36 resources: { requests: { storage: 5Gi } } | |
1 | 37 |
0 | 38 --- |
39 apiVersion: v1 | |
40 kind: PersistentVolumeClaim | |
41 metadata: { name: photoprism-originals } | |
42 spec: | |
43 storageClassName: "" | |
44 volumeName: "photoprism-originals" | |
45 accessModes: ["ReadWriteOnce"] | |
46 resources: { requests: { storage: 5Gi } } | |
1 | 47 |
0 | 48 --- |
49 apiVersion: apps/v1 | |
50 kind: Deployment | |
51 metadata: | |
52 name: photoprism | |
53 spec: | |
54 replicas: 1 | |
55 selector: | |
56 matchLabels: | |
57 app: photoprism | |
58 template: | |
59 metadata: | |
60 labels: | |
61 app: photoprism | |
1 | 62 annotations: |
2
781290b4a683
nightly updater. performance config attempts & notes
drewp@bigasterisk.com
parents:
1
diff
changeset
|
63 prometheus.io/port: "9104" |
0 | 64 spec: |
65 volumes: | |
66 - { name: photoprism-storage, persistentVolumeClaim: { claimName: photoprism-storage } } | |
67 - { name: photoprism-originals, persistentVolumeClaim: { claimName: photoprism-originals } } | |
6 | 68 - { name: run-mysqld, emptyDir: {} } |
0 | 69 containers: |
70 - name: photoprism | |
7 | 71 image: bang5:5000/photoprism_server |
72 securityContext: | |
73 runAsUser: 1050 | |
0 | 74 env: |
75 - { name: PHOTOPRISM_UPLOAD_NSFW, value: "true" } | |
76 - { name: PHOTOPRISM_READONLY, value: "true" } | |
2
781290b4a683
nightly updater. performance config attempts & notes
drewp@bigasterisk.com
parents:
1
diff
changeset
|
77 - { name: PHOTOPRISM_LOG_LEVEL, value: "trace" } |
6 | 78 - { name: PHOTOPRISM_TRACE, value: "true" } |
0 | 79 - { name: PHOTOPRISM_SITE_URL, value: "https://bigasterisk.com/photoprism/" } |
1 | 80 - { name: PHOTOPRISM_AUTH_MODE, value: "public" } |
2
781290b4a683
nightly updater. performance config attempts & notes
drewp@bigasterisk.com
parents:
1
diff
changeset
|
81 - { name: PHOTOPRISM_WORKERS, value: "2" } |
6 | 82 |
5 | 83 - { name: PHOTOPRISM_DISABLE_CHOWN, value: "true" } |
1 | 84 - { name: PHOTOPRISM_DISABLE_WEBDAV, value: "true" } |
85 - { name: PHOTOPRISM_DISABLE_CLASSIFICATION, value: "true" } | |
86 - { name: PHOTOPRISM_DISABLE_RAW, value: "true" } | |
87 - { name: PHOTOPRISM_JPEG_SIZE, value: "720" } | |
88 - { name: PHOTOPRISM_THUMB_SIZE, value: "720" } | |
6 | 89 |
1 | 90 - { name: PHOTOPRISM_DATABASE_DRIVER, value: "mysql" } |
91 - { name: PHOTOPRISM_DATABASE_SERVER, value: "/run/mysqld/mysqld.sock" } | |
92 - { name: PHOTOPRISM_DATABASE_NAME, value: "photoprism" } | |
93 - { name: PHOTOPRISM_DATABASE_USER, value: "photoprism" } | |
94 - { name: PHOTOPRISM_DATABASE_PASSWORD, value: "insecure" } | |
95 | |
5 | 96 - { name: PHOTOPRISM_WAKEUP_INTERVAL, value: "43200" } |
2
781290b4a683
nightly updater. performance config attempts & notes
drewp@bigasterisk.com
parents:
1
diff
changeset
|
97 - { name: PHOTOPRISM_AUTO_INDEX, value: "-1" } |
781290b4a683
nightly updater. performance config attempts & notes
drewp@bigasterisk.com
parents:
1
diff
changeset
|
98 - { name: PHOTOPRISM_AUTO_IMPORT, value: "-1" } |
0 | 99 ports: |
100 - containerPort: 2342 | |
101 volumeMounts: | |
102 - { name: photoprism-storage, mountPath: "/photoprism/storage" } | |
103 - { name: photoprism-originals, mountPath: "/photoprism/originals" } | |
1 | 104 - { name: run-mysqld, mountPath: "/run/mysqld" } |
0 | 105 resources: |
106 limits: | |
107 # tensorflow analysis goes to like 1200Mi | |
108 memory: 2500Mi | |
1 | 109 - name: mariadb |
7 | 110 image: bang5:5000/photoprism_mariadb |
1 | 111 securityContext: |
7 | 112 runAsUser: 1050 |
6 | 113 # let https://github.com/MariaDB/mariadb-docker/blob/749c720c63306d1572849afc6ab1cfa02fd08338/10.8/docker-entrypoint.sh |
1 | 114 # do the startup. We could write to /etc/mysql/mariadb.conf.d if we really needed to config things. |
115 # command: suggested from photoprism docs | |
116 # - mysqld | |
117 # - --innodb-buffer-pool-size=512M | |
2
781290b4a683
nightly updater. performance config attempts & notes
drewp@bigasterisk.com
parents:
1
diff
changeset
|
118 ## https://mariadb.com/kb/en/set-transaction/#isolation-levels current default is REPEATABLE-READ |
1 | 119 # - --transaction-isolation=READ-COMMITTED |
120 # - --character-set-server=utf8mb4 | |
121 # - --collation-server=utf8mb4_unicode_ci | |
2
781290b4a683
nightly updater. performance config attempts & notes
drewp@bigasterisk.com
parents:
1
diff
changeset
|
122 ## default 151 |
1 | 123 # - --max-connections=512 |
2
781290b4a683
nightly updater. performance config attempts & notes
drewp@bigasterisk.com
parents:
1
diff
changeset
|
124 ## default 0 |
1 | 125 # - --innodb-rollback-on-timeout=OFF |
2
781290b4a683
nightly updater. performance config attempts & notes
drewp@bigasterisk.com
parents:
1
diff
changeset
|
126 ## default 50 |
1 | 127 # - --innodb-lock-wait-timeout=120 |
128 volumeMounts: | |
129 - { name: photoprism-storage, subPath: "mariadb", mountPath: "/var/lib/mysql" } | |
130 - { name: run-mysqld, mountPath: "/run/mysqld" } | |
131 env: | |
6 | 132 # https://hub.docker.com/_/mariadb/#:~:text=latest%20%2D%2Dverbose%20%2D%2Dhelp-,Environment%20Variables,-When%20you%20start |
133 # says these only matter upon the first run. | |
1 | 134 - { name: MARIADB_AUTO_UPGRADE, value: "1" } |
135 - { name: MARIADB_INITDB_SKIP_TZINFO, value: "1" } | |
136 - { name: MARIADB_DATABASE, value: "photoprism" } | |
137 - { name: MARIADB_USER, value: "photoprism" } | |
138 - { name: MARIADB_PASSWORD, value: "insecure" } | |
139 - { name: MARIADB_ROOT_PASSWORD, value: "insecure" } | |
2
781290b4a683
nightly updater. performance config attempts & notes
drewp@bigasterisk.com
parents:
1
diff
changeset
|
140 - name: mariadb-exporter |
781290b4a683
nightly updater. performance config attempts & notes
drewp@bigasterisk.com
parents:
1
diff
changeset
|
141 # for this to work, run this once: |
6 | 142 # |
2
781290b4a683
nightly updater. performance config attempts & notes
drewp@bigasterisk.com
parents:
1
diff
changeset
|
143 # k exec -it deploy/photoprism mariadb -- mysql --user=root --password=insecure |
6 | 144 # |
2
781290b4a683
nightly updater. performance config attempts & notes
drewp@bigasterisk.com
parents:
1
diff
changeset
|
145 # CREATE USER 'exporter'@'localhost' IDENTIFIED BY 'XXXXXXXX'; |
781290b4a683
nightly updater. performance config attempts & notes
drewp@bigasterisk.com
parents:
1
diff
changeset
|
146 # GRANT PROCESS, REPLICATION CLIENT ON *.* TO 'exporter'@'localhost'; |
781290b4a683
nightly updater. performance config attempts & notes
drewp@bigasterisk.com
parents:
1
diff
changeset
|
147 # GRANT SELECT ON performance_schema.* TO 'exporter'@'localhost'; |
781290b4a683
nightly updater. performance config attempts & notes
drewp@bigasterisk.com
parents:
1
diff
changeset
|
148 # GRANT ALL ON photoprism.* TO 'exporter'@'localhost'; |
781290b4a683
nightly updater. performance config attempts & notes
drewp@bigasterisk.com
parents:
1
diff
changeset
|
149 image: prom/mysqld-exporter:v0.14.0 |
7 | 150 securityContext: |
151 runAsUser: 1050 | |
2
781290b4a683
nightly updater. performance config attempts & notes
drewp@bigasterisk.com
parents:
1
diff
changeset
|
152 args: |
6 | 153 # see: k exec -it deploy/photoprism -c mariadb-exporter -- /bin/mysqld_exporter --help |
154 - "--collect.info_schema.tables.databases=photoprism" | |
155 - "--collect.info_schema.tables" | |
156 - "--no-collect.slave_status" | |
157 - "--collect.info_schema.processlist" | |
158 - "--no-collect.info_schema.query_response_time" | |
159 - "--collect.perf_schema.tablelocks" | |
160 - "--collect.perf_schema.eventsstatements" | |
161 - "--collect.perf_schema.eventswaits" | |
162 - "--collect.perf_schema.tableiowaits" | |
163 - "--collect.perf_schema.indexiowaits" | |
164 - "--collect.perf_schema.file_events" | |
165 - "--collect.perf_schema.file_instances" | |
166 - "--collect.perf_schema.memory_events" | |
167 # need to turn on 'userstat' in mysql or something for these | |
168 #- "--collect.info_schema.tablestats" | |
169 #- "--collect.info_schema.schemastats" | |
170 - "--log.level=info" | |
2
781290b4a683
nightly updater. performance config attempts & notes
drewp@bigasterisk.com
parents:
1
diff
changeset
|
171 ports: |
6 | 172 - containerPort: 9104 |
2
781290b4a683
nightly updater. performance config attempts & notes
drewp@bigasterisk.com
parents:
1
diff
changeset
|
173 env: |
6 | 174 - name: DATA_SOURCE_NAME |
175 value: "exporter:XXXXXXXX@unix(/run/mysqld/mysqld.sock)/" | |
2
781290b4a683
nightly updater. performance config attempts & notes
drewp@bigasterisk.com
parents:
1
diff
changeset
|
176 volumeMounts: |
781290b4a683
nightly updater. performance config attempts & notes
drewp@bigasterisk.com
parents:
1
diff
changeset
|
177 - { name: run-mysqld, mountPath: "/run/mysqld" } |
0 | 178 affinity: |
179 nodeAffinity: | |
180 requiredDuringSchedulingIgnoredDuringExecution: | |
181 nodeSelectorTerms: | |
182 - matchExpressions: | |
183 - key: "kubernetes.io/hostname" | |
184 operator: In | |
3 | 185 values: ["ditto"] |
1 | 186 |
0 | 187 --- |
188 apiVersion: v1 | |
189 kind: Service | |
190 metadata: | |
191 name: photoprism | |
192 spec: | |
193 type: LoadBalancer | |
194 ports: | |
2
781290b4a683
nightly updater. performance config attempts & notes
drewp@bigasterisk.com
parents:
1
diff
changeset
|
195 - { port: 80, targetPort: 2342, name: web } |
781290b4a683
nightly updater. performance config attempts & notes
drewp@bigasterisk.com
parents:
1
diff
changeset
|
196 - { port: 9104, targetPort: 9104, name: metrics } |
0 | 197 selector: |
198 app: photoprism |