mirror of
https://github.com/dragonflydb/dragonfly
synced 2024-11-21 23:19:53 +00:00
Namespace support in prometheus rule (#2931)
* helm templating and test cases for namespace support in prometheus rule crd * updated prometheus rules --------- Co-authored-by: Yash Jagdale <yash@databahn.ai> Co-authored-by: Roman Gershman <roman@dragonflydb.io>
This commit is contained in:
parent
7226024a9f
commit
6545809852
1
.gitignore
vendored
1
.gitignore
vendored
@ -16,3 +16,4 @@ genfiles/*
|
||||
_deps
|
||||
releases
|
||||
.DS_Store
|
||||
.idea/*
|
||||
|
145
contrib/charts/dragonfly/ci/prometheusrules-values.golden.yaml
Normal file
145
contrib/charts/dragonfly/ci/prometheusrules-values.golden.yaml
Normal file
@ -0,0 +1,145 @@
|
||||
---
|
||||
# Source: dragonfly/templates/serviceaccount.yaml
|
||||
apiVersion: v1
|
||||
kind: ServiceAccount
|
||||
metadata:
|
||||
name: test-dragonfly
|
||||
namespace: default
|
||||
labels:
|
||||
app.kubernetes.io/name: dragonfly
|
||||
app.kubernetes.io/instance: test
|
||||
app.kubernetes.io/version: "v1.17.1"
|
||||
app.kubernetes.io/managed-by: Helm
|
||||
---
|
||||
# Source: dragonfly/templates/metrics-service.yaml
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: test-dragonfly-metrics
|
||||
namespace: default
|
||||
labels:
|
||||
app.kubernetes.io/name: dragonfly
|
||||
app.kubernetes.io/instance: test
|
||||
app.kubernetes.io/version: "v1.17.1"
|
||||
app.kubernetes.io/managed-by: Helm
|
||||
type: metrics
|
||||
spec:
|
||||
type: ClusterIP
|
||||
ports:
|
||||
- name: metrics
|
||||
port: 6379
|
||||
targetPort: 6379
|
||||
protocol: TCP
|
||||
selector:
|
||||
app.kubernetes.io/name: dragonfly
|
||||
app.kubernetes.io/instance: test
|
||||
---
|
||||
# Source: dragonfly/templates/service.yaml
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: test-dragonfly
|
||||
namespace: default
|
||||
labels:
|
||||
app.kubernetes.io/name: dragonfly
|
||||
app.kubernetes.io/instance: test
|
||||
app.kubernetes.io/version: "v1.17.1"
|
||||
app.kubernetes.io/managed-by: Helm
|
||||
spec:
|
||||
type: ClusterIP
|
||||
ports:
|
||||
- port: 6379
|
||||
targetPort: dragonfly
|
||||
protocol: TCP
|
||||
name: dragonfly
|
||||
selector:
|
||||
app.kubernetes.io/name: dragonfly
|
||||
app.kubernetes.io/instance: test
|
||||
---
|
||||
# Source: dragonfly/templates/deployment.yaml
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: test-dragonfly
|
||||
namespace: default
|
||||
labels:
|
||||
app.kubernetes.io/name: dragonfly
|
||||
app.kubernetes.io/instance: test
|
||||
app.kubernetes.io/version: "v1.17.1"
|
||||
app.kubernetes.io/managed-by: Helm
|
||||
spec:
|
||||
replicas: 1
|
||||
selector:
|
||||
matchLabels:
|
||||
app.kubernetes.io/name: dragonfly
|
||||
app.kubernetes.io/instance: test
|
||||
template:
|
||||
metadata:
|
||||
annotations:
|
||||
labels:
|
||||
app.kubernetes.io/name: dragonfly
|
||||
app.kubernetes.io/instance: test
|
||||
spec:
|
||||
serviceAccountName: test-dragonfly
|
||||
containers:
|
||||
- name: dragonfly
|
||||
image: "docker.dragonflydb.io/dragonflydb/dragonfly:v1.17.1"
|
||||
imagePullPolicy: IfNotPresent
|
||||
ports:
|
||||
- name: dragonfly
|
||||
containerPort: 6379
|
||||
protocol: TCP
|
||||
livenessProbe:
|
||||
exec:
|
||||
command:
|
||||
- /bin/sh
|
||||
- /usr/local/bin/healthcheck.sh
|
||||
failureThreshold: 3
|
||||
initialDelaySeconds: 10
|
||||
periodSeconds: 10
|
||||
successThreshold: 1
|
||||
timeoutSeconds: 5
|
||||
readinessProbe:
|
||||
exec:
|
||||
command:
|
||||
- /bin/sh
|
||||
- /usr/local/bin/healthcheck.sh
|
||||
failureThreshold: 3
|
||||
initialDelaySeconds: 10
|
||||
periodSeconds: 10
|
||||
successThreshold: 1
|
||||
timeoutSeconds: 5
|
||||
args:
|
||||
- "--alsologtostderr"
|
||||
resources:
|
||||
limits: {}
|
||||
requests: {}
|
||||
---
|
||||
# Source: dragonfly/templates/servicemonitor.yaml
|
||||
apiVersion: monitoring.coreos.com/v1
|
||||
kind: ServiceMonitor
|
||||
metadata:
|
||||
name: test-dragonfly-metrics
|
||||
namespace: default
|
||||
labels:
|
||||
app.kubernetes.io/name: dragonfly
|
||||
app.kubernetes.io/instance: test
|
||||
app.kubernetes.io/version: "v1.17.1"
|
||||
app.kubernetes.io/managed-by: Helm
|
||||
spec:
|
||||
endpoints:
|
||||
- interval: 10s
|
||||
scrapeTimeout: 10s
|
||||
honorLabels: true
|
||||
port: metrics
|
||||
path: /metrics
|
||||
scheme: http
|
||||
jobLabel: "test"
|
||||
selector:
|
||||
matchLabels:
|
||||
app.kubernetes.io/name: dragonfly
|
||||
app.kubernetes.io/instance: test
|
||||
type: metrics
|
||||
namespaceSelector:
|
||||
matchNames:
|
||||
- default
|
16
contrib/charts/dragonfly/ci/prometheusrules-values.yaml
Normal file
16
contrib/charts/dragonfly/ci/prometheusrules-values.yaml
Normal file
@ -0,0 +1,16 @@
|
||||
serviceMonitor:
|
||||
enabled: true
|
||||
prometheusRule:
|
||||
enabled: true
|
||||
namespace: default
|
||||
spec:
|
||||
- alert: RedisDown
|
||||
expr: absent(dragonfly_master > 0)
|
||||
for: 0m
|
||||
labels:
|
||||
severity: critical
|
||||
annotations:
|
||||
summary: Redis instance is down
|
||||
description: >
|
||||
"Redis instance is down"
|
||||
runbook_url: "https://octopus.com/docs/runbooks/runbook-examples"
|
@ -3,7 +3,7 @@ apiVersion: monitoring.coreos.com/v1
|
||||
kind: PrometheusRule
|
||||
metadata:
|
||||
name: {{ template "dragonfly.fullname" . }}-metrics
|
||||
namespace: {{ .Release.Namespace }}
|
||||
namespace: {{ .Values.prometheusRule.namespace | default .Release.Namespace }}
|
||||
labels:
|
||||
{{- include "dragonfly.labels" . | nindent 4 }}
|
||||
spec:
|
||||
|
Loading…
Reference in New Issue
Block a user