Skip to content

Commit

Permalink
add: calibre-web chart
Browse files Browse the repository at this point in the history
  • Loading branch information
deB4SH committed Sep 20, 2024
1 parent ad1e289 commit 23bd8cf
Show file tree
Hide file tree
Showing 11 changed files with 303 additions and 0 deletions.
4 changes: 4 additions & 0 deletions charts/calibre-web/Chart.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
apiVersion: v2
name: calibre-web
version: 0.0.1
description: This Chart deploys the calibre web linuxserver image.
55 changes: 55 additions & 0 deletions charts/calibre-web/dbg.values.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
configuration:
tz: "Etc/UTC"
oauthlibRelaxTokenScope: "1"

deployment:
image:
location: "lscr.io/linuxserver/calibre-web"
tag: "0.6.23-ls290"
resources:
limits:
cpu: 250m
memory: 1Gi
requests:
cpu: 250m
memory: 1Gi

pvc:
data:
accessMode: ReadWriteOnce
storageClass: "s3"
storageSize: 1

additionalPvc:
- name: ebooks
type: nfs # possible options: nfs, cluster
size: 1 #value in Gi
accessMode: ReadWriteOnce
mountPath: "/books"
isReadOnly: true
# nfs required values (uncomment if required)
nfsvers: "4.1" #possible option 4.1 - for all options review your nfs configuration
path: "/volume1/pathToEbooks"
server: "127.0.0.1"
# cluster required values (uncomment if required)
- name: whatever
type: cluster # possible options: nfs, cluster
size: 1 #value in Gi
accessMode: ReadWriteOnce
mountPath: "/whatever"
isReadOnly: true
# cluster required values (uncomment if required)
storageClass: "myAwesomeStorageClass"

service:
loadbalancerIp:
isMetalLb: false
isCilium: true
ip: "192.168.178.123"

