feat: Add kube-prometheus-stack

This commit is contained in:
Tony Du 2025-02-05 10:19:46 -08:00
parent 65ea3bcac3
commit ab47950137
8 changed files with 148 additions and 82 deletions

View File

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

View File

@ -0,0 +1,5 @@
---
apiVersion: v1
kind: Namespace
metadata:
name: kube-prometheus-stack

View File

@ -0,0 +1,38 @@
---
apiVersion: helm.toolkit.fluxcd.io/v2
kind: HelmRelease
metadata:
name: kube-prometheus-stack
namespace: kube-prometheus-stack
spec:
interval: 10m
chart:
spec:
chart: kube-prometheus-stack
sourceRef:
kind: HelmRepository
name: prometheus-community
namespace: kube-prometheus-stack
interval: 10m
values:
grafana:
adminPassword: admin
defaultDashboardsTimezone: browser
ingress:
enabled: true
annotations:
cert-manager.io/cluster-issuer: le-cf-issuer
kubernetes.io/ingress.class: traefik
hosts:
- gf.dolo.mnke.org
prometheus:
prometheusSpec:
storageSpec:
volumeClaimTemplate:
spec:
storageClassName: longhorn
accessModes: ["ReadWriteOnce"]
resources:
requests:
storage: 4Gi

View File

@ -0,0 +1,10 @@
---
apiVersion: source.toolkit.fluxcd.io/v1
kind: HelmRepository
metadata:
name: prometheus-community
namespace: kube-prometheus-stack
spec:
interval: 1m
url: https://prometheus-community.github.io/helm-charts

View File

@ -0,0 +1,5 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
- kube-prometheus-stack

View File

@ -2,90 +2,16 @@
apiVersion: kustomize.toolkit.fluxcd.io/v1
kind: Kustomization
metadata:
name: infrastructure-01
namespace: flux-system
spec:
interval: 1h
retryInterval: 1m
timeout: 5m
sourceRef:
kind: GitRepository
name: flux-system
path: ./k8s/infrastructure/01
prune: true
wait: true
---
apiVersion: kustomize.toolkit.fluxcd.io/v1
kind: Kustomization
metadata:
name: infrastructure-02
name: apps
namespace: flux-system
spec:
interval: 10m0s
dependsOn:
- name: infrastructure-01
interval: 1h
retryInterval: 1m
timeout: 5m
- name: infrastructure-04
sourceRef:
kind: GitRepository
name: flux-system
path: ./k8s/infrastructure/02
path: ./k8s/apps
prune: true
wait: true
---
apiVersion: kustomize.toolkit.fluxcd.io/v1
kind: Kustomization
metadata:
name: infrastructure-03
namespace: flux-system
spec:
dependsOn:
- name: infrastructure-02
interval: 1h
retryInterval: 1m
timeout: 5m
sourceRef:
kind: GitRepository
name: flux-system
path: ./k8s/infrastructure/03
prune: true
wait: true
---
apiVersion: kustomize.toolkit.fluxcd.io/v1
kind: Kustomization
metadata:
name: infrastructure-04
namespace: flux-system
spec:
dependsOn:
- name: infrastructure-03
interval: 1h
retryInterval: 1m
timeout: 5m
sourceRef:
kind: GitRepository
name: flux-system
path: ./k8s/infrastructure/04
prune: true
wait: true
# ---
# apiVersion: kustomize.toolkit.fluxcd.io/v1
# kind: Kustomization
# metadata:
# name: apps
# namespace: flux-system
# spec:
# interval: 10m0s
# dependsOn:
# - name: infra-configs
# sourceRef:
# kind: GitRepository
# name: flux-system
# path: ./apps/production
# prune: true
# wait: true
# timeout: 5m0s
timeout: 5m0s

View File

@ -0,0 +1,75 @@
---
apiVersion: kustomize.toolkit.fluxcd.io/v1
kind: Kustomization
metadata:
name: infrastructure-01
namespace: flux-system
spec:
interval: 1h
retryInterval: 1m
timeout: 5m
sourceRef:
kind: GitRepository
name: flux-system
path: ./k8s/infrastructure/01
prune: true
wait: true
---
apiVersion: kustomize.toolkit.fluxcd.io/v1
kind: Kustomization
metadata:
name: infrastructure-02
namespace: flux-system
spec:
dependsOn:
- name: infrastructure-01
interval: 1h
retryInterval: 1m
timeout: 5m
sourceRef:
kind: GitRepository
name: flux-system
path: ./k8s/infrastructure/02
prune: true
wait: true
---
apiVersion: kustomize.toolkit.fluxcd.io/v1
kind: Kustomization
metadata:
name: infrastructure-03
namespace: flux-system
spec:
dependsOn:
- name: infrastructure-02
interval: 1h
retryInterval: 1m
timeout: 5m
sourceRef:
kind: GitRepository
name: flux-system
path: ./k8s/infrastructure/03
prune: true
wait: true
---
apiVersion: kustomize.toolkit.fluxcd.io/v1
kind: Kustomization
metadata:
name: infrastructure-04
namespace: flux-system
spec:
dependsOn:
- name: infrastructure-03
interval: 1h
retryInterval: 1m
timeout: 5m
sourceRef:
kind: GitRepository
name: flux-system
path: ./k8s/infrastructure/04
prune: true
wait: true

View File

@ -21,7 +21,7 @@ spec:
additionalArguments:
- "--serversTransport.insecureSkipVerify=true"
- "--log.level=INFO"
- "--log.level=DEBUG"
deployment:
enabled: true
@ -33,15 +33,16 @@ spec:
ports:
web:
port: 80
redirections:
entrypoint:
entryPoint:
to: websecure
scheme: https
permanent: true
websecure:
port: 443
http3:
enabled: true
advertisedPort: 4443
tls:
enabled: true