apiVersion: apps/v1 kind: StatefulSet metadata: name: {{ .Release.Name }}-{{ .Chart.Name }}-sfs labels: app: {{ .Release.Name }}-{{ .Chart.Name }}-sfs spec: serviceName: {{ .Release.Name }}-{{ .Chart.Name }}-service replicas: {{ include "calibre-web-automated.replicas" (dict "scaleDown" .Values.scaleDown "replicas" .Values.cwa.replicas) }} selector: matchLabels: app: {{ .Release.Name }}-{{ .Chart.Name }}-sfs template: metadata: name: {{ .Release.Name }}-{{ .Chart.Name }}-sfs labels: app: {{ .Release.Name }}-{{ .Chart.Name }}-sfs spec: automountServiceAccountToken: false securityContext: {{- toYaml .Values.cwa.securityContext.pod | nindent 8 }} containers: - name: {{ .Release.Name }}-{{ .Chart.Name }}-container image: "ghcr.io/crocodilestick/calibre-web-automated:{{ .Chart.AppVersion }}" imagePullPolicy: IfNotPresent ports: - containerPort: 8083 name: http protocol: TCP env: - name: TZ value: "{{ .Values.cwa.timezone }}" - name: PUID value: "1000" - name: PGID value: "1000" - name: HARDCOVER_TOKEN valueFrom: secretKeyRef: name: {{ .Release.Name }}-{{ .Chart.Name }}-secret key: hardcover-api-token - name: CALIBRE_CONFIG_DIR value: "/config/.config/calibre" - name: NETWORK_SHARE_MODE value: "false" {{- range $value := .Values.cwa.env }} {{- if $value.value }} - name: {{ $value.name | quote }} value: {{ tpl $value.value $ | quote }} {{- else if $value.valueFrom }} {{- if $value.valueFrom.secretKeyRef }} - name: {{ $value.name }} valueFrom: secretKeyRef: name: {{ tpl $value.valueFrom.secretKeyRef.name $ | quote }} key: {{ tpl $value.valueFrom.secretKeyRef.key $ | quote }} {{- else if $value.valueFrom.configMapKeyRef }} - name: {{ $value.name }} valueFrom: configMapKeyRef: name: {{ tpl $value.valueFrom.configMapKeyRef.name $ | quote }} key: {{ tpl $value.valueFrom.configMapKeyRef.key $ | quote }} {{- end }} {{- end }} {{- end }} volumeMounts: - mountPath: "/config" name: cwa subPath: config/ - mountPath: "/calibre-library" name: cwa subPath: calibre-library/ - mountPath: "/config/.config/calibre/plugins" name: cwa subPath: calibre-plugins/ - mountPath: "/config/.config/calibre/customize.py.json" name: cwa-plugins-config subPath: customize.py.json - mountPath: "/cwa-book-ingest" name: cwa-consume livenessProbe: {{- toYaml .Values.cwa.livenessProbe | nindent 12 }} readinessProbe: {{- toYaml .Values.cwa.readinessProbe | nindent 12 }} startupProbe: {{- toYaml .Values.cwa.startupProbe | nindent 12 }} resources: {{- include "calibre-web-automated.resources" .Values.cwa.resources | nindent 12 }} securityContext: {{- toYaml .Values.cwa.securityContext.container | nindent 12 }} restartPolicy: Always volumes: # Deliberate naming exception (see README): both PVCs keep their # historical --cwa-* names — renaming a PVC would # provision a new, empty volume and orphan the existing data. - name: cwa persistentVolumeClaim: claimName: {{ .Chart.Name }}-{{ .Release.Name }}-cwa-pvc - name: cwa-consume persistentVolumeClaim: claimName: {{ .Chart.Name }}-{{ .Release.Name }}-cwa-consume-pvc - name: cwa-plugins-config secret: secretName: {{ .Release.Name }}-{{ .Chart.Name }}-secret items: - key: calibre-plugins path: customize.py.json mode: 0644