ingresses:
- enabled: true
hostname: calibre.local.lan
ingressClassName: nginx
annotations:
cert-manager.io/cluster-issuer: selfsigned-issuer
9 changes: 9 additions & 0 deletions charts/calibre-web/templates/configmap.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
apiVersion: v1
kind: ConfigMap
metadata:
name: {{.Release.Name}}-configuration
data:
PUID: 1000
PGID: 1000
TZ: {{.Values.configuration.tz}}
OAUTHLIB_RELAX_TOKEN_SCOPE: {{.Values.configuration.oauthlibRelaxTokenScope}}
44 changes: 44 additions & 0 deletions charts/calibre-web/templates/deployment.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{lower .Release.Name}}
spec:
replicas: 1
selector:
matchLabels:
app: {{lower .Release.Name}}
template:
metadata:
labels:
app: {{lower .Release.Name}}
annotations:
checksum/configmap: {{ include (print $.Template.BasePath "/configmap.yaml") . | sha256sum }}
spec:
containers:
- image: {{.Values.deployment.image.location}}:{{.Values.deployment.image.tag}}
name: calibre-web
envFrom:
- configMapRef:
name: {{lower .Release.Name}}-configuration
ports:
- containerPort: 8083
resources:
{{- toYaml .Values.deployment.resources | nindent 12 }}
volumeMounts:
- mountPath: /config
name: data
{{- range .Values.additionalPvc -}} {{ printf "\n" }}
- name: {{lower $.Release.Name}}-{{.name}}
mountPath: {{.mountPath}}
{{- if .isReadOnly}}
readOnly: {{.isReadOnly}} {{end}}
{{- end }}
volumes:
- name: data
persistentVolumeClaim:
claimName: {{.Release.Name}}-data
{{- range .Values.additionalPvc -}} {{ printf "\n" }}
- name: {{lower $.Release.Name}}-{{.name}}
persistentVolumeClaim:
claimName: {{lower $.Release.Name}}-{{.name}}
{{- end}}
30 changes: 30 additions & 0 deletions charts/calibre-web/templates/ingress.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
{{- range .Values.ingresses }}
{{- if .enabled }}
---
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: atuin-ingress-{{ .hostname | replace "." "-"}}
annotations:
{{- range $key, $val := .annotations }}
{{ $key }}: "{{ $val }}"
{{- end }}
spec:
ingressClassName: {{ .ingressClassName }}
tls:
- hosts:
- {{ .hostname }}
secretName: {{ .hostname }}
rules:
- host: {{ .hostname }}
http:
paths:
- path: /
pathType: Prefix
backend:
service:
name: {{$.Release.Name}}-clusterip
port:
number: 8888
{{ end }}
{{ end }}
55 changes: 55 additions & 0 deletions charts/calibre-web/templates/pvc-additional.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
{{- range .Values.additionalPvc }}
{{if eq .type "nfs" }}
#create pvc and pv for nfs mount
---
apiVersion: v1
kind: PersistentVolume
metadata:
name: {{lower $.Release.Name}}-{{.name}}
spec:
capacity:
storage: {{.size}}Gi
volumeMode: Filesystem
accessModes:
- {{ .accessMode }}
persistentVolumeReclaimPolicy: Recycle
storageClassName: nfs
mountOptions:
- hard
- nfsvers={{.nfsvers}}
nfs:
path: {{.path}}
server: {{.server}}
---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: {{lower $.Release.Name}}-{{.name}}
spec:
accessModes:
- {{ .accessMode }}
{{- if eq .type "nfs" }}
storageClassName: nfs
{{- end}}
resources:
requests:
storage: {{ .size }}Gi
{{end}}
{{if eq .type "cluster" }}
# create pvc for type cluster via storageclass
---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: {{lower $.Release.Name}}-{{.name}}
spec:
accessModes:
- {{ .accessMode }}
{{- if .storageClass }}
storageClassName: {{ .storageClass }}
{{- end}}
resources:
requests:
storage: {{ .size }}Gi
{{end}}
{{- end }}
13 changes: 13 additions & 0 deletions charts/calibre-web/templates/pvc-data.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: {{.Release.Name}}-data
spec:
accessModes:
- {{ .Values.pvc.data.accessMode }}
{{ if .Values.pvc.data.storageClass }}
storageClassName: {{ .Values.pvc.data.storageClass }}
{{ end}}
resources:
requests:
storage: {{ .Values.pvc.data.storageSize }}Gi
13 changes: 13 additions & 0 deletions charts/calibre-web/templates/service-clusterip.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
kind: Service
apiVersion: v1
metadata:
name: {{.Release.Name}}-clusterip
spec:
type: ClusterIP
ports:
- name: http
protocol: TCP
port: 8083
targetPort: 8083
selector:
app: {{lower .Release.Name}}
26 changes: 26 additions & 0 deletions charts/calibre-web/templates/service-loadbalancer.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
---
{{- if .Values.service.loadbalancerIp.enabled }}
kind: Service
apiVersion: v1
metadata:
name: {{.Release.Name}}-loadbalancer
annotations:
{{- if .Values.service.loadbalancerIp.isMetalLb}}
metallb.universe.tf/loadBalancerIPs: {{.Values.service.loadbalancerIp.ip}}
metallb.universe.tf/allow-shared-ip: calibre-web
{{- end}}
{{- if .Values.service.loadbalancerIp.isCilium}}
io.cilium/lb-ipam-ips: {{.Values.service.loadbalancerIp.ip}}
io.cilium/lb-ipam-sharing-key: calibre-web
{{- end}}
spec:
type: LoadBalancer
ports:
- name: http
protocol: TCP
port: 8083
targetPort: 8083
selector:
app: {{lower .Release.Name}}
{{- end }}

5 changes: 5 additions & 0 deletions charts/calibre-web/test.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/bin/bash
if [ -d ./test/out ]; then
rm -rf ./test/out
fi
helm template --debug --release-name calibre-web --output-dir ./test/out -f ./dbg.values.yaml ./
49 changes: 49 additions & 0 deletions charts/calibre-web/values.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
configuration:
tz: "Etc/UTC"
oauthlibRelaxTokenScope: "1"

deployment:
image:
location: "lscr.io/linuxserver/calibre-web"
tag: "0.6.23-ls290"
resources:
limits:
cpu: 250m
memory: 750Mi
requests:
cpu: 50m
memory: 500Mi

pvc:
data:
accessMode: ReadWriteOnce
storageClass: ""
storageSize: 1

additionalPvc: {}
# - name: ebooks
# type: "" # possible options: nfs, cluster
# size: 1 #value in Gi
# accessMode: ReadWriteOnce
# mountPath: "/books"
# isReadOnly: true
# # nfs required values (uncomment if required)
# nfsvers: "" #possible option 4.1 - for all options review your nfs configuration
# path: ""
# server: ""
# # cluster required values (uncomment if required)
# storageClass: "myAwesomeStorageClass"

service:
loadbalancerIp:
enabled: false
isMetalLb: false
isCilium: false
ip: "127.0.0.1"

ingresses:
- enabled: false
hostname: calibre.local.lan
ingressClassName: nginx
annotations: {}
# cert-manager.io/cluster-issuer: selfsigned-issuer

0 comments on commit 23bd8cf

Please sign in to comment.