fluxcd: add prometheus

This commit is contained in:
Márcio Fernandes
2026-06-07 21:40:22 +00:00
parent f9a16cb0ca
commit 8bf2f786d5
14 changed files with 72 additions and 12 deletions
+5 -6
View File
@@ -1,11 +1,10 @@
# monitoring
## namespace
``` bash
kubectl create namespace monitoring
```
## prometheus-stack
- <https://github.com/prometheus-community/helm-charts/tree/main/charts/kube-prometheus-stack>
- <https://github.com/prometheus-community/helm-charts/blob/main/charts/kube-prometheus-stack/values.yaml>
## promtail
## Setup
@@ -16,7 +15,7 @@ Using flux for reconciliation.
./ops-scripts/apply-flux.sh
```
**Encrypt secrets:**
**promtail Encrypt secrets:**
``` bash
sops -e deploy/promtail/helm-values.private.dec.yaml > deploy/promtail/helm-values.private.yaml
@@ -0,0 +1,16 @@
apiVersion: kustomize.toolkit.fluxcd.io/v1
kind: Kustomization
metadata:
name: prometheus
spec:
interval: 1m
sourceRef:
kind: GitRepository
name: casa
namespace: casa-limbosolutions-com
path: services/monitoring/deploy/prometheus
prune: true
decryption:
provider: sops
secretRef:
name: flux-sops-age
@@ -8,7 +8,7 @@ spec:
kind: GitRepository
name: casa
namespace: casa-limbosolutions-com
path: services/monitoring/promtail
path: services/monitoring/deploy/promtail
prune: true
decryption:
provider: sops
@@ -0,0 +1,28 @@
apiVersion: helm.toolkit.fluxcd.io/v2
kind: HelmRelease
metadata:
name: monitoring
spec:
releaseName: prometheus-stack
interval: 40h
chart:
spec:
chart: prometheus-stack
version: 86.x.x
sourceRef:
kind: HelmRepository
name: prometheus-stack
interval: 40h
valuesFrom:
- kind: Secret
name: prometheus-stack-helm-values
valuesKey: 01-only-crd-and-operator.yaml
- kind: Secret
name: prometheus-stack-helm-values
valuesKey: 02-kube-metrics.yaml
- kind: Secret
name: prometheus-stack-helm-values
valuesKey: 03-node-exporter.yaml
- kind: Secret
name: prometheus-stack-helm-values
valuesKey: 04-kubelet.yaml
@@ -0,0 +1,7 @@
apiVersion: source.toolkit.fluxcd.io/v1
kind: HelmRepository
metadata:
name: prometheus-stack
spec:
interval: 40h
url: https://prometheus-community.github.io/helm-charts
@@ -0,0 +1,14 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
namespace: monitoring
resources:
- helm/helm-repo.yaml
- helm/helm-release.yaml
- prometheus-agent.yaml
secretGenerator:
- name: prometheus-stack-helm-values
files:
- 01-only-crd-and-operator.yaml=helm/01-only-crd-and-operator.yaml
- 02-kube-metrics.yaml=helm/02-kube-metrics.yaml
- 03-node-exporter.yaml=helm/03-node-exporter.yaml
- 04-kubelet.yaml=helm/helm/04-kubelet.yaml
@@ -3,7 +3,6 @@ apiVersion: monitoring.coreos.com/v1alpha1
kind: PrometheusAgent
metadata:
name: prometheus-agent
namespace: monitoring
spec:
podMonitorSelector: null
+1 -3
View File
@@ -1,8 +1,6 @@
# Prometheus Setup
- <https://github.com/prometheus-community/helm-charts/tree/main/charts/kube-prometheus-stack>
- <https://github.com/prometheus-community/helm-charts/blob/main/charts/kube-prometheus-stack/values.yaml>
## helm chart
```bash
@@ -1 +0,0 @@
# use for testing