From e01ed75fe8ff7df066427807f0d07dc0a4e1adde Mon Sep 17 00:00:00 2001 From: Patryk Hegenberg Date: Sat, 24 May 2025 22:22:42 +0200 Subject: [PATCH] feat: apply base repo --- .../gitea/helmrelease.yaml | 0 .../gitea/helmrepository.yaml | 0 .../gitea/kustomization.yaml | 0 {infrastructure => apps}/gitea/namespace.yaml | 0 infrastructure/cert-manager/helmrelease.yaml | 14 +++++ .../cert-manager/helmrepository.yaml | 8 +++ .../{cnpg => cert-manager}/namespace.yaml | 2 +- infrastructure/cnpg/helmrelease-cluster.yaml | 62 ------------------- infrastructure/cnpg/helmrelease-operator.yaml | 16 ----- infrastructure/cnpg/helmrepository.yaml | 8 --- infrastructure/cnpg/kustomization.yaml | 6 -- infrastructure/gitea-runner/helmrelease.yaml | 30 --------- .../gitea-runner/helmrepository.yaml | 8 --- .../gitea-runner/kustomization.yaml | 5 -- infrastructure/gitea-runner/namespace.yaml | 0 infrastructure/kustomization.yaml | 9 +-- infrastructure/longhorn/helmrelease.yaml | 23 ------- infrastructure/longhorn/helmrepository.yaml | 8 --- infrastructure/longhorn/kustomization.yaml | 7 --- infrastructure/longhorn/longhorn-ingress.yaml | 19 ------ infrastructure/longhorn/namespace.yaml | 4 -- infrastructure/sonarqube/helmrelease.yaml | 35 ----------- infrastructure/sonarqube/helmrepository.yaml | 8 --- infrastructure/sonarqube/kustomization.yaml | 6 -- infrastructure/sonarqube/namespace.yaml | 4 -- 25 files changed, 25 insertions(+), 257 deletions(-) rename {infrastructure => apps}/gitea/helmrelease.yaml (100%) rename {infrastructure => apps}/gitea/helmrepository.yaml (100%) rename {infrastructure => apps}/gitea/kustomization.yaml (100%) rename {infrastructure => apps}/gitea/namespace.yaml (100%) create mode 100644 infrastructure/cert-manager/helmrelease.yaml create mode 100644 infrastructure/cert-manager/helmrepository.yaml rename infrastructure/{cnpg => cert-manager}/namespace.yaml (66%) delete mode 100644 infrastructure/cnpg/helmrelease-cluster.yaml delete mode 100644 infrastructure/cnpg/helmrelease-operator.yaml delete mode 100644 infrastructure/cnpg/helmrepository.yaml delete mode 100644 infrastructure/cnpg/kustomization.yaml delete mode 100644 infrastructure/gitea-runner/helmrelease.yaml delete mode 100644 infrastructure/gitea-runner/helmrepository.yaml delete mode 100644 infrastructure/gitea-runner/kustomization.yaml delete mode 100644 infrastructure/gitea-runner/namespace.yaml delete mode 100644 infrastructure/longhorn/helmrelease.yaml delete mode 100644 infrastructure/longhorn/helmrepository.yaml delete mode 100644 infrastructure/longhorn/kustomization.yaml delete mode 100644 infrastructure/longhorn/longhorn-ingress.yaml delete mode 100644 infrastructure/longhorn/namespace.yaml delete mode 100644 infrastructure/sonarqube/helmrelease.yaml delete mode 100644 infrastructure/sonarqube/helmrepository.yaml delete mode 100644 infrastructure/sonarqube/kustomization.yaml delete mode 100644 infrastructure/sonarqube/namespace.yaml diff --git a/infrastructure/gitea/helmrelease.yaml b/apps/gitea/helmrelease.yaml similarity index 100% rename from infrastructure/gitea/helmrelease.yaml rename to apps/gitea/helmrelease.yaml diff --git a/infrastructure/gitea/helmrepository.yaml b/apps/gitea/helmrepository.yaml similarity index 100% rename from infrastructure/gitea/helmrepository.yaml rename to apps/gitea/helmrepository.yaml diff --git a/infrastructure/gitea/kustomization.yaml b/apps/gitea/kustomization.yaml similarity index 100% rename from infrastructure/gitea/kustomization.yaml rename to apps/gitea/kustomization.yaml diff --git a/infrastructure/gitea/namespace.yaml b/apps/gitea/namespace.yaml similarity index 100% rename from infrastructure/gitea/namespace.yaml rename to apps/gitea/namespace.yaml diff --git a/infrastructure/cert-manager/helmrelease.yaml b/infrastructure/cert-manager/helmrelease.yaml new file mode 100644 index 0000000..992bb84 --- /dev/null +++ b/infrastructure/cert-manager/helmrelease.yaml @@ -0,0 +1,14 @@ +apiVersion: helm.toolkit.fluxcd.io/v2beta1 +kind: HelmRelease +metadata: + name: cert-manager + namespace: cert-manager +spec: + chart: + spec: + chart: cert-manager + sourceRef: + kind: HelmRepository + name: cert-manager + values: + installCRDs: true diff --git a/infrastructure/cert-manager/helmrepository.yaml b/infrastructure/cert-manager/helmrepository.yaml new file mode 100644 index 0000000..5bd9630 --- /dev/null +++ b/infrastructure/cert-manager/helmrepository.yaml @@ -0,0 +1,8 @@ +apiVersion: source.toolkit.fluxcd.io/v1beta2 +kind: HelmRepository +metadata: + name: cert-manager + namespace: flux-system +spec: + interval: 1h + url: https://charts.jetstack.io diff --git a/infrastructure/cnpg/namespace.yaml b/infrastructure/cert-manager/namespace.yaml similarity index 66% rename from infrastructure/cnpg/namespace.yaml rename to infrastructure/cert-manager/namespace.yaml index 8deac4c..c90416f 100644 --- a/infrastructure/cnpg/namespace.yaml +++ b/infrastructure/cert-manager/namespace.yaml @@ -1,4 +1,4 @@ apiVersion: v1 kind: Namespace metadata: - name: cnpg-system + name: cert-manager diff --git a/infrastructure/cnpg/helmrelease-cluster.yaml b/infrastructure/cnpg/helmrelease-cluster.yaml deleted file mode 100644 index ec82d5e..0000000 --- a/infrastructure/cnpg/helmrelease-cluster.yaml +++ /dev/null @@ -1,62 +0,0 @@ -apiVersion: helm.toolkit.fluxcd.io/v2beta2 # Oder v2beta1 -kind: HelmRelease -metadata: - name: shared-postgres-cluster - namespace: cnpg-system # Oder ein anderer Namespace für die Datenbank selbst, z.B. 'database' -spec: - interval: 10m - chart: - spec: - chart: cluster # Dies ist der Chart für den Cluster selbst - # version: "" # Finde die passende Version auf ArtifactHub - sourceRef: - kind: HelmRepository - name: cnpg # Das zuvor definierte Repository - namespace: flux-system - interval: 1m - values: - # Cluster Konfiguration - # Name des Clusters, der im cnpg-system Namespace erstellt wird - name: shared-pg - # Anzahl der Instanzen (für Hochverfügbarkeit anpassen) - instances: 3 - # Storage Konfiguration (Longhorn verwenden, wie in deinen anderen Setups) - storage: - size: "10Gi" # Gesamtgröße für den Cluster, anpassen nach Bedarf - storageClass: "longhorn" # Deine Longhorn StorageClass - # PostgreSQL Version (prüfe Kompatibilität mit deinen Anwendungen) - # postgresql: - # imageName: "ghcr.io/cloudnative-pg/postgresql:15.3" # Beispiel - - # Wichtig: Konfiguriere Backups! Hier nicht im Detail gezeigt. - # backup: - # barmanObjectStore: - # ... - - # Monitoring (optional, aber empfohlen) - # monitoring: - # enablePodMonitor: true - - # Initiale Datenbanken und Benutzer (optional, kann auch manuell oder per Job erfolgen) - # Beachte, dass du für jede Anwendung (Gitea, SonarQube) eigene Datenbanken und Benutzer - # in diesem geteilten Cluster benötigst. CloudNativePG kann Benutzer verwalten. - # Beispiel für einen initialen Benutzer (NICHT für Anwendungen direkt verwenden, - # sondern spezifische Benutzer pro Anwendung erstellen) - # bootstrap: - # initdb: - # database: app_db_1 # Beispiel: Gitea DB - # owner: app_user_1 # Beispiel: Gitea User - # # Weitere Datenbanken hier - # - # # Deklarative Rollen/Benutzer - # postgresql: - # managed: - # roles: - # - name: gitea_user - # # passwordSecret: # Besser ein Secret verwenden - # # name: gitea-db-credentials - # # key: password - # - name: sonarqube_user - # # passwordSecret: - # # name: sonarqube-db-credentials - # # key: password diff --git a/infrastructure/cnpg/helmrelease-operator.yaml b/infrastructure/cnpg/helmrelease-operator.yaml deleted file mode 100644 index 147ebfe..0000000 --- a/infrastructure/cnpg/helmrelease-operator.yaml +++ /dev/null @@ -1,16 +0,0 @@ -apiVersion: helm.toolkit.fluxcd.io/v2beta1 -kind: HelmRelease -metadata: - name: cnpg-operator - namespace: cnpg-system -spec: - interval: 10m - chart: - spec: - chart: cloudnative-pg - version: "0.23.2" - sourceRef: - kind: HelmRepository - name: cnpg - namespace: flux-system - interval: 1m diff --git a/infrastructure/cnpg/helmrepository.yaml b/infrastructure/cnpg/helmrepository.yaml deleted file mode 100644 index fa469e7..0000000 --- a/infrastructure/cnpg/helmrepository.yaml +++ /dev/null @@ -1,8 +0,0 @@ -apiVersion: source.toolkit.fluxcd.io/v1beta2 # Oder v1 je nach deiner Flux-Version -kind: HelmRepository -metadata: - name: cnpg - namespace: flux-system -spec: - interval: 1h - url: https://cloudnative-pg.io/charts diff --git a/infrastructure/cnpg/kustomization.yaml b/infrastructure/cnpg/kustomization.yaml deleted file mode 100644 index 9923fdf..0000000 --- a/infrastructure/cnpg/kustomization.yaml +++ /dev/null @@ -1,6 +0,0 @@ -apiVersion: kustomize.config.k8s.io/v1beta1 -kind: Kustomization -resources: - - namespace.yaml - - helmrepository.yaml - - helmrelease-operator.yaml diff --git a/infrastructure/gitea-runner/helmrelease.yaml b/infrastructure/gitea-runner/helmrelease.yaml deleted file mode 100644 index e5a1976..0000000 --- a/infrastructure/gitea-runner/helmrelease.yaml +++ /dev/null @@ -1,30 +0,0 @@ -apiVersion: helm.toolkit.fluxcd.io/v2beta2 -kind: HelmRelease -metadata: - name: gitea-act-runner - namespace: gitea -spec: - releaseName: gitea-act-runner - interval: 10m - chart: - spec: - chart: gitea-act-runner - version: "0.5.2" - sourceRef: - kind: HelmRepository - name: gitea-charts - namespace: flux-system - values: - provisioning: - enabled: true - # Gitea-URL wie im Cluster erreichbar (interner Service-Name!) - serverURL: "http://gitea-http.gitea.svc.cluster.local:3000" - # Admin-Zugangsdaten wie oben im Gitea-Chart gesetzt - adminUser: "giteaadmin" - # adminPassword: "changeme" - adminPassword: "F3l1x-230113?" - rbac: - create: true - # Optional: Runner-Name, falls du mehrere Runner willst - runner: - labels: ["k3s", "fluxcd"] diff --git a/infrastructure/gitea-runner/helmrepository.yaml b/infrastructure/gitea-runner/helmrepository.yaml deleted file mode 100644 index aa6700e..0000000 --- a/infrastructure/gitea-runner/helmrepository.yaml +++ /dev/null @@ -1,8 +0,0 @@ -apiVersion: source.toolkit.fluxcd.io/v1 -kind: HelmRepository -metadata: - name: gitea-charts - namespace: flux-system -spec: - url: https://dl.gitea.io/charts/ - interval: 1h diff --git a/infrastructure/gitea-runner/kustomization.yaml b/infrastructure/gitea-runner/kustomization.yaml deleted file mode 100644 index d7fbb03..0000000 --- a/infrastructure/gitea-runner/kustomization.yaml +++ /dev/null @@ -1,5 +0,0 @@ -apiVersion: kustomize.config.k8s.io/v1beta1 -kind: Kustomization -resources: - - helmrepository.yaml - - helmrelease.yaml diff --git a/infrastructure/gitea-runner/namespace.yaml b/infrastructure/gitea-runner/namespace.yaml deleted file mode 100644 index e69de29..0000000 diff --git a/infrastructure/kustomization.yaml b/infrastructure/kustomization.yaml index 620a250..0fb1baa 100644 --- a/infrastructure/kustomization.yaml +++ b/infrastructure/kustomization.yaml @@ -1,9 +1,4 @@ apiVersion: kustomize.config.k8s.io/v1beta1 kind: Kustomization -resources: - - monitoring/ - - longhorn/ - - gitea/ - # - gitea-runner/ - # - sonarqube/ - - cnpg +# resources: + # - monitoring/ diff --git a/infrastructure/longhorn/helmrelease.yaml b/infrastructure/longhorn/helmrelease.yaml deleted file mode 100644 index 695713b..0000000 --- a/infrastructure/longhorn/helmrelease.yaml +++ /dev/null @@ -1,23 +0,0 @@ -apiVersion: helm.toolkit.fluxcd.io/v2beta2 -kind: HelmRelease -metadata: - name: longhorn - namespace: longhorn-system -spec: - releaseName: longhorn - chart: - spec: - chart: longhorn - version: "1.8.1" - sourceRef: - kind: HelmRepository - name: longhorn - namespace: flux-system - interval: 5m - install: - createNamespace: true - values: - defaultSettings: - defaultReplicaCount: 2 - persistence: - defaultClassReplicaCount: 2 diff --git a/infrastructure/longhorn/helmrepository.yaml b/infrastructure/longhorn/helmrepository.yaml deleted file mode 100644 index 2a21432..0000000 --- a/infrastructure/longhorn/helmrepository.yaml +++ /dev/null @@ -1,8 +0,0 @@ -apiVersion: source.toolkit.fluxcd.io/v1 -kind: HelmRepository -metadata: - name: longhorn - namespace: flux-system -spec: - url: https://charts.longhorn.io - interval: 10m diff --git a/infrastructure/longhorn/kustomization.yaml b/infrastructure/longhorn/kustomization.yaml deleted file mode 100644 index c454170..0000000 --- a/infrastructure/longhorn/kustomization.yaml +++ /dev/null @@ -1,7 +0,0 @@ -apiVersion: kustomize.config.k8s.io/v1beta1 -kind: Kustomization -resources: - - namespace.yaml - - helmrepository.yaml - - helmrelease.yaml - - longhorn-ingress.yaml diff --git a/infrastructure/longhorn/longhorn-ingress.yaml b/infrastructure/longhorn/longhorn-ingress.yaml deleted file mode 100644 index ce7f130..0000000 --- a/infrastructure/longhorn/longhorn-ingress.yaml +++ /dev/null @@ -1,19 +0,0 @@ -apiVersion: networking.k8s.io/v1 -kind: Ingress -metadata: - name: longhorn-ui - namespace: longhorn-system - annotations: - kubernetes.io/ingress.class: "traefik" -spec: - rules: - - host: longhorn.local - http: - paths: - - path: / - pathType: Prefix - backend: - service: - name: longhorn-frontend - port: - number: 80 diff --git a/infrastructure/longhorn/namespace.yaml b/infrastructure/longhorn/namespace.yaml deleted file mode 100644 index 9ac9395..0000000 --- a/infrastructure/longhorn/namespace.yaml +++ /dev/null @@ -1,4 +0,0 @@ -apiVersion: v1 -kind: Namespace -metadata: - name: longhorn-system diff --git a/infrastructure/sonarqube/helmrelease.yaml b/infrastructure/sonarqube/helmrelease.yaml deleted file mode 100644 index 9544394..0000000 --- a/infrastructure/sonarqube/helmrelease.yaml +++ /dev/null @@ -1,35 +0,0 @@ -apiVersion: helm.toolkit.fluxcd.io/v2beta2 -kind: HelmRelease -metadata: - name: sonarqube - namespace: sonarqube -spec: - interval: 10m - chart: - spec: - chart: sonarqube - version: "2025.2.0" - sourceRef: - kind: HelmRepository - name: sonarqube - namespace: flux-system - values: - community: - enabled: true - monitoringPasscode: "supersecret123" - persistence: - enabled: true - storageClass: longhorn - size: 5Gi - postgresql: - enabled: true - persistence: - enabled: true - storageClass: longhorn - size: 2Gi - ingress: - enabled: true - hosts: - - name: sonarqube.local - path: / - ingressClassName: traefik diff --git a/infrastructure/sonarqube/helmrepository.yaml b/infrastructure/sonarqube/helmrepository.yaml deleted file mode 100644 index 5d2cb5a..0000000 --- a/infrastructure/sonarqube/helmrepository.yaml +++ /dev/null @@ -1,8 +0,0 @@ -apiVersion: source.toolkit.fluxcd.io/v1 -kind: HelmRepository -metadata: - name: sonarqube - namespace: flux-system -spec: - url: https://SonarSource.github.io/helm-chart-sonarqube - interval: 1h diff --git a/infrastructure/sonarqube/kustomization.yaml b/infrastructure/sonarqube/kustomization.yaml deleted file mode 100644 index b4a3d7c..0000000 --- a/infrastructure/sonarqube/kustomization.yaml +++ /dev/null @@ -1,6 +0,0 @@ -apiVersion: kustomize.config.k8s.io/v1beta1 -kind: Kustomization -resources: - - namespace.yaml - - helmrepository.yaml - - helmrelease.yaml diff --git a/infrastructure/sonarqube/namespace.yaml b/infrastructure/sonarqube/namespace.yaml deleted file mode 100644 index f18e1e9..0000000 --- a/infrastructure/sonarqube/namespace.yaml +++ /dev/null @@ -1,4 +0,0 @@ -apiVersion: v1 -kind: Namespace -metadata: - name: sonarqube