From 470621ab721ca6d145779a6d9086e9acb48c76b2 Mon Sep 17 00:00:00 2001 From: Joe Monk Date: Tue, 6 Aug 2024 00:51:46 +0100 Subject: [PATCH] Revert "Remove everything!" This reverts commit f11c3f820d5d5fa94e253d13a4c8e08f323236b1. --- clusters/kairos/apps/fluxrepo.yaml | 13 ++++ clusters/kairos/apps/kustomization.yaml | 6 ++ clusters/kairos/apps/namespace.yaml | 4 ++ .../monitoring/grafana/helmrelease.yaml | 19 +++++ .../kairos/monitoring/grafana/ingress.yaml | 16 +++++ .../monitoring/grafana/kustomization.yaml | 5 ++ clusters/kairos/monitoring/helmrepo.yaml | 7 ++ clusters/kairos/monitoring/kustomization.yaml | 9 +++ .../kairos/monitoring/loki/helmrelease.yaml | 70 +++++++++++++++++++ .../kairos/monitoring/loki/kustomization.yaml | 4 ++ clusters/kairos/monitoring/namespace.yaml | 4 ++ .../monitoring/promtail/helmrelease.yaml | 20 ++++++ .../monitoring/promtail/kustomization.yaml | 4 ++ clusters/kairos/traefik/helmconfig.yaml | 9 +++ clusters/kairos/traefik/ingress.yaml | 16 +++++ clusters/kairos/traefik/kustomization.yaml | 7 ++ clusters/kairos/traefik/service.yaml | 12 ++++ 17 files changed, 225 insertions(+) create mode 100644 clusters/kairos/apps/fluxrepo.yaml create mode 100644 clusters/kairos/apps/kustomization.yaml create mode 100644 clusters/kairos/apps/namespace.yaml create mode 100644 clusters/kairos/monitoring/grafana/helmrelease.yaml create mode 100644 clusters/kairos/monitoring/grafana/ingress.yaml create mode 100644 clusters/kairos/monitoring/grafana/kustomization.yaml create mode 100644 clusters/kairos/monitoring/helmrepo.yaml create mode 100644 clusters/kairos/monitoring/kustomization.yaml create mode 100644 clusters/kairos/monitoring/loki/helmrelease.yaml create mode 100644 clusters/kairos/monitoring/loki/kustomization.yaml create mode 100644 clusters/kairos/monitoring/namespace.yaml create mode 100644 clusters/kairos/monitoring/promtail/helmrelease.yaml create mode 100644 clusters/kairos/monitoring/promtail/kustomization.yaml create mode 100644 clusters/kairos/traefik/helmconfig.yaml create mode 100644 clusters/kairos/traefik/ingress.yaml create mode 100644 clusters/kairos/traefik/kustomization.yaml create mode 100644 clusters/kairos/traefik/service.yaml diff --git a/clusters/kairos/apps/fluxrepo.yaml b/clusters/kairos/apps/fluxrepo.yaml new file mode 100644 index 0000000..b50aeb0 --- /dev/null +++ b/clusters/kairos/apps/fluxrepo.yaml @@ -0,0 +1,13 @@ +apiVersion: kustomize.toolkit.fluxcd.io/v1 +kind: Kustomization +metadata: + name: flux-apps +spec: + interval: 10m0s + path: ./apps + targetNamespace: apps + prune: true + sourceRef: + kind: GitRepository + name: flux-system + namespace: flux-system diff --git a/clusters/kairos/apps/kustomization.yaml b/clusters/kairos/apps/kustomization.yaml new file mode 100644 index 0000000..3ccd6fd --- /dev/null +++ b/clusters/kairos/apps/kustomization.yaml @@ -0,0 +1,6 @@ +apiVersion: kustomize.config.k8s.io/v1beta1 +kind: Kustomization +namespace: apps +resources: +- namespace.yaml +- fluxrepo.yaml \ No newline at end of file diff --git a/clusters/kairos/apps/namespace.yaml b/clusters/kairos/apps/namespace.yaml new file mode 100644 index 0000000..01113b9 --- /dev/null +++ b/clusters/kairos/apps/namespace.yaml @@ -0,0 +1,4 @@ +apiVersion: v1 +kind: Namespace +metadata: + name: apps \ No newline at end of file diff --git a/clusters/kairos/monitoring/grafana/helmrelease.yaml b/clusters/kairos/monitoring/grafana/helmrelease.yaml new file mode 100644 index 0000000..f41ad15 --- /dev/null +++ b/clusters/kairos/monitoring/grafana/helmrelease.yaml @@ -0,0 +1,19 @@ +apiVersion: helm.toolkit.fluxcd.io/v2 +kind: HelmRelease +metadata: + name: grafana +spec: + chart: + spec: + chart: grafana + reconcileStrategy: ChartVersion + sourceRef: + kind: HelmRepository + name: grafana-repo + version: 8.4.1 + interval: 1m0s + targetNamespace: monitoring + values: + persistence: + enabled: true + storageClassName: longhorn \ No newline at end of file diff --git a/clusters/kairos/monitoring/grafana/ingress.yaml b/clusters/kairos/monitoring/grafana/ingress.yaml new file mode 100644 index 0000000..92e37a0 --- /dev/null +++ b/clusters/kairos/monitoring/grafana/ingress.yaml @@ -0,0 +1,16 @@ +apiVersion: traefik.io/v1alpha1 +kind: IngressRoute +metadata: + name: grafana +spec: + entryPoints: + - web + routes: + - match: Host(`grafana.k3s`) + kind: Rule + services: + - name: monitoring-grafana + namespace: monitoring + nativeLB: true + kind: Service + port: 80 \ No newline at end of file diff --git a/clusters/kairos/monitoring/grafana/kustomization.yaml b/clusters/kairos/monitoring/grafana/kustomization.yaml new file mode 100644 index 0000000..45791de --- /dev/null +++ b/clusters/kairos/monitoring/grafana/kustomization.yaml @@ -0,0 +1,5 @@ +apiVersion: kustomize.config.k8s.io/v1beta1 +kind: Kustomization +resources: +- helmrelease.yaml +- ingress.yaml \ No newline at end of file diff --git a/clusters/kairos/monitoring/helmrepo.yaml b/clusters/kairos/monitoring/helmrepo.yaml new file mode 100644 index 0000000..1101eb5 --- /dev/null +++ b/clusters/kairos/monitoring/helmrepo.yaml @@ -0,0 +1,7 @@ +apiVersion: source.toolkit.fluxcd.io/v1 +kind: HelmRepository +metadata: + name: grafana-repo +spec: + interval: 1m0s + url: https://grafana.github.io/helm-charts diff --git a/clusters/kairos/monitoring/kustomization.yaml b/clusters/kairos/monitoring/kustomization.yaml new file mode 100644 index 0000000..51cf8b8 --- /dev/null +++ b/clusters/kairos/monitoring/kustomization.yaml @@ -0,0 +1,9 @@ +apiVersion: kustomize.config.k8s.io/v1beta1 +kind: Kustomization +namespace: monitoring +resources: +- namespace.yaml +- helmrepo.yaml +- ./loki +- ./promtail +- ./grafana \ No newline at end of file diff --git a/clusters/kairos/monitoring/loki/helmrelease.yaml b/clusters/kairos/monitoring/loki/helmrelease.yaml new file mode 100644 index 0000000..f976928 --- /dev/null +++ b/clusters/kairos/monitoring/loki/helmrelease.yaml @@ -0,0 +1,70 @@ +apiVersion: helm.toolkit.fluxcd.io/v2 +kind: HelmRelease +metadata: + name: loki +spec: + chart: + spec: + chart: loki + reconcileStrategy: ChartVersion + sourceRef: + kind: HelmRepository + name: grafana-repo + version: 6.7.4 + interval: 1m0s + targetNamespace: monitoring + values: + loki: + auth_enabled: false + schemaConfig: + configs: + - from: "2024-04-01" + store: tsdb + object_store: s3 + schema: v13 + index: + prefix: loki_index_ + period: 24h + ingester: + chunk_encoding: snappy + tracing: + enabled: true + querier: + max_concurrent: 2 + + deploymentMode: SimpleScalable + + backend: + replicas: 1 + read: + replicas: 1 + write: + replicas: 1 + + # Enable minio for storage + minio: + enabled: true + persistence: + storageClass: longhorn + + # Zero out replica counts of other deployment modes + singleBinary: + replicas: 0 + ingester: + replicas: 0 + querier: + replicas: 0 + queryFrontend: + replicas: 0 + queryScheduler: + replicas: 0 + distributor: + replicas: 0 + compactor: + replicas: 0 + indexGateway: + replicas: 0 + bloomCompactor: + replicas: 0 + bloomGateway: + replicas: 0 \ No newline at end of file diff --git a/clusters/kairos/monitoring/loki/kustomization.yaml b/clusters/kairos/monitoring/loki/kustomization.yaml new file mode 100644 index 0000000..eb5482e --- /dev/null +++ b/clusters/kairos/monitoring/loki/kustomization.yaml @@ -0,0 +1,4 @@ +apiVersion: kustomize.config.k8s.io/v1beta1 +kind: Kustomization +resources: +- helmrelease.yaml \ No newline at end of file diff --git a/clusters/kairos/monitoring/namespace.yaml b/clusters/kairos/monitoring/namespace.yaml new file mode 100644 index 0000000..3335b6a --- /dev/null +++ b/clusters/kairos/monitoring/namespace.yaml @@ -0,0 +1,4 @@ +apiVersion: v1 +kind: Namespace +metadata: + name: monitoring \ No newline at end of file diff --git a/clusters/kairos/monitoring/promtail/helmrelease.yaml b/clusters/kairos/monitoring/promtail/helmrelease.yaml new file mode 100644 index 0000000..1a184a7 --- /dev/null +++ b/clusters/kairos/monitoring/promtail/helmrelease.yaml @@ -0,0 +1,20 @@ +apiVersion: helm.toolkit.fluxcd.io/v2 +kind: HelmRelease +metadata: + name: promtail +spec: + chart: + spec: + chart: promtail + reconcileStrategy: ChartVersion + sourceRef: + kind: HelmRepository + name: grafana-repo + version: 6.16.4 + interval: 1m0s + targetNamespace: monitoring + values: + config: + clients: + - url: http://monitoring-loki-gateway.monitoring.svc.cluster.local:3100/loki/api/v1/push + tenant_id: 1 \ No newline at end of file diff --git a/clusters/kairos/monitoring/promtail/kustomization.yaml b/clusters/kairos/monitoring/promtail/kustomization.yaml new file mode 100644 index 0000000..eb5482e --- /dev/null +++ b/clusters/kairos/monitoring/promtail/kustomization.yaml @@ -0,0 +1,4 @@ +apiVersion: kustomize.config.k8s.io/v1beta1 +kind: Kustomization +resources: +- helmrelease.yaml \ No newline at end of file diff --git a/clusters/kairos/traefik/helmconfig.yaml b/clusters/kairos/traefik/helmconfig.yaml new file mode 100644 index 0000000..41da9c1 --- /dev/null +++ b/clusters/kairos/traefik/helmconfig.yaml @@ -0,0 +1,9 @@ +apiVersion: helm.cattle.io/v1 +kind: HelmChartConfig +metadata: + name: traefik + namespace: kube-system +spec: + valuesContent: |- + additionalArguments: + - "--api.insecure=true" \ No newline at end of file diff --git a/clusters/kairos/traefik/ingress.yaml b/clusters/kairos/traefik/ingress.yaml new file mode 100644 index 0000000..143dfec --- /dev/null +++ b/clusters/kairos/traefik/ingress.yaml @@ -0,0 +1,16 @@ +apiVersion: traefik.io/v1alpha1 +kind: IngressRoute +metadata: + name: traefik +spec: + entryPoints: + - web + routes: + - match: Host(`traefik.k3s`) + kind: Rule + services: + - name: traefik-dashboard + namespace: kube-system + nativeLB: true + kind: Service + port: 9000 \ No newline at end of file diff --git a/clusters/kairos/traefik/kustomization.yaml b/clusters/kairos/traefik/kustomization.yaml new file mode 100644 index 0000000..58cfc70 --- /dev/null +++ b/clusters/kairos/traefik/kustomization.yaml @@ -0,0 +1,7 @@ +apiVersion: kustomize.config.k8s.io/v1beta1 +kind: Kustomization +namespace: kube-system +resources: +- helmconfig.yaml +- service.yaml +- ingress.yaml \ No newline at end of file diff --git a/clusters/kairos/traefik/service.yaml b/clusters/kairos/traefik/service.yaml new file mode 100644 index 0000000..5b122a5 --- /dev/null +++ b/clusters/kairos/traefik/service.yaml @@ -0,0 +1,12 @@ +apiVersion: v1 +kind: Service +metadata: + name: traefik-dashboard +spec: + type: ClusterIP + selector: + app.kubernetes.io/name: traefik + ports: + - name: http + port: 9000 + targetPort: 9000 \ No newline at end of file