apiVersion: apps/v1 kind: Deployment metadata: name: photoprism-db labels: app: photoprism-db spec: selector: matchLabels: app: photoprism-db template: metadata: labels: app: photoprism-db spec: containers: - name: photoprism-db image: mariadb resources: limits: memory: "128Mi" cpu: "500m" env: - name: MYSQL_ROOT_PASSWORD valueFrom: secretKeyRef: name: photoprism key: mysql-root-pass - name: MYSQL_DATABASE valueFrom: configMapKeyRef: name: photoprism key: db-name - name: MYSQL_USER valueFrom: secretKeyRef: name: photoprism key: mysql-user - name: MYSQL_PASSWORD valueFrom: secretKeyRef: name: photoprism key: mysql-pass volumeMounts: - mountPath: /var/lib/mysql name: photoprism-db ports: - containerPort: 3306 volumes: - name: photoprism-db hostPath: path: /home/user/volumes/photoprism-db type: DirectoryOrCreate --- apiVersion: v1 kind: Service metadata: name: photoprism-db spec: selector: app: photoprism-db ports: - port: 3306 targetPort: 3306