DEV-898: fixing s3-backup + prometheus-scraping

main
friedrich goerz 3 years ago
parent 83779c0a15
commit 840b7286e1

@ -15,7 +15,7 @@ type: application
# This is the chart version. This version number should be incremented each time you make changes # This is the chart version. This version number should be incremented each time you make changes
# to the chart and its templates, including the app version. # to the chart and its templates, including the app version.
# Versions are expected to follow Semantic Versioning (https://semver.org/) # Versions are expected to follow Semantic Versioning (https://semver.org/)
version: 0.1.2 version: 0.1.3
# This is the version number of the application being deployed. This version number should be # This is the version number of the application being deployed. This version number should be
# incremented each time you make changes to the application. Versions are not expected to # incremented each time you make changes to the application. Versions are not expected to

@ -0,0 +1,17 @@
---
kind: NetworkPolicy
apiVersion: networking.k8s.io/v1
metadata:
name: ingress-prometheus2all
spec:
ingress:
- from:
- namespaceSelector:
matchLabels:
kubernetes.io/metadata.name: monitoring
podSelector:
matchLabels:
prometheus: kube-prometheus-stack-prometheus
podSelector: {}
policyTypes:
- Ingress

@ -14,5 +14,5 @@ data:
LAST_BKP_DATE_IN_UNIXSEC=$(date -d ${LAST_BKP} +"%s") LAST_BKP_DATE_IN_UNIXSEC=$(date -d ${LAST_BKP} +"%s")
STAGE={{ .Release.Name }} STAGE={{ .Release.Name | lower | replace "-" "_" }}
echo "pg_basebackup_successful_timestamp_${STAGE} ${LAST_BKP_DATE_IN_UNIXSEC}" | curl --data-binary @- "{{ .Values.postgres.monitoring.prometheusPushgatewayURL }}" echo "pg_basebackup_successful_timestamp_${STAGE} ${LAST_BKP_DATE_IN_UNIXSEC}" | curl --data-binary @- "{{ .Values.postgres.monitoring.prometheusPushgatewayURL }}"

@ -15,6 +15,6 @@ spec:
labels: labels:
team: {{ .Values.postgres.monitoring.alerts.postgres.basebackup.teamLabel | quote }} team: {{ .Values.postgres.monitoring.alerts.postgres.basebackup.teamLabel | quote }}
severity: critical severity: critical
expr: absent(pg_basebackup_successful_timestamp_{{ .Release.Name }}) or (time() - pg_basebackup_successful_timestamp_{{ .Release.Name }} > {{ .Values.postgres.monitoring.alerts.postgres.basebackup.timeThreshold }}) expr: absent(pg_basebackup_successful_timestamp_{{ .Release.Name | lower | replace "-" "_" }}) or (time() - pg_basebackup_successful_timestamp_{{ .Release.Name | lower | replace "-" "_" }} > {{ .Values.postgres.monitoring.alerts.postgres.basebackup.timeThreshold }})
annotations: annotations:
message: last postgres backup found older than {{ .Values.postgres.monitoring.alerts.postgres.basebackup.timeThreshold }} message: last postgres backup found older than {{ .Values.postgres.monitoring.alerts.postgres.basebackup.timeThreshold }}

Loading…
Cancel
Save