57 lines
2.5 KiB
YAML
57 lines
2.5 KiB
YAML
apiVersion: apps/v1
|
|
kind: Deployment
|
|
metadata:
|
|
name: scanner
|
|
spec:
|
|
replicas: {{ .Values.replicaCount }}
|
|
strategy:
|
|
type: Recreate
|
|
selector:
|
|
matchLabels: {app: scanner}
|
|
template:
|
|
metadata:
|
|
labels: {app: scanner}
|
|
annotations:
|
|
checksum/config: {{ .Files.Get "files/send-to-paperless.js" | sha256sum }}
|
|
spec:
|
|
automountServiceAccountToken: false
|
|
securityContext:
|
|
supplementalGroups: [1000]
|
|
initContainers:
|
|
- name: prepare-output
|
|
image: {{ printf "%s:%s" .Values.initImage.repository .Values.initImage.tag | quote }}
|
|
command: [sh, -c, 'mkdir -p /volume/{{ .Values.scanner.outputSubPath }} && chown 102:100 /volume/{{ .Values.scanner.outputSubPath }} && chmod 775 /volume/{{ .Values.scanner.outputSubPath }} && chmod g+w /volume/{{ .Values.scanner.consumeSubPath }}']
|
|
volumeMounts:
|
|
- {name: data, mountPath: /volume}
|
|
containers:
|
|
- name: scanner
|
|
image: {{ printf "%s:%s" .Values.image.repository (.Values.image.tag | default .Chart.AppVersion) | quote }}
|
|
imagePullPolicy: {{ .Values.image.pullPolicy }}
|
|
command: [sh, -c, "sed -i '/^\\[options\\]/a discovery = disable' /etc/sane.d/airscan.conf && exec /entrypoint.sh"]
|
|
env:
|
|
- {name: AIRSCAN_DEVICES, value: {{ .Values.scanner.airscanDevices | quote }}}
|
|
- {name: SCAN_OUTPUT_DIR, value: {{ .Values.scanner.outputDirectory | quote }}}
|
|
- {name: PAPERLESS_CONSUME_DIR, value: {{ .Values.scanner.consumeDirectory | quote }}}
|
|
ports: [{name: http, containerPort: 8080}]
|
|
volumeMounts:
|
|
- {name: data, mountPath: {{ .Values.scanner.outputDirectory }}, subPath: {{ .Values.scanner.outputSubPath }}}
|
|
- {name: data, mountPath: {{ .Values.scanner.consumeDirectory }}, subPath: {{ .Values.scanner.consumeSubPath }}}
|
|
- {name: config, mountPath: /etc/scanservjs/config.local.js, subPath: config.local.js, readOnly: true}
|
|
startupProbe:
|
|
httpGet: {path: /, port: http}
|
|
periodSeconds: 5
|
|
failureThreshold: 60
|
|
readinessProbe:
|
|
httpGet: {path: /, port: http}
|
|
periodSeconds: 10
|
|
livenessProbe:
|
|
httpGet: {path: /, port: http}
|
|
periodSeconds: 30
|
|
resources:
|
|
{{ toYaml .Values.resources | indent 12 }}
|
|
volumes:
|
|
- name: data
|
|
persistentVolumeClaim: {claimName: {{ .Values.persistence.existingClaim }}}
|
|
- name: config
|
|
configMap: {name: scanner-config}
|