You've already forked prometheus-postgres-exporter
Compare commits
10 Commits
Author | SHA1 | Date | |
---|---|---|---|
16cfa36fda
|
|||
94fbc5e38f
|
|||
dcc7bae921
|
|||
503c622df5
|
|||
bf9bd4853f
|
|||
80a8e8096d
|
|||
79b61b0035
|
|||
d33b17b973 | |||
a0d241c90c
|
|||
688718008f
|
@ -4,7 +4,7 @@ description: Prometheus metric exporter for PostgreSQL
|
||||
type: application
|
||||
kubeVersion: ">=1.20.0"
|
||||
version: "0.1.0"
|
||||
appVersion: "0.15.0"
|
||||
appVersion: "0.16.0"
|
||||
|
||||
# icon: https://annotations.example.com/icon.png
|
||||
|
||||
|
@ -12,7 +12,7 @@ and use it to deploy the exporter. It also contains further configuration exampl
|
||||
Furthermore, this helm chart unit tests to detect regressions and stabilize the deployment. Additionally, this helm
|
||||
chart is tested for deployment scenarios with ArgoCD.
|
||||
|
||||
> ![NOTE]
|
||||
> [!NOTE]
|
||||
> This is not the official *community* helm chart of the Prometheus metric exporter for PostgreSQL databases. You can
|
||||
> find the official community chart [here](https://github.com/prometheus-community/helm-charts).
|
||||
|
||||
|
@ -24,10 +24,10 @@
|
||||
"matchUpdateTypes": [ "minor", "patch"]
|
||||
},
|
||||
{
|
||||
"addLabels": [ "renovate/prometheus-postgres-exporter", "renovate/automerge" ],
|
||||
"addLabels": [ "renovate/markdownlint", "renovate/automerge" ],
|
||||
"automerge": true,
|
||||
"matchPackageNames": [ "prometheus-postgres-exporter" ],
|
||||
"matchManagers": [ "regex" ],
|
||||
"matchPackageNames": [ "markdownlint-cli", "@bitnami/readme-generator-for-helm" ],
|
||||
"matchManagers": [ "npm" ],
|
||||
"matchUpdateTypes": [ "minor", "patch"]
|
||||
}
|
||||
],
|
||||
|
@ -52,15 +52,15 @@
|
||||
{{/* volumeMounts */}}
|
||||
|
||||
{{- define "prometheus-postgres-exporter.deployment.volumeMounts" -}}
|
||||
{{- $volumeMounts := dict "volumeMounts" (.Values.deployment.postgresExporter.volumeMounts | default (list) ) }}
|
||||
{{- $volumeMounts = merge $volumeMounts (dict "volumeMounts" (list (dict "name" "config.d" "mountPath" "/etc/prometheus-postgres-exporter/config.d" ))) }}
|
||||
{{ toYaml $volumeMounts }}
|
||||
{{- $volumeMounts := .Values.deployment.postgresExporter.volumeMounts | default list }}
|
||||
{{- $volumeMounts = concat $volumeMounts (list (dict "name" "config-d" "mountPath" "/etc/prometheus-postgres-exporter/config.d" )) }}
|
||||
{{ toYaml (dict "volumeMounts" $volumeMounts) }}
|
||||
{{- end -}}
|
||||
|
||||
{{/* volumes */}}
|
||||
|
||||
{{- define "prometheus-postgres-exporter.deployment.volumes" -}}
|
||||
{{- $volumes := dict "volumes" (.Values.deployment.volumes | default (list) ) }}
|
||||
{{- $volumes := .Values.deployment.volumes | default list }}
|
||||
|
||||
{{- $exporterSecretName := .Values.config.exporterConfig.existingSecret.secretName -}}
|
||||
{{- if not .Values.config.exporterConfig.existingSecret.enabled }}
|
||||
@ -72,8 +72,8 @@
|
||||
{{- $webConfigSecretName = printf "%s-web-config" (include "prometheus-postgres-exporter.fullname" . ) }}
|
||||
{{- end }}
|
||||
|
||||
{{- $volumes = merge $volumes (dict "volumes" (list (dict "name" "config.d" "projected" (dict "defaultMode" "0444" "sources" (list (dict "secret" (dict "name" $exporterSecretName)) (dict "secret" (dict "name" $webConfigSecretName))))))) }}
|
||||
{{- $volumes = concat $volumes (list (dict "name" "config-d" "projected" (dict "defaultMode" 444 "sources" (list (dict "secret" (dict "name" $exporterSecretName)) (dict "secret" (dict "name" $webConfigSecretName)))))) }}
|
||||
|
||||
{{ toYaml $volumes }}
|
||||
{{ toYaml (dict "volumes" $volumes) }}
|
||||
|
||||
{{- end -}}
|
@ -13,5 +13,5 @@
|
||||
{{- end }}
|
||||
|
||||
{{- define "prometheus-postgres-exporter.pod.selectorLabels" -}}
|
||||
{{ include "prometheus-postgres-exporter.pod.labels" . }}
|
||||
{{ include "prometheus-postgres-exporter.selectorLabels" . }}
|
||||
{{- end }}
|
@ -24,7 +24,7 @@ spec:
|
||||
- name: postgres-exporter
|
||||
args:
|
||||
- "--config.file=/etc/prometheus-postgres-exporter/config.d/exporterConfig.yaml"
|
||||
- "--web.config.file=/etc/prometheus-postgres-exporter/config.d/web-config.yaml"
|
||||
- "--web.config.file=/etc/prometheus-postgres-exporter/config.d/webConfig.yaml"
|
||||
- "--web.listen-address=:9187"
|
||||
{{- range .Values.deployment.postgresExporter.args }}
|
||||
- {{ . | quote }}
|
||||
|
@ -11,7 +11,7 @@ metadata:
|
||||
labels:
|
||||
{{- toYaml . | nindent 4 }}
|
||||
{{- end }}
|
||||
name: {{ include "prometheus-postgres-exporter.fullname" . }}-webconfig
|
||||
name: {{ include "prometheus-postgres-exporter.fullname" . }}-web-config
|
||||
namespace: {{ .Release.Namespace }}
|
||||
stringData:
|
||||
webConfig.yaml: |
|
||||
|
@ -25,7 +25,7 @@ spec:
|
||||
{{- toYaml . | nindent 6 }}
|
||||
{{- end }}
|
||||
scrapeTimeout: {{ required "The scrape timeout of the serviceMonitor is not defined!" .Values.prometheus.metrics.serviceMonitor.scrapeTimeout }}
|
||||
scheme: {{ required "The scheme of the serviceMonitor is not defined!" .Values.prometheus.metrics.serviceMonitor.scheme}}
|
||||
scheme: {{ required "The scheme of the serviceMonitor is not defined!" .Values.prometheus.metrics.serviceMonitor.scheme }}
|
||||
targetPort: {{ required "The port of the service is not defined!" .Values.services.http.port }}
|
||||
{{- with .Values.prometheus.metrics.serviceMonitor.tlsConfig }}
|
||||
tlsConfig:
|
||||
|
@ -36,19 +36,19 @@ tests:
|
||||
path: spec.template.spec.containers[0].args
|
||||
value:
|
||||
- --config.file=/etc/prometheus-postgres-exporter/config.d/exporterConfig.yaml
|
||||
- --web.config.file=/etc/prometheus-postgres-exporter/config.d/web-config.yaml
|
||||
- --web.config.file=/etc/prometheus-postgres-exporter/config.d/webConfig.yaml
|
||||
- --web.listen-address=:9187
|
||||
- equal:
|
||||
path: spec.template.spec.containers[0].volumeMounts
|
||||
value:
|
||||
- mountPath: /etc/prometheus-postgres-exporter/config.d
|
||||
name: config.d
|
||||
name: config-d
|
||||
- equal:
|
||||
path: spec.template.spec.volumes
|
||||
value:
|
||||
- name: config.d
|
||||
- name: config-d
|
||||
projected:
|
||||
defaultMode: "0444"
|
||||
defaultMode: 444
|
||||
sources:
|
||||
- secret:
|
||||
name: prometheus-postgres-exporter-unittest-exporter-config
|
||||
@ -101,7 +101,7 @@ tests:
|
||||
path: spec.template.spec.containers[0].args
|
||||
value:
|
||||
- --config.file=/etc/prometheus-postgres-exporter/config.d/exporterConfig.yaml
|
||||
- --web.config.file=/etc/prometheus-postgres-exporter/config.d/web-config.yaml
|
||||
- --web.config.file=/etc/prometheus-postgres-exporter/config.d/webConfig.yaml
|
||||
- --web.listen-address=:9187
|
||||
- --foo=bar
|
||||
- --bar=foo
|
||||
@ -143,13 +143,13 @@ tests:
|
||||
path: spec.template.spec.containers[0].volumeMounts
|
||||
value:
|
||||
- mountPath: /etc/prometheus-postgres-exporter/config.d
|
||||
name: config.d
|
||||
name: config-d
|
||||
- equal:
|
||||
path: spec.template.spec.volumes
|
||||
value:
|
||||
- name: config.d
|
||||
- name: config-d
|
||||
projected:
|
||||
defaultMode: "0444"
|
||||
defaultMode: 444
|
||||
sources:
|
||||
- secret:
|
||||
name: exporter-config-secret
|
||||
@ -165,13 +165,13 @@ tests:
|
||||
path: spec.template.spec.containers[0].volumeMounts
|
||||
value:
|
||||
- mountPath: /etc/prometheus-postgres-exporter/config.d
|
||||
name: config.d
|
||||
name: config-d
|
||||
- equal:
|
||||
path: spec.template.spec.volumes
|
||||
value:
|
||||
- name: config.d
|
||||
- name: config-d
|
||||
projected:
|
||||
defaultMode: "0444"
|
||||
defaultMode: 444
|
||||
sources:
|
||||
- secret:
|
||||
name: prometheus-postgres-exporter-unittest-exporter-config
|
||||
@ -352,14 +352,24 @@ tests:
|
||||
hostPath:
|
||||
path: /usr/lib/prometheus-postgres-exporter/data
|
||||
asserts:
|
||||
- contains:
|
||||
- equal:
|
||||
path: spec.template.spec.containers[0].volumeMounts
|
||||
content:
|
||||
name: data
|
||||
value:
|
||||
- name: data
|
||||
mountPath: /usr/lib/prometheus-postgres-exporter/data
|
||||
- contains:
|
||||
- name: config-d
|
||||
mountPath: /etc/prometheus-postgres-exporter/config.d
|
||||
- equal:
|
||||
path: spec.template.spec.volumes
|
||||
content:
|
||||
name: data
|
||||
value:
|
||||
- name: data
|
||||
hostPath:
|
||||
path: /usr/lib/prometheus-postgres-exporter/data
|
||||
path: /usr/lib/prometheus-postgres-exporter/data
|
||||
- name: config-d
|
||||
projected:
|
||||
defaultMode: 444
|
||||
sources:
|
||||
- secret:
|
||||
name: prometheus-postgres-exporter-unittest-exporter-config
|
||||
- secret:
|
||||
name: prometheus-postgres-exporter-unittest-web-config
|
@ -58,7 +58,7 @@ tests:
|
||||
helm.sh/chart: prometheus-postgres-exporter-0.1.0
|
||||
- equal:
|
||||
path: spec.podMetricsEndpoints[0].enableHttp2
|
||||
value: false
|
||||
value: true
|
||||
- equal:
|
||||
path: spec.podMetricsEndpoints[0].followRedirects
|
||||
value: false
|
||||
@ -90,10 +90,7 @@ tests:
|
||||
path: spec.selector.matchLabels
|
||||
value:
|
||||
app.kubernetes.io/instance: prometheus-postgres-exporter-unittest
|
||||
app.kubernetes.io/managed-by: Helm
|
||||
app.kubernetes.io/name: prometheus-postgres-exporter
|
||||
app.kubernetes.io/version: 0.1.0
|
||||
helm.sh/chart: prometheus-postgres-exporter-0.1.0
|
||||
|
||||
- it: Render podMonitor with custom annotations and labels.
|
||||
set:
|
||||
@ -122,7 +119,7 @@ tests:
|
||||
set:
|
||||
prometheus.metrics.enabled: true
|
||||
prometheus.metrics.podMonitor.enabled: true
|
||||
prometheus.metrics.podMonitor.enableHttp2: true
|
||||
prometheus.metrics.podMonitor.enableHttp2: false
|
||||
prometheus.metrics.podMonitor.followRedirects: true
|
||||
prometheus.metrics.podMonitor.honorLabels: true
|
||||
prometheus.metrics.podMonitor.interval: "180s"
|
||||
@ -140,7 +137,7 @@ tests:
|
||||
count: 1
|
||||
- equal:
|
||||
path: spec.podMetricsEndpoints[0].enableHttp2
|
||||
value: true
|
||||
value: false
|
||||
- equal:
|
||||
path: spec.podMetricsEndpoints[0].followRedirects
|
||||
value: true
|
||||
|
@ -15,7 +15,7 @@ tests:
|
||||
- containsDocument:
|
||||
apiVersion: v1
|
||||
kind: Secret
|
||||
name: prometheus-postgres-exporter-unittest-webconfig
|
||||
name: prometheus-postgres-exporter-unittest-web-config
|
||||
namespace: testing
|
||||
- notExists:
|
||||
path: metadata.annotations
|
||||
|
@ -59,7 +59,7 @@ tests:
|
||||
helm.sh/chart: prometheus-postgres-exporter-0.1.0
|
||||
- equal:
|
||||
path: spec.endpoints[0].enableHttp2
|
||||
value: false
|
||||
value: true
|
||||
- equal:
|
||||
path: spec.endpoints[0].followRedirects
|
||||
value: false
|
||||
@ -121,7 +121,7 @@ tests:
|
||||
set:
|
||||
prometheus.metrics.enabled: true
|
||||
prometheus.metrics.serviceMonitor.enabled: true
|
||||
prometheus.metrics.serviceMonitor.enableHttp2: true
|
||||
prometheus.metrics.serviceMonitor.enableHttp2: false
|
||||
prometheus.metrics.serviceMonitor.followRedirects: true
|
||||
prometheus.metrics.serviceMonitor.honorLabels: true
|
||||
prometheus.metrics.serviceMonitor.interval: "180s"
|
||||
@ -139,7 +139,7 @@ tests:
|
||||
count: 1
|
||||
- equal:
|
||||
path: spec.endpoints[0].enableHttp2
|
||||
value: true
|
||||
value: false
|
||||
- equal:
|
||||
path: spec.endpoints[0].followRedirects
|
||||
value: true
|
||||
|
@ -63,10 +63,7 @@ tests:
|
||||
path: spec.selector
|
||||
value:
|
||||
app.kubernetes.io/instance: prometheus-postgres-exporter-unittest
|
||||
app.kubernetes.io/managed-by: Helm
|
||||
app.kubernetes.io/name: prometheus-postgres-exporter
|
||||
app.kubernetes.io/version: 0.1.0
|
||||
helm.sh/chart: prometheus-postgres-exporter-0.1.0
|
||||
- equal:
|
||||
path: spec.sessionAffinity
|
||||
value: None
|
||||
|
@ -313,7 +313,7 @@ prometheus:
|
||||
podMonitor:
|
||||
enabled: false
|
||||
annotations: {}
|
||||
enableHttp2: false
|
||||
enableHttp2: true
|
||||
followRedirects: false
|
||||
honorLabels: false
|
||||
labels: {}
|
||||
@ -341,7 +341,7 @@ prometheus:
|
||||
enabled: false
|
||||
annotations: {}
|
||||
labels: {}
|
||||
enableHttp2: false
|
||||
enableHttp2: true
|
||||
followRedirects: false
|
||||
honorLabels: false
|
||||
interval: "60s"
|
||||
|
Reference in New Issue
Block a user