From 6b2b50ca505ad3c871a7d21cea338211b975f25f Mon Sep 17 00:00:00 2001 From: alexlebens Date: Tue, 28 May 2024 11:19:21 -0500 Subject: [PATCH] convert cops to app-template --- clusters/cl01tl/applications/cops/Chart.yaml | 25 ++++- .../cops/templates/external-secret.yaml | 23 +++++ .../templates/persistent-volume-claim.yaml | 2 +- .../cops/templates/persistent-volume.yaml | 6 +- clusters/cl01tl/applications/cops/values.yaml | 95 +++++++++++++++---- 5 files changed, 124 insertions(+), 27 deletions(-) create mode 100644 clusters/cl01tl/applications/cops/templates/external-secret.yaml diff --git a/clusters/cl01tl/applications/cops/Chart.yaml b/clusters/cl01tl/applications/cops/Chart.yaml index e58d2e08e..6d28b7969 100644 --- a/clusters/cl01tl/applications/cops/Chart.yaml +++ b/clusters/cl01tl/applications/cops/Chart.yaml @@ -1,11 +1,26 @@ apiVersion: v2 name: cops -version: 0.0.1 +version: 1.0.0 +description: Calibre OPDS (and HTML) PHP Server +keywords: + - calibre + - OPDS + - books sources: + - https://github.com/seblucas/cops - https://github.com/mikespub-org/seblucas-cops - - http://alexlebens.github.io/helm-charts + - https://docs.linuxserver.io/images/docker-cops/ + - https://github.com/cloudflare/cloudflared + - https://github.com/bjw-s/helm-charts/blob/main/charts/other/app-template/values.yaml +maintainers: + - name: alexlebens dependencies: - - name: cops - version: 0.0.3 - repository: http://alexlebens.github.io/helm-charts + - name: app-template + alias: cops + repository: https://bjw-s.github.io/helm-charts/ + version: 3.2.1 + - name: app-template + alias: cloudflared + repository: https://bjw-s.github.io/helm-charts/ + version: 3.2.1 appVersion: 1.1.3 diff --git a/clusters/cl01tl/applications/cops/templates/external-secret.yaml b/clusters/cl01tl/applications/cops/templates/external-secret.yaml new file mode 100644 index 000000000..2eaffeb30 --- /dev/null +++ b/clusters/cl01tl/applications/cops/templates/external-secret.yaml @@ -0,0 +1,23 @@ +apiVersion: external-secrets.io/v1beta1 +kind: ExternalSecret +metadata: + name: cops-cloudflared-secret + namespace: {{ .Release.Namespace }} + labels: + app.kubernetes.io/name: cops-cloudflared-secret + 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: + secretStoreRef: + kind: ClusterSecretStore + name: vault + data: + - secretKey: cf-tunnel-token + remoteRef: + conversionStrategy: Default + decodingStrategy: None + key: /cloudflare/tunnels/cops + metadataPolicy: None + property: token diff --git a/clusters/cl01tl/applications/cops/templates/persistent-volume-claim.yaml b/clusters/cl01tl/applications/cops/templates/persistent-volume-claim.yaml index cf2d956bf..68135592f 100644 --- a/clusters/cl01tl/applications/cops/templates/persistent-volume-claim.yaml +++ b/clusters/cl01tl/applications/cops/templates/persistent-volume-claim.yaml @@ -4,7 +4,7 @@ metadata: name: cops-nfs-storage namespace: {{ .Release.Namespace }} labels: - app.kubernetes.io/name: {{ .Release.Name }} + app.kubernetes.io/name: cops-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/cops/templates/persistent-volume.yaml b/clusters/cl01tl/applications/cops/templates/persistent-volume.yaml index abc37fd5e..e4a0559b3 100644 --- a/clusters/cl01tl/applications/cops/templates/persistent-volume.yaml +++ b/clusters/cl01tl/applications/cops/templates/persistent-volume.yaml @@ -4,7 +4,7 @@ metadata: name: cops-nfs-storage namespace: {{ .Release.Namespace }} labels: - app.kubernetes.io/name: {{ .Release.Name }} + app.kubernetes.io/name: cops-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: {{ .Values.storage.books.nfsPath }} - server: {{ .Values.storage.books.nfsServer }} + path: /volume2/Storage/Calibre + server: synologybond.alexlebens.net mountOptions: - vers=4 - minorversion=1 diff --git a/clusters/cl01tl/applications/cops/values.yaml b/clusters/cl01tl/applications/cops/values.yaml index 900c096c3..6481baa43 100644 --- a/clusters/cl01tl/applications/cops/values.yaml +++ b/clusters/cl01tl/applications/cops/values.yaml @@ -1,22 +1,81 @@ cops: - deployment: - env: - TZ: US/Central - ingress: - enabled: true - annotations: - traefik.ingress.kubernetes.io/router.entrypoints: websecure - traefik.ingress.kubernetes.io/router.tls: "true" - cert-manager.io/cluster-issuer: letsencrypt-issuer - className: traefik - host: calibre-content.alexlebens.net + controllers: + main: + type: deployment + replicas: 1 + strategy: Recreate + revisionHistoryLimit: 3 + containers: + main: + image: + repository: linuxserver/cops + tag: 2.3.1-ls185 + pullPolicy: IfNotPresent + env: + - name: PGID + value: "1000" + - name: PUID + value: "1000" + - name: TZ + value: US/Central + resources: + requests: + cpu: 100m + memory: 256Mi + serviceAccount: + create: true + service: + web: + controller: main + ports: + http: + port: 80 + targetPort: 80 + protocol: HTTP persistence: config: - storageClassName: ceph-block - storageSize: 1Gi + storageClass: ceph-block + accessMode: ReadWriteOnce + size: 5Gi + retain: true + advancedMounts: + main: + main: + - path: /config + readOnly: false books: - claimName: cops-nfs-storage -storage: - books: - nfsPath: /volume2/Storage/Calibre - nfsServer: synologybond.alexlebens.net + existingClaim: calibre-server-nfs-storage + advancedMounts: + scanner: + main: + - path: /books + readOnly: true +cloudflared: + global: + nameOverride: cloudflared + controllers: + main: + type: deployment + strategy: Recreate + containers: + main: + image: + repository: cloudflare/cloudflared + tag: "2024.5.0" + pullPolicy: IfNotPresent + args: + - tunnel + - --no-autoupdate + - run + - --token + - $(CF_MANAGED_TUNNEL_TOKEN) + env: + - name: CF_MANAGED_TUNNEL_TOKEN + valueFrom: + secretKeyRef: + name: cops-cloudflared-secret + key: cf-tunnel-token + resources: + requests: + cpu: 100m + memory: 128Mi