Skip to content

Commit 0bdb3e2

Browse files
use edge rules
1 parent a43779e commit 0bdb3e2

File tree

4 files changed

+53
-1
lines changed

4 files changed

+53
-1
lines changed
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
---
2+
apiVersion: "kustomize.config.k8s.io/v1alpha1"
3+
kind: "Component"
4+
patches:
5+
- target:
6+
kind: "Deployment"
7+
name: "prometheus"
8+
path: "patch-initcontainer.yaml"
9+
- target:
10+
kind: "Deployment"
11+
name: "prometheus"
12+
patch: |-
13+
- op: "add"
14+
path: "/spec/template/spec/volumes/-"
15+
value:
16+
name: "rules"
17+
emptyDir:
18+
sizeLimit: "100Mi"
19+
- op: "add"
20+
path: "/spec/template/spec/containers/0/volumeMounts/-"
21+
value:
22+
name: "rules"
23+
mountPath: "/rules"
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
---
2+
- op: "add"
3+
path: "/spec/template/spec/initContainers"
4+
value:
5+
- name: "seed"
6+
image: "ghcr.io/soerenschneider/alerting-rules:main-20240403210327"
7+
imagePullPolicy: "IfNotPresent"
8+
command: ["rsync", "-vr", "/rules/", "/rules-dest/"]
9+
securityContext:
10+
runAsUser: 65532
11+
runAsGroup: 65532
12+
readOnlyRootFilesystem: true
13+
runAsNonRoot: true
14+
allowPrivilegeEscalation: false
15+
capabilities:
16+
drop:
17+
- "ALL"
18+
seccompProfile:
19+
type: "RuntimeDefault"
20+
resources:
21+
requests:
22+
memory: "16Mi"
23+
cpu: "5m"
24+
limits:
25+
memory: "512Mi"
26+
volumeMounts:
27+
- name: "rules"
28+
mountPath: "/rules-dest"

clusters/dqs.dd.soeren.cloud/monitoring/prometheus/kustomization.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ resources:
66
- ../../../../apps/monitoring/prometheus
77
components:
88
- ../../../../apps/monitoring/prometheus/components/config
9+
- ../../../../apps/monitoring/prometheus/components/initcontainer-seed-rules
910
- ../../../../apps/monitoring/prometheus/components/rbac
1011
- ../../../../apps/monitoring/prometheus/components/reverse-proxy
1112
- ../../../../apps/monitoring/prometheus/components/tls-client-cert

clusters/dqs.dd.soeren.cloud/monitoring/prometheus/prometheus-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ global:
66
cluster: dqs.dd.soeren.cloud
77
location: dd
88
datacenter: dd
9-
rule_files: [/etc/prometheus/rules/*.rules]
9+
rule_files: [/rules/basics/*.rules]
1010
alerting:
1111
alertmanagers:
1212
- scheme: http

0 commit comments

Comments
 (0)