From b9b5b71b5582e4253e260f62750aab3519094aca Mon Sep 17 00:00:00 2001 From: Lorenzo Corallo Date: Tue, 10 Nov 2026 12:31:53 +0100 Subject: [PATCH] feat(kuvasz): replace Uptime Kuma with Kuvasz behind auth.polinetwork.org Kuvasz signs in through auth.polinetwork.org. It cannot check roles, so an oauth2-proxy gate in front of its /oauth sign-in routes admits only it-member (the groups claim carries inherited roles, so it-lead too). Public status pages, assets and push heartbeats stay anonymous. Monitors and status pages live in apps/kuvasz/kuvasz.yml. status.polinetwork.org serves the public page; the default page with internal monitors is private. Uptime Kuma's PVC and namespace are kept (prune disabled) for rollback. --- .../k3s-application-backup.service.j2 | 2 +- .../templates/k3s-application-backup.sh.j2 | 1 - apps/backend/network-policy.yaml | 6 +- apps/kuvasz/deployment-gate.yaml | 121 +++++++++++++++ apps/kuvasz/deployment-kuvasz.yaml | 138 ++++++++++++++++++ apps/kuvasz/external-secret.yaml | 45 ++++++ apps/kuvasz/ingress.yaml | 108 ++++++++++++++ apps/kuvasz/kustomization.yaml | 20 +++ apps/kuvasz/kuvasz.yml | 75 ++++++++++ apps/kuvasz/middleware.yaml | 32 ++++ apps/{uptime-kuma => kuvasz}/namespace.yaml | 2 +- apps/kuvasz/network-policy.yaml | 26 ++++ apps/uptime-kuma/deployment.yaml | 56 ------- apps/uptime-kuma/ingress.yaml | 30 ---- apps/uptime-kuma/kustomization.yaml | 9 -- clusters/k3s/apps/kustomization.yaml | 2 +- .../apps/{uptime-kuma.yaml => kuvasz.yaml} | 6 +- .../secret-stores/cluster-secret-stores.yaml | 1 + 18 files changed, 575 insertions(+), 105 deletions(-) create mode 100644 apps/kuvasz/deployment-gate.yaml create mode 100644 apps/kuvasz/deployment-kuvasz.yaml create mode 100644 apps/kuvasz/external-secret.yaml create mode 100644 apps/kuvasz/ingress.yaml create mode 100644 apps/kuvasz/kustomization.yaml create mode 100644 apps/kuvasz/kuvasz.yml create mode 100644 apps/kuvasz/middleware.yaml rename apps/{uptime-kuma => kuvasz}/namespace.yaml (83%) create mode 100644 apps/kuvasz/network-policy.yaml delete mode 100644 apps/uptime-kuma/deployment.yaml delete mode 100644 apps/uptime-kuma/ingress.yaml delete mode 100644 apps/uptime-kuma/kustomization.yaml rename clusters/k3s/apps/{uptime-kuma.yaml => kuvasz.yaml} (80%) diff --git a/ansible/roles/backup/templates/k3s-application-backup.service.j2 b/ansible/roles/backup/templates/k3s-application-backup.service.j2 index cecddd7..450a9b7 100644 --- a/ansible/roles/backup/templates/k3s-application-backup.service.j2 +++ b/ansible/roles/backup/templates/k3s-application-backup.service.j2 @@ -16,4 +16,4 @@ PrivateTmp=true ProtectHome=true ProtectSystem=strict # SQLite needs write access to the WAL index of the databases it copies. -ReadWritePaths=/srv/standard/backups/k3s-applications /srv/standard/volumes/uptime-kuma /srv/standard/volumes/monitoring /var/lib/node_exporter/textfile_collector +ReadWritePaths=/srv/standard/backups/k3s-applications /srv/standard/volumes/monitoring /var/lib/node_exporter/textfile_collector diff --git a/ansible/roles/backup/templates/k3s-application-backup.sh.j2 b/ansible/roles/backup/templates/k3s-application-backup.sh.j2 index f10a1ec..44f9184 100644 --- a/ansible/roles/backup/templates/k3s-application-backup.sh.j2 +++ b/ansible/roles/backup/templates/k3s-application-backup.sh.j2 @@ -71,7 +71,6 @@ sqlite_backup() { tar -C "$dir" --exclude="./${db}" --exclude="./${db}-*" --exclude=./lost+found \ -cf "${work_dir}/${name}-files.tar" . } -sqlite_backup "${volumes}/uptime-kuma/uptime-pvc" kuma.db uptime-kuma sqlite_backup "${volumes}/monitoring/grafana-pvc" grafana.db grafana # Vaultwarden: the vault itself is in the PostgreSQL dump; the volume keeps the diff --git a/apps/backend/network-policy.yaml b/apps/backend/network-policy.yaml index f460e35..72c9570 100644 --- a/apps/backend/network-policy.yaml +++ b/apps/backend/network-policy.yaml @@ -1,7 +1,7 @@ # Only the in-cluster callers may reach the backend (RFC v3 ยง12): the admin # dashboard and the website (tRPC, esign agent proxy), the Telegram bot (tRPC # and its socket), the IdP (access-changed events on /internal/events) and -# Uptime Kuma (health monitoring). +# Kuvasz (uptime monitoring). # Nothing reaches it from outside the cluster since the Ingress was removed. apiVersion: networking.k8s.io/v1 kind: NetworkPolicy @@ -41,10 +41,10 @@ spec: app: auth - namespaceSelector: matchLabels: - kubernetes.io/metadata.name: uptime-kuma + kubernetes.io/metadata.name: kuvasz podSelector: matchLabels: - app: uptime-kuma + app: kuvasz ports: - port: 3000 protocol: TCP diff --git a/apps/kuvasz/deployment-gate.yaml b/apps/kuvasz/deployment-gate.yaml new file mode 100644 index 0000000..c1b61d0 --- /dev/null +++ b/apps/kuvasz/deployment-gate.yaml @@ -0,0 +1,121 @@ +# oauth2-proxy as a Traefik forwardAuth endpoint. It admits only people whose +# `groups` claim (their roles, inheritance expanded) contains it-member, and +# guards nothing but Kuvasz's sign-in routes, so status pages and push +# heartbeats stay public and Kuvasz keeps its own sessions. +# Redirect URI: https://uptime.polinetwork.org/oauth2/callback +apiVersion: v1 +kind: Service +metadata: + name: kuvasz-gate + labels: + app: kuvasz-gate +spec: + ports: + - name: http + port: 4180 + targetPort: 4180 + selector: + app: kuvasz-gate +--- +apiVersion: apps/v1 +kind: Deployment +metadata: + name: kuvasz-gate +spec: + replicas: 1 + selector: + matchLabels: + app: kuvasz-gate + template: + metadata: + labels: + app: kuvasz-gate + spec: + automountServiceAccountToken: false + securityContext: + runAsNonRoot: true + runAsUser: 65532 + runAsGroup: 65532 + seccompProfile: + type: RuntimeDefault + containers: + - name: oauth2-proxy + image: quay.io/oauth2-proxy/oauth2-proxy:v7.15.6@sha256:c3415e8660af553f5e18f5d90db050614c02493c0ac6260ac59442f6d9b12048 + imagePullPolicy: IfNotPresent + args: + - --http-address=0.0.0.0:4180 + - --provider=oidc + - --oidc-issuer-url=https://auth.polinetwork.org/api/auth + - --scope=openid profile email polinetwork:identity + - --code-challenge-method=S256 + - --redirect-url=https://uptime.polinetwork.org/oauth2/callback + - --whitelist-domain=uptime.polinetwork.org + - --oidc-groups-claim=groups + - --allowed-group=it-member + # Access is decided by role, not by address, and Telegram-only + # accounts may have no (verified) email: identify people by sub. + - --oidc-email-claim=sub + - --email-domain=* + - --insecure-oidc-allow-unverified-email=true + # forwardAuth mode: 202 for an admitted person, otherwise a + # redirect to auth.polinetwork.org or a 403. + - --upstream=static://202 + - --reverse-proxy=true + - --trusted-proxy-ip=10.52.0.0/16 + - --skip-provider-button=true + # The gate is only crossed while signing in to Kuvasz, so a short + # session makes every sign-in re-check the role. + - --cookie-name=_kuvasz_gate + - --cookie-secure=true + - --cookie-samesite=lax + - --cookie-expire=15m + - --silence-ping-logging=true + env: + - name: OAUTH2_PROXY_CLIENT_ID + valueFrom: + secretKeyRef: + name: azure-kv + key: gate-client-id + - name: OAUTH2_PROXY_CLIENT_SECRET + valueFrom: + secretKeyRef: + name: azure-kv + key: gate-client-secret + - name: OAUTH2_PROXY_COOKIE_SECRET + valueFrom: + secretKeyRef: + name: azure-kv + key: gate-cookie-secret + ports: + - containerPort: 4180 + startupProbe: + httpGet: + path: /ping + port: 4180 + periodSeconds: 2 + failureThreshold: 30 + readinessProbe: + httpGet: + path: /ready + port: 4180 + periodSeconds: 10 + timeoutSeconds: 2 + failureThreshold: 3 + livenessProbe: + httpGet: + path: /ping + port: 4180 + periodSeconds: 30 + timeoutSeconds: 5 + failureThreshold: 3 + securityContext: + allowPrivilegeEscalation: false + readOnlyRootFilesystem: true + capabilities: + drop: [ALL] + resources: + requests: + cpu: "5m" + memory: "16Mi" + limits: + memory: "64Mi" diff --git a/apps/kuvasz/deployment-kuvasz.yaml b/apps/kuvasz/deployment-kuvasz.yaml new file mode 100644 index 0000000..cee1b0a --- /dev/null +++ b/apps/kuvasz/deployment-kuvasz.yaml @@ -0,0 +1,138 @@ +apiVersion: v1 +kind: Service +metadata: + name: kuvasz + labels: + app: kuvasz +spec: + ports: + - name: http + port: 8080 + targetPort: 8080 + selector: + app: kuvasz +--- +apiVersion: apps/v1 +kind: Deployment +metadata: + name: kuvasz +spec: + replicas: 1 + # A second instance would run every check twice and send duplicate alerts. + strategy: + type: Recreate + selector: + matchLabels: + app: kuvasz + template: + metadata: + labels: + app: kuvasz + spec: + automountServiceAccountToken: false + securityContext: + runAsNonRoot: true + runAsUser: 1000 + runAsGroup: 1000 + seccompProfile: + type: RuntimeDefault + containers: + - name: kuvasz + image: kuvaszmonitoring/kuvasz:4.7.0@sha256:e511ec42bcf2e64a6147ba17bff85fcf565dec54a24099c5e448d7767a07f335 + imagePullPolicy: IfNotPresent + ports: + - containerPort: 8080 + env: + - name: TZ + value: "Europe/Rome" + - name: DATABASE_HOST + value: "postgres-service.postgres.svc.cluster.local" + - name: DATABASE_NAME + value: "kuvasz" + - name: DATABASE_USER + valueFrom: + secretKeyRef: + name: azure-kv + key: db-user + - name: DATABASE_PASSWORD + valueFrom: + secretKeyRef: + name: azure-kv + key: db-pass + # Sign-in only through auth.polinetwork.org; with OIDC on, Kuvasz + # disables its username/password form (ADMIN_USER is unused). + # Kuvasz cannot check roles, so the it-member restriction lives in + # the gate in front of /oauth (ingress.yaml). + # Redirect URI: https://uptime.polinetwork.org/oauth/callback/oidc + # Post-logout URI: https://uptime.polinetwork.org/auth/logout + - name: ENABLE_OIDC + value: "true" + - name: OIDC_ISSUER + value: "https://auth.polinetwork.org/api/auth" + - name: OIDC_CLIENT_ID + valueFrom: + secretKeyRef: + name: azure-kv + key: oidc-client-id + - name: OIDC_CLIENT_SECRET + valueFrom: + secretKeyRef: + name: azure-kv + key: oidc-client-secret + # Bounds how long someone removed from IT keeps an open session. + - name: AUTH_MAX_AGE + value: "28800" + # Kuvasz builds its OIDC redirect URI from these headers; Traefik + # sets X-Forwarded-Host, the forwarded-https middleware the scheme. + - name: MICRONAUT_SERVER_HOST_RESOLUTION_HOST_HEADER + value: "X-Forwarded-Host" + - name: MICRONAUT_SERVER_HOST_RESOLUTION_PROTOCOL_HEADER + value: "X-Forwarded-Proto" + # The image is pinned; upgrades go through this file. + - name: ENABLE_CHECK_UPDATES + value: "false" + startupProbe: + httpGet: + path: /api/v2/health + port: 8080 + periodSeconds: 2 + failureThreshold: 90 + readinessProbe: + httpGet: + path: /api/v2/health + port: 8080 + periodSeconds: 10 + timeoutSeconds: 2 + failureThreshold: 3 + livenessProbe: + httpGet: + path: /api/v2/health + port: 8080 + periodSeconds: 30 + timeoutSeconds: 5 + failureThreshold: 3 + securityContext: + allowPrivilegeEscalation: false + readOnlyRootFilesystem: true + capabilities: + drop: [ALL] + resources: + requests: + cpu: "50m" + memory: "384Mi" + limits: + memory: "768Mi" + volumeMounts: + - name: config + mountPath: /config + readOnly: true + # The only path Kuvasz writes to (YAML exports). + - name: tmp + mountPath: /tmp + volumes: + - name: config + configMap: + name: kuvasz-config + - name: tmp + emptyDir: + sizeLimit: 64Mi diff --git a/apps/kuvasz/external-secret.yaml b/apps/kuvasz/external-secret.yaml new file mode 100644 index 0000000..634295b --- /dev/null +++ b/apps/kuvasz/external-secret.yaml @@ -0,0 +1,45 @@ +# The role and database are created once by hand on postgres-service: +# CREATE ROLE kuvasz LOGIN PASSWORD '...'; +# CREATE DATABASE kuvasz OWNER kuvasz; +# Kuvasz creates and migrates its own `kuvasz` schema on startup. +# +# Two OIDC clients on auth.polinetwork.org (see ingress.yaml): +# - kuvasz-oidc-*: Kuvasz's own sign-in. +# - kuvasz-gate-oidc-*: oauth2-proxy, which admits only it-member to Kuvasz's +# sign-in routes. kuvasz-gate-cookie-secret is 32 random bytes, base64url: +# openssl rand -base64 32 | tr -- '+/' '-_' +apiVersion: external-secrets.io/v1 +kind: ExternalSecret +metadata: + name: azure-kv +spec: + refreshInterval: 1h + secretStoreRef: + kind: ClusterSecretStore + name: kv-pn-apps + target: + name: azure-kv + creationPolicy: Owner + deletionPolicy: Retain + data: + - secretKey: db-user + remoteRef: + key: kuvasz-postgres-user + - secretKey: db-pass + remoteRef: + key: kuvasz-postgres-password + - secretKey: oidc-client-id + remoteRef: + key: kuvasz-oidc-client-id + - secretKey: oidc-client-secret + remoteRef: + key: kuvasz-oidc-client-secret + - secretKey: gate-client-id + remoteRef: + key: kuvasz-gate-oidc-client-id + - secretKey: gate-client-secret + remoteRef: + key: kuvasz-gate-oidc-client-secret + - secretKey: gate-cookie-secret + remoteRef: + key: kuvasz-gate-cookie-secret diff --git a/apps/kuvasz/ingress.yaml b/apps/kuvasz/ingress.yaml new file mode 100644 index 0000000..a71e845 --- /dev/null +++ b/apps/kuvasz/ingress.yaml @@ -0,0 +1,108 @@ +# Cloudflare Tunnel sends every HTTP hostname to Traefik, which routes by host. +# +# uptime.polinetwork.org: Kuvasz, signed in through auth.polinetwork.org. +# Kuvasz cannot restrict who signs in, so its sign-in routes (/oauth/login and +# /oauth/callback; Kuvasz serves nothing else under /oauth) go through the +# it-member gate. Without the gate's cookie nobody completes a Kuvasz sign-in; +# everything else is guarded by Kuvasz's own session, except what Kuvasz +# deliberately serves anonymously: public status pages, assets, push +# heartbeats and /api/v2/health. +apiVersion: networking.k8s.io/v1 +kind: Ingress +metadata: + name: kuvasz + annotations: + traefik.ingress.kubernetes.io/router.entrypoints: web + traefik.ingress.kubernetes.io/router.middlewares: kuvasz-forwarded-https@kubernetescrd +spec: + ingressClassName: traefik + rules: + - host: uptime.polinetwork.org + http: + paths: + - path: / + pathType: Prefix + backend: + service: + name: kuvasz + port: + number: 8080 + # oauth2-proxy's own sign-in and callback. + - path: /oauth2 + pathType: Prefix + backend: + service: + name: kuvasz-gate + port: + number: 4180 +--- +apiVersion: networking.k8s.io/v1 +kind: Ingress +metadata: + name: kuvasz-sign-in + annotations: + traefik.ingress.kubernetes.io/router.entrypoints: web + traefik.ingress.kubernetes.io/router.middlewares: kuvasz-forwarded-https@kubernetescrd,kuvasz-it-member-gate@kubernetescrd +spec: + ingressClassName: traefik + rules: + - host: uptime.polinetwork.org + http: + paths: + - path: /oauth + pathType: Prefix + backend: + service: + name: kuvasz + port: + number: 8080 +--- +# status.polinetwork.org: only the public status page and its assets. +apiVersion: networking.k8s.io/v1 +kind: Ingress +metadata: + name: kuvasz-status + annotations: + traefik.ingress.kubernetes.io/router.entrypoints: web + traefik.ingress.kubernetes.io/router.middlewares: kuvasz-forwarded-https@kubernetescrd +spec: + ingressClassName: traefik + rules: + - host: status.polinetwork.org + http: + paths: + - path: /status/polinetwork + pathType: Exact + backend: + service: + name: kuvasz + port: + number: 8080 + - path: /public + pathType: Prefix + backend: + service: + name: kuvasz + port: + number: 8080 +--- +apiVersion: networking.k8s.io/v1 +kind: Ingress +metadata: + name: kuvasz-status-redirect + annotations: + traefik.ingress.kubernetes.io/router.entrypoints: web + traefik.ingress.kubernetes.io/router.middlewares: kuvasz-status-page-redirect@kubernetescrd +spec: + ingressClassName: traefik + rules: + - host: status.polinetwork.org + http: + paths: + - path: / + pathType: Exact + backend: + service: + name: kuvasz + port: + number: 8080 diff --git a/apps/kuvasz/kustomization.yaml b/apps/kuvasz/kustomization.yaml new file mode 100644 index 0000000..6abb217 --- /dev/null +++ b/apps/kuvasz/kustomization.yaml @@ -0,0 +1,20 @@ +apiVersion: kustomize.config.k8s.io/v1beta1 +kind: Kustomization + +namespace: kuvasz + +resources: + - namespace.yaml + - external-secret.yaml + - deployment-kuvasz.yaml + - deployment-gate.yaml + - middleware.yaml + - ingress.yaml + - network-policy.yaml + +# The generated name carries a content hash, so editing kuvasz.yml rolls out +# Kuvasz, which only reads it on startup. +configMapGenerator: + - name: kuvasz-config + files: + - kuvasz.yml diff --git a/apps/kuvasz/kuvasz.yml b/apps/kuvasz/kuvasz.yml new file mode 100644 index 0000000..94a55ee --- /dev/null +++ b/apps/kuvasz/kuvasz.yml @@ -0,0 +1,75 @@ +# Kuvasz monitors and status pages. Kuvasz loads this file on startup and makes +# every monitor type and status page defined here read-only in the UI. +# A type that is left out stays editable in the UI; an empty list (e.g. +# `push-monitors: []`) deletes every monitor of that type. +# Reference: https://kuvasz-uptime.dev/management/managing-monitors/ + +http-monitors: + # Public endpoints, through Cloudflare like real visitors. + - name: "Website" + url: "https://polinetwork.org" + uptime-check-interval: 60 + - name: "Website (beta)" + url: "https://beta.polinetwork.org" + uptime-check-interval: 60 + - name: "Auth" + url: "https://auth.polinetwork.org/api/auth/.well-known/openid-configuration" + uptime-check-interval: 60 + expected-keyword: "issuer" + - name: "Admin dashboard" + url: "https://admin.polinetwork.org" + uptime-check-interval: 60 + - name: "Live Audience" + url: "https://live.polinetwork.org/healthz" + uptime-check-interval: 60 + - name: "polinet.cc" + url: "https://polinet.cc" + uptime-check-interval: 60 + - name: "Vaultwarden" + url: "https://vault.polinetwork.org/alive" + uptime-check-interval: 60 + - name: "Grafana" + url: "https://monitoring.polinetwork.org/api/health" + uptime-check-interval: 120 + - name: "InfluxDB" + url: "https://influx.polinetwork.org/health" + uptime-check-interval: 120 + - name: "Flux" + url: "https://flux.polinetwork.org" + uptime-check-interval: 300 + # In-cluster only: the backend has no Ingress (apps/backend/network-policy.yaml + # admits this namespace). + - name: "Backend" + url: "http://backend-service.backend.svc.cluster.local:3000/" + uptime-check-interval: 60 + ssl-check-enabled: false + expected-keyword: "hi" + +tcp-monitors: + - name: "PostgreSQL" + host: "postgres-service.postgres.svc.cluster.local" + port: 5432 + uptime-check-interval: 60 + - name: "Redis" + host: "redis-service.redis.svc.cluster.local" + port: 6379 + uptime-check-interval: 60 + +# The default page lists every monitor, internal ones included, so it stays +# private (signed-in users only). +default-status-page: + public: false + title: "PoliNetwork (all monitors)" + +# status.polinetwork.org redirects here. +status-pages: + - title: "PoliNetwork status" + slug: "polinetwork" + public: true + theme-base: "GRAY" + monitors: + - "http:Website" + - "http:Auth" + - "http:Admin dashboard" + - "http:Live Audience" + - "http:polinet.cc" diff --git a/apps/kuvasz/middleware.yaml b/apps/kuvasz/middleware.yaml new file mode 100644 index 0000000..52d691b --- /dev/null +++ b/apps/kuvasz/middleware.yaml @@ -0,0 +1,32 @@ +# Traefik does not trust cloudflared's X-Forwarded-Proto and reports `http` +# (the tunnel ends on the `web` entrypoint). Kuvasz and oauth2-proxy build +# their OIDC redirect URIs from it, and visitors only ever arrive over https. +apiVersion: traefik.io/v1alpha1 +kind: Middleware +metadata: + name: forwarded-https +spec: + headers: + customRequestHeaders: + X-Forwarded-Proto: https +--- +# Admits only it-member to the routes it guards (ingress.yaml). It must come +# after forwarded-https: trustForwardHeader passes that scheme on to the gate. +apiVersion: traefik.io/v1alpha1 +kind: Middleware +metadata: + name: it-member-gate +spec: + forwardAuth: + address: http://kuvasz-gate.kuvasz.svc.cluster.local:4180/ + trustForwardHeader: true +--- +apiVersion: traefik.io/v1alpha1 +kind: Middleware +metadata: + name: status-page-redirect +spec: + redirectRegex: + regex: "^.*$" + replacement: "https://status.polinetwork.org/status/polinetwork" + permanent: false diff --git a/apps/uptime-kuma/namespace.yaml b/apps/kuvasz/namespace.yaml similarity index 83% rename from apps/uptime-kuma/namespace.yaml rename to apps/kuvasz/namespace.yaml index 41bcb92..d548d09 100644 --- a/apps/uptime-kuma/namespace.yaml +++ b/apps/kuvasz/namespace.yaml @@ -1,6 +1,6 @@ apiVersion: v1 kind: Namespace metadata: - name: uptime-kuma + name: kuvasz annotations: kustomize.toolkit.fluxcd.io/prune: disabled diff --git a/apps/kuvasz/network-policy.yaml b/apps/kuvasz/network-policy.yaml new file mode 100644 index 0000000..3abc691 --- /dev/null +++ b/apps/kuvasz/network-policy.yaml @@ -0,0 +1,26 @@ +# Only Traefik reaches Kuvasz and its gate. The gate in particular must not be +# reachable any other way: it trusts the X-Forwarded-* headers it is sent. +apiVersion: networking.k8s.io/v1 +kind: NetworkPolicy +metadata: + name: allow-traefik +spec: + podSelector: + matchExpressions: + - key: app + operator: In + values: [kuvasz, kuvasz-gate] + policyTypes: [Ingress] + ingress: + - from: + - namespaceSelector: + matchLabels: + kubernetes.io/metadata.name: kube-system + podSelector: + matchLabels: + app.kubernetes.io/name: traefik + ports: + - port: 8080 + protocol: TCP + - port: 4180 + protocol: TCP diff --git a/apps/uptime-kuma/deployment.yaml b/apps/uptime-kuma/deployment.yaml deleted file mode 100644 index 1f4f30c..0000000 --- a/apps/uptime-kuma/deployment.yaml +++ /dev/null @@ -1,56 +0,0 @@ -apiVersion: v1 -kind: PersistentVolumeClaim -metadata: - annotations: - kustomize.toolkit.fluxcd.io/prune: disabled - name: uptime-pvc -spec: - accessModes: - - ReadWriteOnce - storageClassName: standard - resources: - requests: - storage: 200Mi ---- -apiVersion: apps/v1 -kind: Deployment -metadata: - name: uptime-kuma - namespace: uptime-kuma -spec: - replicas: 1 - selector: - matchLabels: - app: uptime-kuma - template: - metadata: - labels: - app: uptime-kuma - spec: - containers: - - name: uptime-kuma-pod - image: louislam/uptime-kuma@sha256:4c364ef96aaddac7ec4c85f5e5f31c3394d35f631381ccbbf93f18fd26ac7cba - imagePullPolicy: IfNotPresent - ports: - - containerPort: 3001 - volumeMounts: - - name: uptime-pvc - mountPath: /app/data - volumes: - - name: uptime-pvc - persistentVolumeClaim: - claimName: uptime-pvc ---- -apiVersion: v1 -kind: Service -metadata: - name: uptime-service - labels: - app: uptime-kuma -spec: - ports: - - name: uptime-kuma - port: 3001 - targetPort: 3001 - selector: - app: uptime-kuma diff --git a/apps/uptime-kuma/ingress.yaml b/apps/uptime-kuma/ingress.yaml deleted file mode 100644 index 00988cd..0000000 --- a/apps/uptime-kuma/ingress.yaml +++ /dev/null @@ -1,30 +0,0 @@ -# Cloudflare Tunnel sends every HTTP hostname to Traefik, which routes by host. -apiVersion: networking.k8s.io/v1 -kind: Ingress -metadata: - name: uptime-kuma - annotations: - traefik.ingress.kubernetes.io/router.entrypoints: web -spec: - ingressClassName: traefik - rules: - - host: uptime.polinetwork.org - http: - paths: - - path: / - pathType: Prefix - backend: - service: - name: uptime-service - port: - number: 3001 - - host: status.polinetwork.org - http: - paths: - - path: / - pathType: Prefix - backend: - service: - name: uptime-service - port: - number: 3001 diff --git a/apps/uptime-kuma/kustomization.yaml b/apps/uptime-kuma/kustomization.yaml deleted file mode 100644 index c8b8771..0000000 --- a/apps/uptime-kuma/kustomization.yaml +++ /dev/null @@ -1,9 +0,0 @@ -apiVersion: kustomize.config.k8s.io/v1beta1 -kind: Kustomization - -namespace: uptime-kuma - -resources: - - namespace.yaml - - deployment.yaml - - ingress.yaml diff --git a/clusters/k3s/apps/kustomization.yaml b/clusters/k3s/apps/kustomization.yaml index 605f83d..1faf6c2 100644 --- a/clusters/k3s/apps/kustomization.yaml +++ b/clusters/k3s/apps/kustomization.yaml @@ -9,11 +9,11 @@ resources: - bot-mat.yaml - bot-ts.yaml - influxdb.yaml + - kuvasz.yaml - live-audience.yaml - monitoring.yaml - polinetcc.yaml - postgres.yaml - redis.yaml - - uptime-kuma.yaml - vaultwarden.yaml - web.yaml diff --git a/clusters/k3s/apps/uptime-kuma.yaml b/clusters/k3s/apps/kuvasz.yaml similarity index 80% rename from clusters/k3s/apps/uptime-kuma.yaml rename to clusters/k3s/apps/kuvasz.yaml index 2ab8c3c..e4dff4d 100644 --- a/clusters/k3s/apps/uptime-kuma.yaml +++ b/clusters/k3s/apps/kuvasz.yaml @@ -1,13 +1,13 @@ apiVersion: kustomize.toolkit.fluxcd.io/v1 kind: Kustomization metadata: - name: uptime-kuma + name: kuvasz namespace: flux-system spec: dependsOn: - name: infrastructure-secret-stores - - name: infrastructure-storage - name: infrastructure-traefik + - name: postgres interval: 30m retryInterval: 1m timeout: 5m @@ -16,4 +16,4 @@ spec: sourceRef: kind: GitRepository name: flux-system - path: ./apps/uptime-kuma + path: ./apps/kuvasz diff --git a/infrastructure/secret-stores/cluster-secret-stores.yaml b/infrastructure/secret-stores/cluster-secret-stores.yaml index 0cad3a1..c872981 100644 --- a/infrastructure/secret-stores/cluster-secret-stores.yaml +++ b/infrastructure/secret-stores/cluster-secret-stores.yaml @@ -14,6 +14,7 @@ spec: - bot-ts - monitoring - influxdb + - kuvasz - live-audience - polinetcc - postgres