From d393d4abd7dcf377212e248cb6b1206870794648 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lu=C3=ADs=20Simas?= Date: Sun, 8 Sep 2024 11:59:01 -0300 Subject: [PATCH] feat(apps): deploy shiori in place of wallabag Unfortunately I could not get wallabag to work properly. A lot of issues with migrations and generally a very bad experience operating the application. --- apps/kustomization.yaml | 2 +- apps/shiori/deployment.yaml | 34 ++++++++++ apps/shiori/ingress.yaml | 30 +++++++++ apps/{wallabag => shiori}/kustomization.yaml | 2 +- apps/{wallabag => shiori}/namespace.yaml | 2 +- apps/shiori/pvc.yaml | 15 +++++ apps/shiori/service.yaml | 13 ++++ apps/wallabag/database.yaml | 12 ---- apps/wallabag/deployment.yaml | 67 -------------------- apps/wallabag/ingress.yaml | 30 --------- apps/wallabag/service.yaml | 13 ---- 11 files changed, 95 insertions(+), 125 deletions(-) create mode 100644 apps/shiori/deployment.yaml create mode 100644 apps/shiori/ingress.yaml rename apps/{wallabag => shiori}/kustomization.yaml (89%) rename apps/{wallabag => shiori}/namespace.yaml (70%) create mode 100644 apps/shiori/pvc.yaml create mode 100644 apps/shiori/service.yaml delete mode 100644 apps/wallabag/database.yaml delete mode 100644 apps/wallabag/deployment.yaml delete mode 100644 apps/wallabag/ingress.yaml delete mode 100644 apps/wallabag/service.yaml diff --git a/apps/kustomization.yaml b/apps/kustomization.yaml index e8d4c02..fafc53e 100644 --- a/apps/kustomization.yaml +++ b/apps/kustomization.yaml @@ -8,4 +8,4 @@ resources: - octobot - zettelkasten-exporter - traggo - - wallabag + - shiori diff --git a/apps/shiori/deployment.yaml b/apps/shiori/deployment.yaml new file mode 100644 index 0000000..800b574 --- /dev/null +++ b/apps/shiori/deployment.yaml @@ -0,0 +1,34 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: shiori + namespace: shiori + labels: + app.kubernetes.io/name: shiori +spec: + selector: + matchLabels: + app.kubernetes.io/name: shiori + replicas: 1 + template: + metadata: + labels: + app.kubernetes.io/name: shiori + spec: + containers: + - name: shiori + image: "ghcr.io/go-shiori/shiori:latest" + ports: + - name: http + containerPort: 80 + protocol: TCP + volumeMounts: + - mountPath: /app/data + name: data + env: + - name: SHIORI_DIR + value: /app/data + volumes: + - name: data + persistentVolumeClaim: + claimName: mealie-data diff --git a/apps/shiori/ingress.yaml b/apps/shiori/ingress.yaml new file mode 100644 index 0000000..c28b96d --- /dev/null +++ b/apps/shiori/ingress.yaml @@ -0,0 +1,30 @@ +apiVersion: networking.k8s.io/v1 +kind: Ingress +metadata: + name: shiori + namespace: shiori + labels: + app.kubernetes.io/name: shiori + annotations: + gethomepage.dev/name: shiori + gethomepage.dev/description: Bookmarks manager + gethomepage.dev/enabled: "true" + gethomepage.dev/group: Media + gethomepage.dev/icon: shiori.png + gethomepage.dev/pod-selector: "app.kubernetes.io/name=shiori" +spec: + tls: + - hosts: + - shiori.totorinho.duckdns.org + secretName: duckdns-wildcard-cert-totorinho.duckdns.org + rules: + - host: shiori.totorinho.duckdns.org + http: + paths: + - path: / + pathType: Prefix + backend: + service: + name: shiori + port: + number: 8080 diff --git a/apps/wallabag/kustomization.yaml b/apps/shiori/kustomization.yaml similarity index 89% rename from apps/wallabag/kustomization.yaml rename to apps/shiori/kustomization.yaml index 2043e37..3245c70 100644 --- a/apps/wallabag/kustomization.yaml +++ b/apps/shiori/kustomization.yaml @@ -2,7 +2,7 @@ apiVersion: kustomize.config.k8s.io/v1beta1 kind: Kustomization resources: - namespace.yaml - - database.yaml + - pvc.yaml - deployment.yaml - service.yaml - ingress.yaml diff --git a/apps/wallabag/namespace.yaml b/apps/shiori/namespace.yaml similarity index 70% rename from apps/wallabag/namespace.yaml rename to apps/shiori/namespace.yaml index 448074a..c20c61a 100644 --- a/apps/wallabag/namespace.yaml +++ b/apps/shiori/namespace.yaml @@ -1,4 +1,4 @@ apiVersion: v1 kind: Namespace metadata: - name: wallabag + name: shiori diff --git a/apps/shiori/pvc.yaml b/apps/shiori/pvc.yaml new file mode 100644 index 0000000..4fc6025 --- /dev/null +++ b/apps/shiori/pvc.yaml @@ -0,0 +1,15 @@ +apiVersion: v1 +kind: PersistentVolumeClaim +metadata: + name: shiori-data + namespace: shiori + labels: + app.kubernetes.io/name: shiori +spec: + storageClassName: local-path + accessModes: + - ReadWriteOnce + resources: + requests: + storage: 10Gi + diff --git a/apps/shiori/service.yaml b/apps/shiori/service.yaml new file mode 100644 index 0000000..ba28b56 --- /dev/null +++ b/apps/shiori/service.yaml @@ -0,0 +1,13 @@ +apiVersion: v1 +kind: Service +metadata: + name: shiori + namespace: shiori + labels: + app.kubernetes.io/name: shiori +spec: + selector: + app.kubernetes.io/name: shiori + ports: + - port: 8080 + targetPort: 8080 diff --git a/apps/wallabag/database.yaml b/apps/wallabag/database.yaml deleted file mode 100644 index 74f42b9..0000000 --- a/apps/wallabag/database.yaml +++ /dev/null @@ -1,12 +0,0 @@ -apiVersion: postgresql.cnpg.io/v1 -kind: Cluster -metadata: - name: postgresql-cluster - namespace: wallabag -spec: - instances: 3 - storage: - size: 2Gi - monitoring: - enablePodMonitor: true - enableSuperuserAccess: true diff --git a/apps/wallabag/deployment.yaml b/apps/wallabag/deployment.yaml deleted file mode 100644 index b6559b0..0000000 --- a/apps/wallabag/deployment.yaml +++ /dev/null @@ -1,67 +0,0 @@ -apiVersion: apps/v1 -kind: Deployment -metadata: - name: wallabag - namespace: wallabag - labels: - app.kubernetes.io/name: wallabag -spec: - selector: - matchLabels: - app.kubernetes.io/name: wallabag - replicas: 1 - template: - metadata: - labels: - app.kubernetes.io/name: wallabag - spec: - containers: - - name: wallabag - image: "wallabag/wallabag" - ports: - - name: http - containerPort: 80 - protocol: TCP - env: - - name: SYMFONY__ENV__DATABASE_DRIVER - value: pdo_pgsql - - name: SYMFONY__ENV__DATABASE_DRIVER_CLASS - value: Wallabag\CoreBundle\Doctrine\DBAL\Driver\CustomPostgreSQLDriver - - name: SYMFONY__ENV__DOMAIN_NAME - value: https://wallabag.totorinho.duckdns.org - - name: SYMFONY__ENV__DATABASE_HOST - valueFrom: - secretKeyRef: - name: postgresql-cluster-app - key: host - - name: SYMFONY__ENV__DATABASE_PORT - valueFrom: - secretKeyRef: - name: postgresql-cluster-app - key: port - - name: SYMFONY__ENV__DATABASE_NAME - valueFrom: - secretKeyRef: - name: postgresql-cluster-app - key: dbname - - name: SYMFONY__ENV__DATABASE_USER - valueFrom: - secretKeyRef: - name: postgresql-cluster-app - key: username - - name: SYMFONY__ENV__DATABASE_PASSWORD - valueFrom: - secretKeyRef: - name: postgresql-cluster-app - key: password - - name: POSTGRES_USER - valueFrom: - secretKeyRef: - name: postgresql-cluster-superuser - key: username - - name: POSTGRES_PASSWORD - valueFrom: - secretKeyRef: - name: postgresql-cluster-superuser - key: password - diff --git a/apps/wallabag/ingress.yaml b/apps/wallabag/ingress.yaml deleted file mode 100644 index 3e67f5d..0000000 --- a/apps/wallabag/ingress.yaml +++ /dev/null @@ -1,30 +0,0 @@ -apiVersion: networking.k8s.io/v1 -kind: Ingress -metadata: - name: wallabag - namespace: wallabag - labels: - app.kubernetes.io/name: wallabag - annotations: - gethomepage.dev/name: wallabag - gethomepage.dev/description: Read later - gethomepage.dev/enabled: "true" - gethomepage.dev/group: Media - gethomepage.dev/icon: wallabag.png - gethomepage.dev/pod-selector: "app.kubernetes.io/name=wallabag" -spec: - tls: - - hosts: - - wallabag.totorinho.duckdns.org - secretName: duckdns-wildcard-cert-totorinho.duckdns.org - rules: - - host: wallabag.totorinho.duckdns.org - http: - paths: - - path: / - pathType: Prefix - backend: - service: - name: wallabag - port: - number: 80 diff --git a/apps/wallabag/service.yaml b/apps/wallabag/service.yaml deleted file mode 100644 index d3694f6..0000000 --- a/apps/wallabag/service.yaml +++ /dev/null @@ -1,13 +0,0 @@ -apiVersion: v1 -kind: Service -metadata: - name: wallabag - namespace: wallabag - labels: - app.kubernetes.io/name: wallabag -spec: - selector: - app.kubernetes.io/name: wallabag - ports: - - port: 80 - targetPort: 80