diff options
| author | Paul Buetow <paul@buetow.org> | 2025-08-09 11:45:29 +0300 |
|---|---|---|
| committer | Paul Buetow <paul@buetow.org> | 2025-08-09 11:45:29 +0300 |
| commit | 734b979d98182925733c818b64e8421f80204ab0 (patch) | |
| tree | 15b55bc80f598a6e24ed460c4945cedcb3e362c1 /f3s/opodsync | |
| parent | 5542e7354200d94a34d78c6d5838793ef0edaf66 (diff) | |
initial
Diffstat (limited to 'f3s/opodsync')
| -rw-r--r-- | f3s/opodsync/Justfile | 12 | ||||
| -rw-r--r-- | f3s/opodsync/README.md | 11 | ||||
| -rw-r--r-- | f3s/opodsync/config.dist.php | 15 | ||||
| -rw-r--r-- | f3s/opodsync/helm-chart/Chart.yaml | 5 | ||||
| -rw-r--r-- | f3s/opodsync/helm-chart/templates/configmap-nginx.yaml | 46 | ||||
| -rw-r--r-- | f3s/opodsync/helm-chart/templates/deployment.yaml | 43 | ||||
| -rw-r--r-- | f3s/opodsync/helm-chart/templates/ingress.yaml | 30 | ||||
| -rw-r--r-- | f3s/opodsync/helm-chart/templates/persistent-volumes.yaml | 27 | ||||
| -rw-r--r-- | f3s/opodsync/helm-chart/templates/service.yaml | 15 |
9 files changed, 204 insertions, 0 deletions
diff --git a/f3s/opodsync/Justfile b/f3s/opodsync/Justfile new file mode 100644 index 0000000..3143637 --- /dev/null +++ b/f3s/opodsync/Justfile @@ -0,0 +1,12 @@ +NAMESPACE := "services" +RELEASE_NAME := "opodsync" +CHART_PATH := "./helm-chart" + +install: + helm install {{RELEASE_NAME}} {{CHART_PATH}} --namespace {{NAMESPACE}} --create-namespace + +upgrade: + helm upgrade {{RELEASE_NAME}} {{CHART_PATH}} --namespace {{NAMESPACE}} + +delete: + helm uninstall {{RELEASE_NAME}} --namespace {{NAMESPACE}}
\ No newline at end of file diff --git a/f3s/opodsync/README.md b/f3s/opodsync/README.md new file mode 100644 index 0000000..fd17938 --- /dev/null +++ b/f3s/opodsync/README.md @@ -0,0 +1,11 @@ +# opodsync + +This Helm chart deploys the opodsync. + +## Manual steps + +Before deploying, you need to create the following directory on your NFS share: + +```bash +mkdir -p /data/nfs/k3svolumes/opodsync/data +``` diff --git a/f3s/opodsync/config.dist.php b/f3s/opodsync/config.dist.php new file mode 100644 index 0000000..b5e7157 --- /dev/null +++ b/f3s/opodsync/config.dist.php @@ -0,0 +1,15 @@ +<?php + +// base url of the server, for example "https://example.com/gpodder" +// if not set, the server will try to guess it +// define("GPODDER_BASE_URL", "https://example.com/gpodder"); + +// directory to store the database and other data +// if not set, the server will use the "data" directory in the same directory as this script +// define("GPODDER_DATA_DIR", "/var/www/server/data"); + +// allow new user registrations after the first user is created +// define("GPODDER_ALLOW_REGISTRATIONS", true); + +// enable logging +// define("GPODDER_LOG_LEVEL", "debug"); diff --git a/f3s/opodsync/helm-chart/Chart.yaml b/f3s/opodsync/helm-chart/Chart.yaml new file mode 100644 index 0000000..8d41abe --- /dev/null +++ b/f3s/opodsync/helm-chart/Chart.yaml @@ -0,0 +1,5 @@ +apiVersion: v2 +name: opodsync +description: A Helm chart for deploying the opodsync. +version: 0.1.0 +appVersion: "latest" diff --git a/f3s/opodsync/helm-chart/templates/configmap-nginx.yaml b/f3s/opodsync/helm-chart/templates/configmap-nginx.yaml new file mode 100644 index 0000000..b4c2ef6 --- /dev/null +++ b/f3s/opodsync/helm-chart/templates/configmap-nginx.yaml @@ -0,0 +1,46 @@ +apiVersion: v1 +kind: ConfigMap +metadata: + name: opodsync-nginx-config + namespace: services +data: + nginx.conf: | + worker_processes 1; + events { worker_connections 1024; } + http { + variables_hash_bucket_size 128; + include mime.types; + default_type application/octet-stream; + sendfile on; + keepalive_timeout 65; + + upstream backend { + server 127.0.0.1:8080; + } + + server { + listen 8081; + + # Preserve client details + proxy_set_header Host $host; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Proto $scheme; + + # Root path internally proxies to /gpodder on backend + location = / { + proxy_pass http://backend/gpodder; + } + + # Pass through existing /gpodder paths unchanged + location /gpodder { + proxy_pass http://backend; + } + + # Fallback: proxy everything else as-is + location / { + proxy_pass http://backend; + } + } + } + diff --git a/f3s/opodsync/helm-chart/templates/deployment.yaml b/f3s/opodsync/helm-chart/templates/deployment.yaml new file mode 100644 index 0000000..b0f11d9 --- /dev/null +++ b/f3s/opodsync/helm-chart/templates/deployment.yaml @@ -0,0 +1,43 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: opodsync + namespace: services +spec: + replicas: 1 + selector: + matchLabels: + app: opodsync + template: + metadata: + labels: + app: opodsync + spec: + containers: + - name: opodsync + image: ganeshlab/opodsync + env: + - name: GPODDER_BASE_URL + value: "https://gpodder.f3s.buetow.org/gpodder" + - name: GPODDER_ALLOW_REGISTRATIONS + value: "true" + ports: + - containerPort: 8080 + volumeMounts: + - name: opodsync-data + mountPath: /var/www/server/data + - name: nginx-proxy + image: nginx:1.25-alpine + ports: + - containerPort: 8081 + volumeMounts: + - name: nginx-config + mountPath: /etc/nginx/nginx.conf + subPath: nginx.conf + volumes: + - name: opodsync-data + persistentVolumeClaim: + claimName: opodsync-data-pvc + - name: nginx-config + configMap: + name: opodsync-nginx-config diff --git a/f3s/opodsync/helm-chart/templates/ingress.yaml b/f3s/opodsync/helm-chart/templates/ingress.yaml new file mode 100644 index 0000000..9f59714 --- /dev/null +++ b/f3s/opodsync/helm-chart/templates/ingress.yaml @@ -0,0 +1,30 @@ +apiVersion: networking.k8s.io/v1 +kind: Ingress +metadata: + name: opodsync-ingress + namespace: services + annotations: + traefik.ingress.kubernetes.io/router.entrypoints: web +spec: + ingressClassName: traefik + rules: + - host: gpodder.f3s.buetow.org + http: + paths: + - path: / + pathType: Prefix + backend: + service: + name: opodsync-service + port: + number: 80 + - host: opodsync.f3s.buetow.org + http: + paths: + - path: / + pathType: Prefix + backend: + service: + name: opodsync-service + port: + number: 80 diff --git a/f3s/opodsync/helm-chart/templates/persistent-volumes.yaml b/f3s/opodsync/helm-chart/templates/persistent-volumes.yaml new file mode 100644 index 0000000..0a6dedc --- /dev/null +++ b/f3s/opodsync/helm-chart/templates/persistent-volumes.yaml @@ -0,0 +1,27 @@ +apiVersion: v1 +kind: PersistentVolume +metadata: + name: opodsync-data-pv +spec: + capacity: + storage: 1Gi + volumeMode: Filesystem + accessModes: + - ReadWriteOnce + persistentVolumeReclaimPolicy: Retain + hostPath: + path: /data/nfs/k3svolumes/opodsync/data + type: DirectoryOrCreate +--- +apiVersion: v1 +kind: PersistentVolumeClaim +metadata: + name: opodsync-data-pvc + namespace: services +spec: + storageClassName: "" + accessModes: + - ReadWriteOnce + resources: + requests: + storage: 1Gi
\ No newline at end of file diff --git a/f3s/opodsync/helm-chart/templates/service.yaml b/f3s/opodsync/helm-chart/templates/service.yaml new file mode 100644 index 0000000..16763f0 --- /dev/null +++ b/f3s/opodsync/helm-chart/templates/service.yaml @@ -0,0 +1,15 @@ +apiVersion: v1 +kind: Service +metadata: + labels: + app: opodsync + name: opodsync-service + namespace: services +spec: + ports: + - name: web + port: 80 + protocol: TCP + targetPort: 8081 + selector: + app: opodsync |
