From b6890fa29d5d1f793ff67ea1a7373e6bbb38bf98 Mon Sep 17 00:00:00 2001 From: Patryk Hegenberg Date: Wed, 7 May 2025 07:17:45 +0200 Subject: [PATCH] first commit --- README.md | 3 +++ apps/README.md | 3 +++ clusters/production/kustomize.yaml | 14 ++++++++++++++ infrastructure/longhorn/helmrelease.yaml | 19 +++++++++++++++++++ infrastructure/longhorn/helmrepository.yaml | 8 ++++++++ infrastructure/monitoring/helmrelease.yaml | 19 +++++++++++++++++++ infrastructure/monitoring/helmrepository.yaml | 8 ++++++++ 7 files changed, 74 insertions(+) create mode 100644 README.md create mode 100644 apps/README.md create mode 100644 clusters/production/kustomize.yaml create mode 100644 infrastructure/longhorn/helmrelease.yaml create mode 100644 infrastructure/longhorn/helmrepository.yaml create mode 100644 infrastructure/monitoring/helmrelease.yaml create mode 100644 infrastructure/monitoring/helmrepository.yaml diff --git a/README.md b/README.md new file mode 100644 index 0000000..a1696f2 --- /dev/null +++ b/README.md @@ -0,0 +1,3 @@ +# k3s-cluster-gitops + +GitOps-Repository für K3s-Cluster mit Flux, Longhorn und Monitoring (Prometheus/Grafana). diff --git a/apps/README.md b/apps/README.md new file mode 100644 index 0000000..96979a3 --- /dev/null +++ b/apps/README.md @@ -0,0 +1,3 @@ +# Applikationen + +Hier können später eigene Applikationen als HelmRelease oder Manifeste abgelegt werden. diff --git a/clusters/production/kustomize.yaml b/clusters/production/kustomize.yaml new file mode 100644 index 0000000..41ab32e --- /dev/null +++ b/clusters/production/kustomize.yaml @@ -0,0 +1,14 @@ +apiVersion: kustomize.toolkit.fluxcd.io/v1 +kind: Kustomization +metadata: + name: production + namespace: flux-system +spec: + interval: 10m + path: ./infrastructure + prune: true + sourceRef: + kind: GitRepository + name: flux-system + namespace: flux-system + validation: client diff --git a/infrastructure/longhorn/helmrelease.yaml b/infrastructure/longhorn/helmrelease.yaml new file mode 100644 index 0000000..232907a --- /dev/null +++ b/infrastructure/longhorn/helmrelease.yaml @@ -0,0 +1,19 @@ +apiVersion: helm.toolkit.fluxcd.io/v2beta2 +kind: HelmRelease +metadata: + name: longhorn + namespace: longhorn-system +spec: + releaseName: longhorn + chart: + spec: + chart: longhorn + version: "1.6.1" + sourceRef: + kind: HelmRepository + name: longhorn + namespace: flux-system + interval: 5m + install: + createNamespace: true + values: {} diff --git a/infrastructure/longhorn/helmrepository.yaml b/infrastructure/longhorn/helmrepository.yaml new file mode 100644 index 0000000..2a21432 --- /dev/null +++ b/infrastructure/longhorn/helmrepository.yaml @@ -0,0 +1,8 @@ +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/monitoring/helmrelease.yaml b/infrastructure/monitoring/helmrelease.yaml new file mode 100644 index 0000000..4fbed5d --- /dev/null +++ b/infrastructure/monitoring/helmrelease.yaml @@ -0,0 +1,19 @@ +apiVersion: helm.toolkit.fluxcd.io/v2beta2 +kind: HelmRelease +metadata: + name: kube-prometheus-stack + namespace: monitoring +spec: + releaseName: kube-prometheus-stack + chart: + spec: + chart: kube-prometheus-stack + version: "56.0.0" + sourceRef: + kind: HelmRepository + name: prometheus-community + namespace: flux-system + interval: 5m + install: + createNamespace: true + values: {} diff --git a/infrastructure/monitoring/helmrepository.yaml b/infrastructure/monitoring/helmrepository.yaml new file mode 100644 index 0000000..f31463b --- /dev/null +++ b/infrastructure/monitoring/helmrepository.yaml @@ -0,0 +1,8 @@ +apiVersion: source.toolkit.fluxcd.io/v1 +kind: HelmRepository +metadata: + name: prometheus-community + namespace: flux-system +spec: + url: https://prometheus-community.github.io/helm-charts + interval: 10m