From b9e2b6c6e8ff10a9d8b691cf8e34401ec949bb37 Mon Sep 17 00:00:00 2001 From: Karan Parashar Date: Tue, 18 Aug 2026 01:04:29 +0530 Subject: [PATCH] feat: Setup pre-commit hook --- .githooks/pre-commit | 41 +++++++++++++++++++ apps/jellyfin/httproute-local.yaml | 22 +++++----- apps/jellyfin/httproute.yaml | 22 +++++----- apps/jellyfin/kustomization.yaml | 5 +++ apps/seaweedfs/httproute-filer.yaml | 18 ++++---- apps/seaweedfs/httproute-master.yaml | 18 ++++---- apps/seaweedfs/kustomization.yaml | 5 +++ apps/stirling-pdf/anubis-proxy.yaml | 28 ++++++------- apps/stirling-pdf/httproute.yaml | 23 +++++------ apps/stirling-pdf/kustomization.yaml | 6 +++ argocd-apps/add-ons/anubis-operator.yaml | 16 ++++---- argocd-apps/add-ons/argocd-repos.yaml | 12 +++--- argocd-apps/add-ons/cert-manager.yaml | 20 ++++----- argocd-apps/add-ons/cnpg.yaml | 14 +++---- argocd-apps/add-ons/gateway-api.yaml | 12 +++--- argocd-apps/add-ons/kustomization.yaml | 10 +++++ argocd-apps/add-ons/sealed-secrets.yaml | 12 +++--- argocd-apps/add-ons/traefik.yaml | 20 ++++----- argocd-apps/kustomization.yaml | 19 +-------- argocd-apps/services/autoregexbot.yaml | 10 ++--- argocd-apps/services/betterslcm.yaml | 10 ++--- argocd-apps/services/jellyfin.yaml | 18 ++++---- argocd-apps/services/kustomization.yaml | 11 +++++ .../services/legislative-summarization.yaml | 10 ++--- argocd-apps/services/qbit.yaml | 10 ++--- argocd-apps/services/scriptscribe.yaml | 10 ++--- argocd-apps/services/seaweedfs.yaml | 18 ++++---- argocd-apps/services/stirling-pdf.yaml | 18 ++++---- bootstrap/argocd-root-app/root-app.yaml | 8 ++-- infra/argocd-repos/kustomization.yaml | 4 ++ infra/cert-manager/cluster-issuer.yaml | 6 +-- infra/cert-manager/kustomization.yaml | 5 +++ infra/traefik/kustomization.yaml | 4 ++ infra/traefik/wildcard-whyredfire-dev.yaml | 12 +++--- 34 files changed, 276 insertions(+), 201 deletions(-) create mode 100755 .githooks/pre-commit create mode 100644 apps/jellyfin/kustomization.yaml create mode 100644 apps/seaweedfs/kustomization.yaml create mode 100644 apps/stirling-pdf/kustomization.yaml create mode 100644 argocd-apps/add-ons/kustomization.yaml create mode 100644 argocd-apps/services/kustomization.yaml create mode 100644 infra/argocd-repos/kustomization.yaml create mode 100644 infra/cert-manager/kustomization.yaml create mode 100644 infra/traefik/kustomization.yaml diff --git a/.githooks/pre-commit b/.githooks/pre-commit new file mode 100755 index 0000000..f1bdf6f --- /dev/null +++ b/.githooks/pre-commit @@ -0,0 +1,41 @@ +#!/usr/bin/env bash +set -euo pipefail + +# Normalise staged manifests to their kubectl kustomize output, so what is +# committed is exactly what Argo CD renders. Requires kubectl and yq. + +identity='[.apiVersion, .kind, .metadata.name // ""] | join("|")' + +git diff --cached --name-only --diff-filter=ACM -- '*.yaml' | + while IFS= read -r file; do + dir=$(dirname "$file") + name=$(basename "$file") + [ "$name" = kustomization.yaml ] && continue + + # only normalise files the sibling kustomization lists as a resource, so + # patches and components are never replaced with build output + yq -r '.resources[]? // ""' "$dir/kustomization.yaml" 2>/dev/null | + grep -Fxq "$name" || continue + + rendered=$(mktemp) + kubectl kustomize "$dir" | + yq eval-all "select(($identity) == \"$(yq eval-all "$identity" "$file" | head -1)\")" - >"$rendered" + + if [ -s "$rendered" ] && ! diff -q "$file" "$rendered" >/dev/null; then + cat "$rendered" >"$file" + git add "$file" + echo "normalised $file" + fi + rm -f "$rendered" + + # normalising may have reverted the change entirely + if git diff --cached --quiet -- "$file"; then + git reset -q HEAD -- "$file" + fi + done + +# nothing left staged — prevent an empty commit +if git diff --cached --quiet; then + echo "pre-commit: no meaningful changes, aborting commit" + exit 1 +fi diff --git a/apps/jellyfin/httproute-local.yaml b/apps/jellyfin/httproute-local.yaml index 4ebd4ae..ae85109 100644 --- a/apps/jellyfin/httproute-local.yaml +++ b/apps/jellyfin/httproute-local.yaml @@ -1,23 +1,23 @@ apiVersion: gateway.networking.k8s.io/v1 kind: HTTPRoute metadata: - name: jellyfin-local - namespace: jellyfin annotations: argocd.argoproj.io/sync-wave: "1" + name: jellyfin-local + namespace: jellyfin spec: - parentRefs: - - name: traefik-gateway - namespace: traefik - kind: Gateway - sectionName: websecure hostnames: - jellyfin-local.whyredfire.dev + parentRefs: + - kind: Gateway + name: traefik-gateway + namespace: traefik + sectionName: websecure rules: - - matches: + - backendRefs: + - name: jellyfin + port: 8096 + matches: - path: type: PathPrefix value: / - backendRefs: - - name: jellyfin - port: 8096 diff --git a/apps/jellyfin/httproute.yaml b/apps/jellyfin/httproute.yaml index 3380eab..ce2201a 100644 --- a/apps/jellyfin/httproute.yaml +++ b/apps/jellyfin/httproute.yaml @@ -1,23 +1,23 @@ apiVersion: gateway.networking.k8s.io/v1 kind: HTTPRoute metadata: - name: jellyfin - namespace: jellyfin annotations: argocd.argoproj.io/sync-wave: "1" + name: jellyfin + namespace: jellyfin spec: - parentRefs: - - name: traefik-gateway - namespace: traefik - kind: Gateway - sectionName: websecure hostnames: - jellyfin.whyredfire.dev + parentRefs: + - kind: Gateway + name: traefik-gateway + namespace: traefik + sectionName: websecure rules: - - matches: + - backendRefs: + - name: jellyfin + port: 8096 + matches: - path: type: PathPrefix value: / - backendRefs: - - name: jellyfin - port: 8096 diff --git a/apps/jellyfin/kustomization.yaml b/apps/jellyfin/kustomization.yaml new file mode 100644 index 0000000..dcb0595 --- /dev/null +++ b/apps/jellyfin/kustomization.yaml @@ -0,0 +1,5 @@ +apiVersion: kustomize.config.k8s.io/v1beta1 +kind: Kustomization +resources: + - httproute-local.yaml + - httproute.yaml diff --git a/apps/seaweedfs/httproute-filer.yaml b/apps/seaweedfs/httproute-filer.yaml index 99fe81b..e14867f 100644 --- a/apps/seaweedfs/httproute-filer.yaml +++ b/apps/seaweedfs/httproute-filer.yaml @@ -1,27 +1,27 @@ apiVersion: gateway.networking.k8s.io/v1 kind: HTTPRoute metadata: - name: seaweedfs-filer - namespace: seaweedfs annotations: argocd.argoproj.io/sync-wave: "1" + name: seaweedfs-filer + namespace: seaweedfs spec: + hostnames: + - seaweedfs.whyredfire.dev parentRefs: - group: gateway.networking.k8s.io kind: Gateway name: traefik-gateway namespace: traefik sectionName: websecure - hostnames: - - seaweedfs.whyredfire.dev rules: - - matches: - - path: - type: PathPrefix - value: / - backendRefs: + - backendRefs: - group: "" kind: Service name: seaweedfs-all-in-one port: 8888 weight: 1 + matches: + - path: + type: PathPrefix + value: / diff --git a/apps/seaweedfs/httproute-master.yaml b/apps/seaweedfs/httproute-master.yaml index 766d125..fbc1f6f 100644 --- a/apps/seaweedfs/httproute-master.yaml +++ b/apps/seaweedfs/httproute-master.yaml @@ -1,27 +1,27 @@ apiVersion: gateway.networking.k8s.io/v1 kind: HTTPRoute metadata: - name: seaweedfs-master - namespace: seaweedfs annotations: argocd.argoproj.io/sync-wave: "1" + name: seaweedfs-master + namespace: seaweedfs spec: + hostnames: + - seaweedfs-master.whyredfire.dev parentRefs: - group: gateway.networking.k8s.io kind: Gateway name: traefik-gateway namespace: traefik sectionName: websecure - hostnames: - - seaweedfs-master.whyredfire.dev rules: - - matches: - - path: - type: PathPrefix - value: / - backendRefs: + - backendRefs: - group: "" kind: Service name: seaweedfs-all-in-one port: 9333 weight: 1 + matches: + - path: + type: PathPrefix + value: / diff --git a/apps/seaweedfs/kustomization.yaml b/apps/seaweedfs/kustomization.yaml new file mode 100644 index 0000000..1b52afe --- /dev/null +++ b/apps/seaweedfs/kustomization.yaml @@ -0,0 +1,5 @@ +apiVersion: kustomize.config.k8s.io/v1beta1 +kind: Kustomization +resources: + - httproute-filer.yaml + - httproute-master.yaml diff --git a/apps/stirling-pdf/anubis-proxy.yaml b/apps/stirling-pdf/anubis-proxy.yaml index 1fbdfb2..4ab1cae 100644 --- a/apps/stirling-pdf/anubis-proxy.yaml +++ b/apps/stirling-pdf/anubis-proxy.yaml @@ -1,24 +1,12 @@ apiVersion: anubis.techaro.dev/v1alpha1 kind: AnubisProxy metadata: - name: anubis - namespace: stirling-pdf annotations: argocd.argoproj.io/sync-wave: "1" + name: anubis + namespace: stirling-pdf spec: - target: - service: - name: stirling-pdf - port: 8080 anubis: - image: - tag: v1.26.2 - keys: - existingSecret: anubis-key - persistence: - enabled: false - metrics: - enabled: false envExtra: - name: DIFFICULTY value: "4" @@ -42,6 +30,14 @@ spec: value: "true" - name: SLOG_LEVEL value: INFO + image: + tag: v1.26.2 + keys: + existingSecret: anubis-key + metrics: + enabled: false + persistence: + enabled: false resources: limits: memory: 128Mi @@ -50,3 +46,7 @@ spec: memory: 64Mi networkPolicy: enabled: true + target: + service: + name: stirling-pdf + port: 8080 diff --git a/apps/stirling-pdf/httproute.yaml b/apps/stirling-pdf/httproute.yaml index 9c447bd..f3a5993 100644 --- a/apps/stirling-pdf/httproute.yaml +++ b/apps/stirling-pdf/httproute.yaml @@ -1,24 +1,23 @@ apiVersion: gateway.networking.k8s.io/v1 kind: HTTPRoute metadata: - name: stirling-pdf - namespace: stirling-pdf annotations: argocd.argoproj.io/sync-wave: "2" + name: stirling-pdf + namespace: stirling-pdf spec: - parentRefs: - - name: traefik-gateway - namespace: traefik - kind: Gateway - sectionName: websecure hostnames: - pdf.whyredfire.dev + parentRefs: + - kind: Gateway + name: traefik-gateway + namespace: traefik + sectionName: websecure rules: - - matches: + - backendRefs: + - name: anubis + port: 80 + matches: - path: type: PathPrefix value: / - backendRefs: - - name: anubis - port: 80 - diff --git a/apps/stirling-pdf/kustomization.yaml b/apps/stirling-pdf/kustomization.yaml new file mode 100644 index 0000000..973b541 --- /dev/null +++ b/apps/stirling-pdf/kustomization.yaml @@ -0,0 +1,6 @@ +apiVersion: kustomize.config.k8s.io/v1beta1 +kind: Kustomization +resources: + - anubis-key-sealedsecret.yaml + - anubis-proxy.yaml + - httproute.yaml diff --git a/argocd-apps/add-ons/anubis-operator.yaml b/argocd-apps/add-ons/anubis-operator.yaml index 5f575d6..b5e64ea 100644 --- a/argocd-apps/add-ons/anubis-operator.yaml +++ b/argocd-apps/add-ons/anubis-operator.yaml @@ -1,22 +1,22 @@ apiVersion: argoproj.io/v1alpha1 kind: Application metadata: - name: anubis-operator - namespace: argocd annotations: argocd.argoproj.io/sync-wave: "1" + name: anubis-operator + namespace: argocd spec: + destination: + namespace: anubis-operator-system + server: https://kubernetes.default.svc project: default source: - repoURL: https://github.com/eznix86/anubis-kubernetes-operator.git - targetRevision: v0.4.4 - path: config/default kustomize: images: - public-registry.brunobernard.dev/techarohq/anubis-operator=ghcr.io/eznix86/anubis-kubernetes-operator:0.4.4 - destination: - server: https://kubernetes.default.svc - namespace: anubis-operator-system + path: config/default + repoURL: https://github.com/eznix86/anubis-kubernetes-operator.git + targetRevision: v0.4.4 syncPolicy: automated: prune: true diff --git a/argocd-apps/add-ons/argocd-repos.yaml b/argocd-apps/add-ons/argocd-repos.yaml index 22cc859..59f3382 100644 --- a/argocd-apps/add-ons/argocd-repos.yaml +++ b/argocd-apps/add-ons/argocd-repos.yaml @@ -1,19 +1,19 @@ apiVersion: argoproj.io/v1alpha1 kind: Application metadata: - name: argocd-repos - namespace: argocd annotations: argocd.argoproj.io/sync-wave: "1" + name: argocd-repos + namespace: argocd spec: + destination: + namespace: argocd + server: https://kubernetes.default.svc project: default source: + path: infra/argocd-repos repoURL: https://gitea.whyredfire.dev/whyredfire/gitops.git targetRevision: main - path: infra/argocd-repos - destination: - server: https://kubernetes.default.svc - namespace: argocd syncPolicy: automated: prune: true diff --git a/argocd-apps/add-ons/cert-manager.yaml b/argocd-apps/add-ons/cert-manager.yaml index 8357e94..e52536f 100644 --- a/argocd-apps/add-ons/cert-manager.yaml +++ b/argocd-apps/add-ons/cert-manager.yaml @@ -1,16 +1,17 @@ apiVersion: argoproj.io/v1alpha1 kind: Application metadata: - name: cert-manager - namespace: argocd annotations: argocd.argoproj.io/sync-wave: "1" + name: cert-manager + namespace: argocd spec: + destination: + namespace: cert-manager + server: https://kubernetes.default.svc project: default sources: - - repoURL: https://charts.jetstack.io - chart: cert-manager - targetRevision: v1.21.1 + - chart: cert-manager helm: values: | crds: @@ -20,12 +21,11 @@ spec: kind: ControllerConfiguration featureGates: ExperimentalGatewayAPISupport: true - - repoURL: https://gitea.whyredfire.dev/whyredfire/gitops.git + repoURL: https://charts.jetstack.io + targetRevision: v1.21.1 + - path: infra/cert-manager + repoURL: https://gitea.whyredfire.dev/whyredfire/gitops.git targetRevision: main - path: infra/cert-manager - destination: - server: https://kubernetes.default.svc - namespace: cert-manager syncPolicy: automated: prune: true diff --git a/argocd-apps/add-ons/cnpg.yaml b/argocd-apps/add-ons/cnpg.yaml index 1357439..a290426 100644 --- a/argocd-apps/add-ons/cnpg.yaml +++ b/argocd-apps/add-ons/cnpg.yaml @@ -1,24 +1,24 @@ apiVersion: argoproj.io/v1alpha1 kind: Application metadata: - name: cnpg - namespace: argocd annotations: argocd.argoproj.io/sync-wave: "0" + name: cnpg + namespace: argocd spec: + destination: + namespace: cnpg-system + server: https://kubernetes.default.svc project: default source: - repoURL: https://cloudnative-pg.github.io/charts chart: cloudnative-pg - targetRevision: 0.29.0 helm: values: | replicaCount: 1 config: clusterWide: true - destination: - server: https://kubernetes.default.svc - namespace: cnpg-system + repoURL: https://cloudnative-pg.github.io/charts + targetRevision: 0.29.0 syncPolicy: automated: prune: true diff --git a/argocd-apps/add-ons/gateway-api.yaml b/argocd-apps/add-ons/gateway-api.yaml index 15d9ee4..4fe69af 100644 --- a/argocd-apps/add-ons/gateway-api.yaml +++ b/argocd-apps/add-ons/gateway-api.yaml @@ -1,19 +1,19 @@ apiVersion: argoproj.io/v1alpha1 kind: Application metadata: - name: gateway-api - namespace: argocd annotations: argocd.argoproj.io/sync-wave: "0" + name: gateway-api + namespace: argocd spec: + destination: + namespace: default + server: https://kubernetes.default.svc project: default source: + path: config/crd repoURL: https://github.com/kubernetes-sigs/gateway-api.git targetRevision: v1.6.1 - path: config/crd - destination: - server: https://kubernetes.default.svc - namespace: default syncPolicy: automated: prune: true diff --git a/argocd-apps/add-ons/kustomization.yaml b/argocd-apps/add-ons/kustomization.yaml new file mode 100644 index 0000000..1541697 --- /dev/null +++ b/argocd-apps/add-ons/kustomization.yaml @@ -0,0 +1,10 @@ +apiVersion: kustomize.config.k8s.io/v1beta1 +kind: Kustomization +resources: + - anubis-operator.yaml + - argocd-repos.yaml + - cert-manager.yaml + - cnpg.yaml + - gateway-api.yaml + - sealed-secrets.yaml + - traefik.yaml diff --git a/argocd-apps/add-ons/sealed-secrets.yaml b/argocd-apps/add-ons/sealed-secrets.yaml index e10e454..cac98dd 100644 --- a/argocd-apps/add-ons/sealed-secrets.yaml +++ b/argocd-apps/add-ons/sealed-secrets.yaml @@ -1,19 +1,19 @@ apiVersion: argoproj.io/v1alpha1 kind: Application metadata: - name: sealed-secrets - namespace: argocd annotations: argocd.argoproj.io/sync-wave: "0" + name: sealed-secrets + namespace: argocd spec: + destination: + namespace: sealed-secrets + server: https://kubernetes.default.svc project: default source: - repoURL: https://bitnami.github.io/sealed-secrets chart: sealed-secrets + repoURL: https://bitnami.github.io/sealed-secrets targetRevision: 2.19.1 - destination: - server: https://kubernetes.default.svc - namespace: sealed-secrets syncPolicy: automated: prune: true diff --git a/argocd-apps/add-ons/traefik.yaml b/argocd-apps/add-ons/traefik.yaml index b6fd18e..6aff757 100644 --- a/argocd-apps/add-ons/traefik.yaml +++ b/argocd-apps/add-ons/traefik.yaml @@ -1,16 +1,17 @@ apiVersion: argoproj.io/v1alpha1 kind: Application metadata: - name: traefik - namespace: argocd annotations: argocd.argoproj.io/sync-wave: "2" + name: traefik + namespace: argocd spec: + destination: + namespace: traefik + server: https://kubernetes.default.svc project: default sources: - - repoURL: https://traefik.github.io/charts - chart: traefik - targetRevision: 41.2.0 + - chart: traefik helm: values: | providers: @@ -39,12 +40,11 @@ spec: - kind: Secret name: wildcard-whyredfire-dev group: "" - - repoURL: https://gitea.whyredfire.dev/whyredfire/gitops.git + repoURL: https://traefik.github.io/charts + targetRevision: 41.2.0 + - path: infra/traefik + repoURL: https://gitea.whyredfire.dev/whyredfire/gitops.git targetRevision: main - path: infra/traefik - destination: - server: https://kubernetes.default.svc - namespace: traefik syncPolicy: automated: prune: true diff --git a/argocd-apps/kustomization.yaml b/argocd-apps/kustomization.yaml index daa01ff..414729f 100644 --- a/argocd-apps/kustomization.yaml +++ b/argocd-apps/kustomization.yaml @@ -1,20 +1,5 @@ apiVersion: kustomize.config.k8s.io/v1beta1 kind: Kustomization resources: - # add-ons - - add-ons/gateway-api.yaml - - add-ons/traefik.yaml - - add-ons/cert-manager.yaml - - add-ons/anubis-operator.yaml - - add-ons/sealed-secrets.yaml - - add-ons/cnpg.yaml - - add-ons/argocd-repos.yaml - # services - - services/autoregexbot.yaml - - services/betterslcm.yaml - - services/jellyfin.yaml - - services/legislative-summarization.yaml - - services/scriptscribe.yaml - - services/seaweedfs.yaml - - services/qbit.yaml - - services/stirling-pdf.yaml + - add-ons + - services diff --git a/argocd-apps/services/autoregexbot.yaml b/argocd-apps/services/autoregexbot.yaml index 1057d5e..249f8cd 100644 --- a/argocd-apps/services/autoregexbot.yaml +++ b/argocd-apps/services/autoregexbot.yaml @@ -1,19 +1,19 @@ apiVersion: argoproj.io/v1alpha1 kind: Application metadata: - name: telegram-autoregexbot annotations: argocd.argoproj.io/sync-wave: "3" + name: telegram-autoregexbot namespace: argocd spec: + destination: + namespace: telegram-bot + server: https://kubernetes.default.svc project: default source: + path: k8s repoURL: https://github.com/santarl/telegram-autoregexbot targetRevision: main - path: k8s - destination: - server: https://kubernetes.default.svc - namespace: telegram-bot syncPolicy: automated: prune: true diff --git a/argocd-apps/services/betterslcm.yaml b/argocd-apps/services/betterslcm.yaml index f040410..34f3067 100644 --- a/argocd-apps/services/betterslcm.yaml +++ b/argocd-apps/services/betterslcm.yaml @@ -1,19 +1,19 @@ apiVersion: argoproj.io/v1alpha1 kind: Application metadata: - name: betterslcm annotations: argocd.argoproj.io/sync-wave: "3" + name: betterslcm namespace: argocd spec: + destination: + namespace: betterslcm + server: https://kubernetes.default.svc project: default source: + path: k8s repoURL: https://github.com/DK10WS/SLCM_APP.git targetRevision: web - path: k8s - destination: - server: https://kubernetes.default.svc - namespace: betterslcm syncPolicy: automated: prune: true diff --git a/argocd-apps/services/jellyfin.yaml b/argocd-apps/services/jellyfin.yaml index c519766..a88c464 100644 --- a/argocd-apps/services/jellyfin.yaml +++ b/argocd-apps/services/jellyfin.yaml @@ -1,16 +1,17 @@ apiVersion: argoproj.io/v1alpha1 kind: Application metadata: - name: jellyfin annotations: argocd.argoproj.io/sync-wave: "3" + name: jellyfin namespace: argocd spec: + destination: + namespace: jellyfin + server: https://kubernetes.default.svc project: default sources: - - repoURL: https://jellyfin.github.io/jellyfin-helm - chart: jellyfin - targetRevision: "2.7.0" + - chart: jellyfin helm: values: | service: @@ -26,12 +27,11 @@ spec: enabled: true type: hostPath hostPath: /srv/media - - repoURL: https://gitea.whyredfire.dev/whyredfire/gitops.git + repoURL: https://jellyfin.github.io/jellyfin-helm + targetRevision: 2.7.0 + - path: apps/jellyfin + repoURL: https://gitea.whyredfire.dev/whyredfire/gitops.git targetRevision: main - path: apps/jellyfin - destination: - server: https://kubernetes.default.svc - namespace: jellyfin syncPolicy: automated: prune: true diff --git a/argocd-apps/services/kustomization.yaml b/argocd-apps/services/kustomization.yaml new file mode 100644 index 0000000..3d0b53d --- /dev/null +++ b/argocd-apps/services/kustomization.yaml @@ -0,0 +1,11 @@ +apiVersion: kustomize.config.k8s.io/v1beta1 +kind: Kustomization +resources: + - autoregexbot.yaml + - betterslcm.yaml + - jellyfin.yaml + - legislative-summarization.yaml + - qbit.yaml + - scriptscribe.yaml + - seaweedfs.yaml + - stirling-pdf.yaml diff --git a/argocd-apps/services/legislative-summarization.yaml b/argocd-apps/services/legislative-summarization.yaml index 6308835..3c1a29f 100644 --- a/argocd-apps/services/legislative-summarization.yaml +++ b/argocd-apps/services/legislative-summarization.yaml @@ -1,19 +1,19 @@ apiVersion: argoproj.io/v1alpha1 kind: Application metadata: - name: legislative-summarization annotations: argocd.argoproj.io/sync-wave: "3" + name: legislative-summarization namespace: argocd spec: + destination: + namespace: legislative-summarization + server: https://kubernetes.default.svc project: default source: + path: k8s repoURL: https://github.com/whyredfire/legislative-summarization targetRevision: main - path: k8s - destination: - server: https://kubernetes.default.svc - namespace: legislative-summarization syncPolicy: automated: prune: true diff --git a/argocd-apps/services/qbit.yaml b/argocd-apps/services/qbit.yaml index e68093e..fac1a8d 100644 --- a/argocd-apps/services/qbit.yaml +++ b/argocd-apps/services/qbit.yaml @@ -1,19 +1,19 @@ apiVersion: argoproj.io/v1alpha1 kind: Application metadata: - name: qbit annotations: argocd.argoproj.io/sync-wave: "3" + name: qbit namespace: argocd spec: + destination: + namespace: qbit + server: https://kubernetes.default.svc project: default source: + path: qbit repoURL: https://gitea.whyredfire.dev/whyredfire/gitops-private.git targetRevision: main - path: qbit - destination: - server: https://kubernetes.default.svc - namespace: qbit syncPolicy: automated: prune: true diff --git a/argocd-apps/services/scriptscribe.yaml b/argocd-apps/services/scriptscribe.yaml index 8843e10..5cefc5f 100644 --- a/argocd-apps/services/scriptscribe.yaml +++ b/argocd-apps/services/scriptscribe.yaml @@ -1,19 +1,19 @@ apiVersion: argoproj.io/v1alpha1 kind: Application metadata: - name: scriptscribe annotations: argocd.argoproj.io/sync-wave: "3" + name: scriptscribe namespace: argocd spec: + destination: + namespace: scriptscribe + server: https://kubernetes.default.svc project: default source: + path: k8s repoURL: https://github.com/whyredfire/scriptscribe targetRevision: main - path: k8s - destination: - server: https://kubernetes.default.svc - namespace: scriptscribe syncPolicy: automated: prune: true diff --git a/argocd-apps/services/seaweedfs.yaml b/argocd-apps/services/seaweedfs.yaml index 2538f53..b293b95 100644 --- a/argocd-apps/services/seaweedfs.yaml +++ b/argocd-apps/services/seaweedfs.yaml @@ -1,16 +1,17 @@ apiVersion: argoproj.io/v1alpha1 kind: Application metadata: - name: seaweedfs annotations: argocd.argoproj.io/sync-wave: "3" + name: seaweedfs namespace: argocd spec: + destination: + namespace: seaweedfs + server: https://kubernetes.default.svc project: default sources: - - repoURL: https://seaweedfs.github.io/seaweedfs/helm - chart: seaweedfs - targetRevision: 4.33.0 + - chart: seaweedfs helm: values: | allInOne: @@ -21,12 +22,11 @@ spec: enabled: false filer: enabled: false - - repoURL: https://gitea.whyredfire.dev/whyredfire/gitops.git + repoURL: https://seaweedfs.github.io/seaweedfs/helm + targetRevision: 4.33.0 + - path: apps/seaweedfs + repoURL: https://gitea.whyredfire.dev/whyredfire/gitops.git targetRevision: main - path: apps/seaweedfs - destination: - server: https://kubernetes.default.svc - namespace: seaweedfs syncPolicy: automated: prune: true diff --git a/argocd-apps/services/stirling-pdf.yaml b/argocd-apps/services/stirling-pdf.yaml index d3b893e..2d2736d 100644 --- a/argocd-apps/services/stirling-pdf.yaml +++ b/argocd-apps/services/stirling-pdf.yaml @@ -1,16 +1,17 @@ apiVersion: argoproj.io/v1alpha1 kind: Application metadata: - name: stirling-pdf annotations: argocd.argoproj.io/sync-wave: "3" + name: stirling-pdf namespace: argocd spec: + destination: + namespace: stirling-pdf + server: https://kubernetes.default.svc project: default sources: - - repoURL: https://docs.stirlingpdf.com/Stirling-PDF-chart - chart: stirling-pdf-chart - targetRevision: "3.1.0" + - chart: stirling-pdf-chart helm: values: | fullnameOverride: stirling-pdf @@ -26,12 +27,11 @@ spec: initialDelaySeconds: 90 readiness: initialDelaySeconds: 60 - - repoURL: https://gitea.whyredfire.dev/whyredfire/gitops.git + repoURL: https://docs.stirlingpdf.com/Stirling-PDF-chart + targetRevision: 3.1.0 + - path: apps/stirling-pdf + repoURL: https://gitea.whyredfire.dev/whyredfire/gitops.git targetRevision: main - path: apps/stirling-pdf - destination: - server: https://kubernetes.default.svc - namespace: stirling-pdf syncPolicy: automated: prune: true diff --git a/bootstrap/argocd-root-app/root-app.yaml b/bootstrap/argocd-root-app/root-app.yaml index 898097f..384dcde 100644 --- a/bootstrap/argocd-root-app/root-app.yaml +++ b/bootstrap/argocd-root-app/root-app.yaml @@ -4,14 +4,14 @@ metadata: name: root-app namespace: argocd spec: + destination: + namespace: argocd + server: https://kubernetes.default.svc project: default source: + path: argocd-apps repoURL: https://gitea.whyredfire.dev/whyredfire/gitops.git targetRevision: main - path: argocd-apps - destination: - server: https://kubernetes.default.svc - namespace: argocd syncPolicy: automated: prune: true diff --git a/infra/argocd-repos/kustomization.yaml b/infra/argocd-repos/kustomization.yaml new file mode 100644 index 0000000..4a612dc --- /dev/null +++ b/infra/argocd-repos/kustomization.yaml @@ -0,0 +1,4 @@ +apiVersion: kustomize.config.k8s.io/v1beta1 +kind: Kustomization +resources: + - repo-sealed-secret.yaml diff --git a/infra/cert-manager/cluster-issuer.yaml b/infra/cert-manager/cluster-issuer.yaml index c412e27..420ecd4 100644 --- a/infra/cert-manager/cluster-issuer.yaml +++ b/infra/cert-manager/cluster-issuer.yaml @@ -1,18 +1,18 @@ apiVersion: cert-manager.io/v1 kind: ClusterIssuer metadata: - name: letsencrypt-prod annotations: argocd.argoproj.io/sync-wave: "1" + name: letsencrypt-prod spec: acme: - server: https://acme-v02.api.letsencrypt.org/directory email: whyredfire@gmail.com privateKeySecretRef: name: letsencrypt-prod + server: https://acme-v02.api.letsencrypt.org/directory solvers: - dns01: cloudflare: apiTokenSecretRef: - name: cloudflare-api-token key: api-token + name: cloudflare-api-token diff --git a/infra/cert-manager/kustomization.yaml b/infra/cert-manager/kustomization.yaml new file mode 100644 index 0000000..457046a --- /dev/null +++ b/infra/cert-manager/kustomization.yaml @@ -0,0 +1,5 @@ +apiVersion: kustomize.config.k8s.io/v1beta1 +kind: Kustomization +resources: + - cloudflare-api-token-sealed-secret.yaml + - cluster-issuer.yaml diff --git a/infra/traefik/kustomization.yaml b/infra/traefik/kustomization.yaml new file mode 100644 index 0000000..2e34d9f --- /dev/null +++ b/infra/traefik/kustomization.yaml @@ -0,0 +1,4 @@ +apiVersion: kustomize.config.k8s.io/v1beta1 +kind: Kustomization +resources: + - wildcard-whyredfire-dev.yaml diff --git a/infra/traefik/wildcard-whyredfire-dev.yaml b/infra/traefik/wildcard-whyredfire-dev.yaml index a82da08..0086be7 100644 --- a/infra/traefik/wildcard-whyredfire-dev.yaml +++ b/infra/traefik/wildcard-whyredfire-dev.yaml @@ -4,11 +4,11 @@ metadata: name: wildcard-whyredfire-dev namespace: traefik spec: - secretName: wildcard-whyredfire-dev + dnsNames: + - '*.whyredfire.dev' + issuerRef: + kind: ClusterIssuer + name: letsencrypt-prod privateKey: rotationPolicy: Always - issuerRef: - name: letsencrypt-prod - kind: ClusterIssuer - dnsNames: - - "*.whyredfire.dev" + secretName: wildcard-whyredfire-dev