move k8s cluster data to its own dir

This commit is contained in:
Lee
2024-09-23 10:08:50 +01:00
parent 65148505bd
commit cd9b8a1b2c
95 changed files with 0 additions and 0 deletions

View File

@ -0,0 +1,21 @@
apiVersion: traefik.io/v1alpha1
kind: IngressRoute
metadata:
name: kubernetes-grafana-external-ingress
namespace: monitoring
annotations:
kubernetes.io/ingress.class: traefik-external
spec:
entryPoints:
- websecure
routes:
- match: Host(`kubernetes-grafana.local.fascinated.cc`)
kind: Rule
middlewares:
- name: default-headers
namespace: traefik
services:
- name: kube-prometheus-stack-grafana
port: 80
tls:
secretName: fascinated-cc

View File

@ -0,0 +1,58 @@
---
apiVersion: source.toolkit.fluxcd.io/v1
kind: HelmRepository
metadata:
name: monitoring
namespace: monitoring
spec:
interval: 12h
url: https://prometheus-community.github.io/helm-charts
---
apiVersion: helm.toolkit.fluxcd.io/v2
kind: HelmRelease
metadata:
name: kube-prometheus-stack
namespace: monitoring
spec:
interval: 30m
chart:
spec:
chart: kube-prometheus-stack
version: "62.7.0"
sourceRef:
kind: HelmRepository
name: monitoring
namespace: monitoring
interval: 12h
values:
# Prometheus Volume
prometheus:
prometheusSpec:
scrapeInterval: 30s
evaluationInterval: 30s
ruleSelectorNilUsesHelmValues: false
serviceMonitorSelectorNilUsesHelmValues: false
podMonitorSelectorNilUsesHelmValues: false
probeSelectorNilUsesHelmValues: false
scrapeConfigSelectorNilUsesHelmValues: false
enableAdminAPI: true
walCompression: true
enableFeatures:
- auto-gomemlimit
- memory-snapshot-on-shutdown
- new-service-discovery-manager
retention: 30d
retentionSize: 40GB
resources:
requests:
cpu: 100m
limits:
memory: 1500Mi
storageSpec:
volumeClaimTemplate:
spec:
storageClassName: nfs-csi
accessModes: ["ReadWriteOnce"]
resources:
requests:
storage: 50Gi

View File

@ -0,0 +1,8 @@
---
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
namespace: monitoring
resources:
- namespace.yaml
- kube-prometheus-stack.yaml
- ingress.yaml

View File

@ -0,0 +1,8 @@
---
apiVersion: v1
kind: Namespace
metadata:
name: monitoring
labels:
pod-security.kubernetes.io/enforce: privileged
pod-security.kubernetes.io/enforce-version: latest