From d291611dc8ba1777b7087c1389242bfbad8fb12b Mon Sep 17 00:00:00 2001 From: alexlebens Date: Tue, 28 May 2024 11:02:09 -0500 Subject: [PATCH] convert calibre-server to app-template --- .../applications/calibre-server/Chart.yaml | 16 +++- .../templates/ingress-route.yaml | 33 ++++++++ .../calibre-server/templates/middleware.yaml | 27 +++++++ .../templates/persistent-volume-claim.yaml | 2 +- .../templates/persistent-volume.yaml | 6 +- .../applications/calibre-server/values.yaml | 79 +++++++++++++++---- 6 files changed, 139 insertions(+), 24 deletions(-) create mode 100644 clusters/cl01tl/applications/calibre-server/templates/ingress-route.yaml create mode 100644 clusters/cl01tl/applications/calibre-server/templates/middleware.yaml diff --git a/clusters/cl01tl/applications/calibre-server/Chart.yaml b/clusters/cl01tl/applications/calibre-server/Chart.yaml index 85f8176d7..eb5d27c3a 100644 --- a/clusters/cl01tl/applications/calibre-server/Chart.yaml +++ b/clusters/cl01tl/applications/calibre-server/Chart.yaml @@ -1,11 +1,19 @@ apiVersion: v2 name: calibre-server version: 1.0.0 +description: Calibre Server +keywords: + - media + - books sources: - https://github.com/kovidgoyal/calibre - - https://github.com/alexlebens/helm-charts/tree/main/charts/calibre-server + - https://github.com/bjw-s/helm-charts/tree/main/charts/other/app-template +maintainers: + - name: alexlebens dependencies: - - name: calibre-server - version: 0.0.8 - repository: http://alexlebens.github.io/helm-charts + - name: app-template + alias: calibre-server + repository: https://bjw-s.github.io/helm-charts/ + version: 3.2.1 +icon: https://raw.githubusercontent.com/kovidgoyal/calibre/master/resources/images/lt.png appVersion: 7.5.1 diff --git a/clusters/cl01tl/applications/calibre-server/templates/ingress-route.yaml b/clusters/cl01tl/applications/calibre-server/templates/ingress-route.yaml new file mode 100644 index 000000000..282a0e8f4 --- /dev/null +++ b/clusters/cl01tl/applications/calibre-server/templates/ingress-route.yaml @@ -0,0 +1,33 @@ +apiVersion: traefik.io/v1alpha1 +kind: IngressRoute +metadata: + name: calibre-server + namespace: {{ .Release.Namespace }} + labels: + app.kubernetes.io/name: calibre-server + app.kubernetes.io/instance: {{ .Release.Name }} + app.kubernetes.io/version: {{ .Chart.AppVersion }} + app.kubernetes.io/component: web + app.kubernetes.io/part-of: {{ .Release.Name }} +spec: + entryPoints: + - websecure + routes: + - kind: Rule + match: Host(`calibre-server.alexlebens.net`) + middlewares: + - name: "authentik-{{ .Release.Name }}" + namespace: authentik + priority: 10 + services: + - kind: Service + name: calibre-server-web + port: 8080 + - kind: Rule + match: Host(`calibre-server.alexlebens.net`) && PathPrefix(`/outpost.goauthentik.io/`) + priority: 15 + services: + - kind: Service + name: authentik-outpost-proxy + port: 9000 + namespace: authentik diff --git a/clusters/cl01tl/applications/calibre-server/templates/middleware.yaml b/clusters/cl01tl/applications/calibre-server/templates/middleware.yaml new file mode 100644 index 000000000..c646a0aca --- /dev/null +++ b/clusters/cl01tl/applications/calibre-server/templates/middleware.yaml @@ -0,0 +1,27 @@ +apiVersion: traefik.io/v1alpha1 +kind: Middleware +metadata: + name: "authentik-{{ .Release.Name }}" + namespace: authentik + labels: + app.kubernetes.io/name: "authentik-{{ .Release.Name }}" + app.kubernetes.io/instance: {{ .Release.Name }} + app.kubernetes.io/version: {{ .Chart.AppVersion }} + app.kubernetes.io/component: auth + app.kubernetes.io/part-of: {{ .Release.Name }} +spec: + forwardAuth: + address: http://authentik-outpost-proxy.authentik:9000/outpost.goauthentik.io/auth/traefik + trustForwardHeader: true + authResponseHeaders: + - X-authentik-username + - X-authentik-groups + - X-authentik-email + - X-authentik-name + - X-authentik-uid + - X-authentik-jwt + - X-authentik-meta-jwks + - X-authentik-meta-outpost + - X-authentik-meta-provider + - X-authentik-meta-app + - X-authentik-meta-version diff --git a/clusters/cl01tl/applications/calibre-server/templates/persistent-volume-claim.yaml b/clusters/cl01tl/applications/calibre-server/templates/persistent-volume-claim.yaml index 68c507feb..8af826fdc 100644 --- a/clusters/cl01tl/applications/calibre-server/templates/persistent-volume-claim.yaml +++ b/clusters/cl01tl/applications/calibre-server/templates/persistent-volume-claim.yaml @@ -4,7 +4,7 @@ metadata: name: calibre-server-nfs-storage namespace: {{ .Release.Namespace }} labels: - app.kubernetes.io/name: {{ .Release.Name }} + app.kubernetes.io/name: calibre-server-nfs-storage app.kubernetes.io/instance: {{ .Release.Name }} app.kubernetes.io/version: {{ .Chart.AppVersion }} app.kubernetes.io/component: storage diff --git a/clusters/cl01tl/applications/calibre-server/templates/persistent-volume.yaml b/clusters/cl01tl/applications/calibre-server/templates/persistent-volume.yaml index f44568e96..e3cc3b5ea 100644 --- a/clusters/cl01tl/applications/calibre-server/templates/persistent-volume.yaml +++ b/clusters/cl01tl/applications/calibre-server/templates/persistent-volume.yaml @@ -4,7 +4,7 @@ metadata: name: calibre-server-nfs-storage namespace: {{ .Release.Namespace }} labels: - app.kubernetes.io/name: {{ .Release.Name }} + app.kubernetes.io/name: calibre-server-nfs-storage app.kubernetes.io/instance: {{ .Release.Name }} app.kubernetes.io/version: {{ .Chart.AppVersion }} app.kubernetes.io/component: storage @@ -17,8 +17,8 @@ spec: accessModes: - ReadWriteMany nfs: - path: {{ index .Values "calibre-server" "persistence" "books" "nfs" "path" }} - server: {{ index .Values "calibre-server" "persistence" "books" "nfs" "server" }} + path: /volume2/Storage/Calibre + server: synologybond.alexlebens.net mountOptions: - vers=4 - minorversion=1 diff --git a/clusters/cl01tl/applications/calibre-server/values.yaml b/clusters/cl01tl/applications/calibre-server/values.yaml index d517c5271..edc7ac3c0 100644 --- a/clusters/cl01tl/applications/calibre-server/values.yaml +++ b/clusters/cl01tl/applications/calibre-server/values.yaml @@ -1,20 +1,67 @@ calibre-server: - deployment: - env: - TZ: US/Central - ingressRoute: - enabled: true - http: - host: calibre-server.alexlebens.net - authentik: - outpost: authentik-outpost-proxy - namespace: authentik + controllers: + main: + type: deployment + replicas: 1 + strategy: Recreate + revisionHistoryLimit: 3 + containers: + main: + image: + repository: linuxserver/calibre + tag: v7.5.1-ls269 + pullPolicy: IfNotPresent + env: + - name: PGID + value: "1001" + - name: PUID + value: "1001" + - name: TZ + value: US/Central + - name: UMASK_SET + value: "022" + - name: CUSTOM_USER + value: calibre + - name: TITLE + value: Calibre Server + - name: NO_DECOR + value: true + resources: + requests: + cpu: 100m + memory: 256Mi + serviceAccount: + create: true + service: + web: + controller: main + ports: + http: + port: 8080 + targetPort: 8080 + protocol: HTTP + content: + controller: main + ports: + http: + port: 8081 + targetPort: 8081 + protocol: HTTP persistence: config: - storageClassName: ceph-block - storageSize: 5Gi + storageClass: ceph-block + accessMode: ReadWriteOnce + size: 5Gi + retain: true + advancedMounts: + main: + main: + - path: /config + readOnly: false books: - claimName: calibre-server-nfs-storage - nfs: - path: /volume2/Storage/Calibre - server: synologybond.alexlebens.net + existingClaim: calibre-server-nfs-storage + advancedMounts: + scanner: + main: + - path: /books + readOnly: true