Revert "Remove everything!"

This reverts commit f11c3f820d.
This commit is contained in:
2024-08-06 00:51:46 +01:00
parent f11c3f820d
commit 470621ab72
17 changed files with 225 additions and 0 deletions

View File

@@ -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

View File

@@ -0,0 +1,6 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
namespace: apps
resources:
- namespace.yaml
- fluxrepo.yaml

View File

@@ -0,0 +1,4 @@
apiVersion: v1
kind: Namespace
metadata:
name: apps

View File

@@ -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

View File

@@ -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

View File

@@ -0,0 +1,5 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
- helmrelease.yaml
- ingress.yaml

View File

@@ -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

View File

@@ -0,0 +1,9 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
namespace: monitoring
resources:
- namespace.yaml
- helmrepo.yaml
- ./loki
- ./promtail
- ./grafana

View File

@@ -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

View File

@@ -0,0 +1,4 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
- helmrelease.yaml

View File

@@ -0,0 +1,4 @@
apiVersion: v1
kind: Namespace
metadata:
name: monitoring

View File

@@ -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

View File

@@ -0,0 +1,4 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
- helmrelease.yaml

View File

@@ -0,0 +1,9 @@
apiVersion: helm.cattle.io/v1
kind: HelmChartConfig
metadata:
name: traefik
namespace: kube-system
spec:
valuesContent: |-
additionalArguments:
- "--api.insecure=true"

View File

@@ -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

View File

@@ -0,0 +1,7 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
namespace: kube-system
resources:
- helmconfig.yaml
- service.yaml
- ingress.yaml

View File

@@ -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