diff --git a/k8s/charts/nextcloud/Chart.yaml b/k8s/charts/nextcloud/Chart.yaml deleted file mode 100644 index ae401a4f..00000000 --- a/k8s/charts/nextcloud/Chart.yaml +++ /dev/null @@ -1,5 +0,0 @@ -apiVersion: v2 -name: nextcloud -description: Nextcloud -type: application -version: 0.1.0 diff --git a/k8s/charts/nextcloud/templates/configmap-hooks.yaml b/k8s/charts/nextcloud/templates/configmap-hooks.yaml deleted file mode 100644 index a70578a2..00000000 --- a/k8s/charts/nextcloud/templates/configmap-hooks.yaml +++ /dev/null @@ -1,51 +0,0 @@ -apiVersion: v1 -kind: ConfigMap -metadata: - name: {{ .Chart.Name }}-hooks - labels: - app: {{ .Chart.Name }} -data: - oidc.sh: | - #!/bin/sh - set -eu - - occ() { - if [ "$(id -u)" = 0 ]; then - su -p www-data -s /bin/sh -c "php /var/www/html/occ $*" - else - php /var/www/html/occ "$@" - fi - } - - echo "[office-hook] configuring richdocuments -> Collabora" - if occ app:install richdocuments 2>/dev/null || occ app:enable richdocuments; then - occ config:app:set richdocuments wopi_url --value="http://collabora.default.svc:9980" || true - occ config:app:set richdocuments public_wopi_url --value="https://collabora.cute.haus" || true - occ config:app:delete richdocuments wopi_allowlist || true - occ richdocuments:activate-config --callback-url=https://nextcloud.cute.haus || true - else - echo "[office-hook] WARNING: richdocuments install/enable failed (non-fatal)" - fi - - if [ -z "${OIDC_CLIENT_ID:-}" ] || [ -z "${OIDC_CLIENT_SECRET:-}" ]; then - echo "[oidc-hook] nextcloud-sso-env not present yet; skipping Pocket ID setup" - exit 0 - fi - - echo "[oidc-hook] installing/enabling user_oidc" - occ app:install user_oidc || true - occ app:enable user_oidc - - echo "[oidc-hook] reconciling Pocket ID provider" - occ user_oidc:provider cute.haus \ - --clientid="$OIDC_CLIENT_ID" \ - --clientsecret="$OIDC_CLIENT_SECRET" \ - --discoveryuri="https://id.cute.haus/.well-known/openid-configuration" \ - --scope="openid email profile" \ - --mapping-uid=preferred_username \ - --mapping-email=email \ - --mapping-display-name=name \ - --unique-uid=0 \ - || echo "[oidc-hook] WARNING: provider registration failed (non-fatal); SSO may be unconfigured" - - echo "[oidc-hook] done" diff --git a/k8s/charts/nextcloud/templates/configmap.yaml b/k8s/charts/nextcloud/templates/configmap.yaml deleted file mode 100644 index cc22698c..00000000 --- a/k8s/charts/nextcloud/templates/configmap.yaml +++ /dev/null @@ -1,39 +0,0 @@ -apiVersion: v1 -kind: ConfigMap -metadata: - name: {{ .Chart.Name }}-config - labels: - app: {{ .Chart.Name }} -data: - NEXTCLOUD_ADMIN_USER: "alyraffauf" - NEXTCLOUD_TRUSTED_DOMAINS: "nextcloud.cute.haus" - OVERWRITEPROTOCOL: "https" - OVERWRITEHOST: "nextcloud.cute.haus" - OVERWRITECLIURL: "https://nextcloud.cute.haus" - TRUSTED_PROXIES: "10.42.0.0/16" - APACHE_DISABLE_REWRITE_IP: "1" - PHP_MEMORY_LIMIT: "512M" - PHP_UPLOAD_LIMIT: "10G" - - POSTGRES_HOST: "pg-shared-rw.cnpg-system.svc" - POSTGRES_DB: "nextcloud" - POSTGRES_USER: "nextcloud" - - REDIS_HOST: "valkey.nextcloud.svc" - REDIS_HOST_PORT: "6379" - - OBJECTSTORE_S3_BUCKET: "aly-nextcloud" - OBJECTSTORE_S3_REGION: "garage" - OBJECTSTORE_S3_HOST: "10.254.0.1" - OBJECTSTORE_S3_PORT: "3900" - OBJECTSTORE_S3_SSL: "false" - OBJECTSTORE_S3_USEPATH_STYLE: "true" - OBJECTSTORE_S3_AUTOCREATE: "false" - - SMTP_HOST: "smtp.resend.com" - SMTP_SECURE: "ssl" - SMTP_PORT: "465" - SMTP_AUTHTYPE: "LOGIN" - SMTP_NAME: "resend" - MAIL_FROM_ADDRESS: "admin" - MAIL_DOMAIN: "aly.social" diff --git a/k8s/charts/nextcloud/templates/deployment.yaml b/k8s/charts/nextcloud/templates/deployment.yaml deleted file mode 100644 index 904c9ddf..00000000 --- a/k8s/charts/nextcloud/templates/deployment.yaml +++ /dev/null @@ -1,124 +0,0 @@ -apiVersion: apps/v1 -kind: Deployment -metadata: - name: {{ .Chart.Name }} - labels: - app: {{ .Chart.Name }} -spec: - replicas: 1 - strategy: - type: Recreate - selector: - matchLabels: - app: {{ .Chart.Name }} - template: - metadata: - labels: - app: {{ .Chart.Name }} - spec: - automountServiceAccountToken: false - enableServiceLinks: false - nodeSelector: - kubernetes.io/hostname: jubilife - terminationGracePeriodSeconds: 30 - securityContext: - fsGroup: 33 - seccompProfile: - type: RuntimeDefault - tolerations: - - key: node.kubernetes.io/not-ready - operator: Exists - effect: NoExecute - tolerationSeconds: {{ $.Values.global.failover.fastTolerationSeconds | default 60 }} - - key: node.kubernetes.io/unreachable - operator: Exists - effect: NoExecute - tolerationSeconds: {{ $.Values.global.failover.fastTolerationSeconds | default 60 }} - containers: - - name: {{ .Chart.Name }} - image: docker.io/library/nextcloud:34-apache@sha256:6eb64bc58acd8dd751415f15c470d397fe922cefbd154e48480f5fcd9ce3a8e5 - imagePullPolicy: IfNotPresent - envFrom: - - configMapRef: - name: {{ .Chart.Name }}-config - - secretRef: - name: {{ .Chart.Name }}-env - - secretRef: - name: {{ .Chart.Name }}-garage-env - - secretRef: - name: {{ .Chart.Name }}-sso-env - optional: true - ports: - - name: http - containerPort: 80 - resources: - requests: - cpu: 500m - memory: 1Gi - limits: - cpu: "4" - memory: 4Gi - volumeMounts: - - name: html - mountPath: /var/www/html - - name: hooks - mountPath: /docker-entrypoint-hooks.d/before-starting - startupProbe: - httpGet: - path: /status.php - port: http - periodSeconds: 10 - failureThreshold: 90 - timeoutSeconds: 5 - livenessProbe: - httpGet: - path: /status.php - port: http - periodSeconds: 60 - timeoutSeconds: 15 - readinessProbe: - httpGet: - path: /status.php - port: http - periodSeconds: 10 - timeoutSeconds: 10 - failureThreshold: 3 - - name: cron - image: docker.io/library/nextcloud:34-apache@sha256:6eb64bc58acd8dd751415f15c470d397fe922cefbd154e48480f5fcd9ce3a8e5 - imagePullPolicy: IfNotPresent - command: - - /bin/sh - - -c - - | - while true; do - php -f /var/www/html/cron.php || true - sleep 60 - done - securityContext: - runAsUser: 33 - runAsGroup: 33 - envFrom: - - configMapRef: - name: {{ .Chart.Name }}-config - - secretRef: - name: {{ .Chart.Name }}-env - - secretRef: - name: {{ .Chart.Name }}-garage-env - resources: - requests: - cpu: 50m - memory: 128Mi - limits: - cpu: "1" - memory: 512Mi - volumeMounts: - - name: html - mountPath: /var/www/html - volumes: - - name: html - persistentVolumeClaim: - claimName: {{ .Chart.Name }}-html - - name: hooks - configMap: - name: {{ .Chart.Name }}-hooks - defaultMode: 0755 diff --git a/k8s/charts/nextcloud/templates/ingress.yaml b/k8s/charts/nextcloud/templates/ingress.yaml deleted file mode 100644 index 93e3a258..00000000 --- a/k8s/charts/nextcloud/templates/ingress.yaml +++ /dev/null @@ -1,23 +0,0 @@ -apiVersion: networking.k8s.io/v1 -kind: Ingress -metadata: - name: {{ .Chart.Name }} - labels: - app: {{ .Chart.Name }} -spec: - ingressClassName: traefik - tls: - - hosts: - - "nextcloud.cute.haus" - secretName: cute-haus-tls - rules: - - host: "nextcloud.cute.haus" - http: - paths: - - path: / - pathType: Prefix - backend: - service: - name: {{ .Chart.Name }} - port: - number: 80 diff --git a/k8s/charts/nextcloud/templates/pvc.yaml b/k8s/charts/nextcloud/templates/pvc.yaml deleted file mode 100644 index cf78549f..00000000 --- a/k8s/charts/nextcloud/templates/pvc.yaml +++ /dev/null @@ -1,41 +0,0 @@ -apiVersion: v1 -kind: PersistentVolume -metadata: - name: {{ .Chart.Name }}-html - labels: - app: {{ .Chart.Name }} -spec: - capacity: - storage: 8Gi - accessModes: - - ReadWriteOnce - persistentVolumeReclaimPolicy: Retain - storageClassName: "" - nodeAffinity: - required: - nodeSelectorTerms: - - matchExpressions: - - key: kubernetes.io/hostname - operator: In - values: - - jubilife - hostPath: - path: /mnt/Data/nextcloud/html - type: Directory ---- -apiVersion: v1 -kind: PersistentVolumeClaim -metadata: - name: {{ .Chart.Name }}-html - labels: - app: {{ .Chart.Name }} - annotations: - helm.sh/resource-policy: keep -spec: - accessModes: - - ReadWriteOnce - storageClassName: "" - volumeName: {{ .Chart.Name }}-html - resources: - requests: - storage: 8Gi diff --git a/k8s/charts/nextcloud/templates/service.yaml b/k8s/charts/nextcloud/templates/service.yaml deleted file mode 100644 index 1599a24c..00000000 --- a/k8s/charts/nextcloud/templates/service.yaml +++ /dev/null @@ -1,14 +0,0 @@ -apiVersion: v1 -kind: Service -metadata: - name: {{ .Chart.Name }} - labels: - app: {{ .Chart.Name }} -spec: - type: ClusterIP - selector: - app: {{ .Chart.Name }} - ports: - - name: http - port: 80 - targetPort: http diff --git a/k8s/flux/apps/kustomization.yaml b/k8s/flux/apps/kustomization.yaml index 63d54c58..f71c106b 100644 --- a/k8s/flux/apps/kustomization.yaml +++ b/k8s/flux/apps/kustomization.yaml @@ -7,7 +7,6 @@ resources: - forward-auth.yaml - morsels.yaml - navidrome.yaml - - nextcloud.yaml - ombi.yaml - paperless.yaml - pocket-id diff --git a/k8s/flux/apps/nextcloud.yaml b/k8s/flux/apps/nextcloud.yaml deleted file mode 100644 index 99284cef..00000000 --- a/k8s/flux/apps/nextcloud.yaml +++ /dev/null @@ -1,24 +0,0 @@ -apiVersion: helm.toolkit.fluxcd.io/v2 -kind: HelmRelease -metadata: - name: nextcloud - namespace: flux-system -spec: - suspend: true - dependsOn: - - name: pg-shared - - name: valkey-nextcloud - interval: 15m - releaseName: nextcloud - targetNamespace: nextcloud - install: { remediation: { retries: 3 } } - upgrade: { remediation: { retries: 3 } } - chart: - spec: - chart: ./k8s/charts/nextcloud - interval: 15m - reconcileStrategy: Revision - sourceRef: - { kind: GitRepository, name: flux-system, namespace: flux-system } - valuesFrom: - - { kind: ConfigMap, name: cute-haus-global, valuesKey: values.yaml } diff --git a/k8s/flux/external-routes/external-routes.yaml b/k8s/flux/external-routes/external-routes.yaml index ceb7bac6..55a7e006 100644 --- a/k8s/flux/external-routes/external-routes.yaml +++ b/k8s/flux/external-routes/external-routes.yaml @@ -42,6 +42,13 @@ spec: port: 2283 tls: secretName: cute-haus-tls + - name: nextcloud + host: nextcloud.cute.haus + target: + ip: 10.254.0.1 + port: 8081 + tls: + secretName: cute-haus-tls - name: slingshot host: slingshot.cute.haus target: diff --git a/k8s/flux/platform/kustomization.yaml b/k8s/flux/platform/kustomization.yaml index 45a02e08..0a05c901 100644 --- a/k8s/flux/platform/kustomization.yaml +++ b/k8s/flux/platform/kustomization.yaml @@ -7,4 +7,3 @@ resources: - pg-shared.yaml - tika - valkey.yaml - - valkey-nextcloud.yaml diff --git a/k8s/flux/platform/valkey-nextcloud.yaml b/k8s/flux/platform/valkey-nextcloud.yaml deleted file mode 100644 index 4acb6768..00000000 --- a/k8s/flux/platform/valkey-nextcloud.yaml +++ /dev/null @@ -1,37 +0,0 @@ -apiVersion: helm.toolkit.fluxcd.io/v2 -kind: HelmRelease -metadata: - name: valkey-nextcloud - namespace: flux-system -spec: - interval: 15m - releaseName: valkey-nextcloud - targetNamespace: nextcloud - install: - remediation: - retries: 3 - upgrade: - remediation: - retries: 3 - chart: - spec: - chart: ./k8s/charts/valkey - interval: 15m - reconcileStrategy: Revision - sourceRef: - kind: GitRepository - name: flux-system - namespace: flux-system - valuesFrom: - - kind: ConfigMap - name: cute-haus-global - valuesKey: values.yaml - # Nextcloud-only instance: file locks + session + cache are small and - # ephemeral, so cap memory well below the shared instance's 1gb. - values: - args: - - valkey-server - - --maxmemory - - 256mb - - --maxmemory-policy - - volatile-lru