Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Extend support for Prometheus exporters (#200)
* Make the serviceMonitor optional * Remove prometheusRule that is unsed from values * Optional serviceMonitor for PuppetDB Exporter * Make serviceMonitor optional * Update CHANGELOG and bump Chart version * Fix PuppetDB-Exporter container template vlaues * Add JMX exporter to compilers * Update tests * Enable serviceMonitor in serviceMonitor tests * Add more test coverage * add global values * Fix compiler labels in jmx templates * Add jmx to masters deployment and compiler statefulset * Move volume to correct location for pserver pods * Add annotations to PuppetDB and Masters * Update changelog * Add default puppetdb scrape interval * Add podAnnotations * Fix labels in serviceMonitor * Add more tests and cover everything with snapshots * Bump version and update changelog * Update snapshots to represent correct version in branch
- Loading branch information
1 parent
cc723f6
commit 649b2ed
Showing
40 changed files
with
1,477 additions
and
86 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
name: Lint and publish puppetserver helm chart | ||
name: CI / Release | ||
|
||
on: | ||
pull_request: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
{{- if .Values.metrics.prometheus.jmx.enabled }} | ||
apiVersion: v1 | ||
kind: ConfigMap | ||
metadata: | ||
name: {{ template "puppetserver.fullname" . }}-jmx-config | ||
labels: | ||
{{- include "puppetserver.puppetserver.labels" . | nindent 4 }} | ||
{{- include "puppetserver.puppetserver-compilers.labels" . | nindent 4 }} | ||
data: | ||
jmx_exporter.yaml: |- | ||
{{ .Values.metrics.prometheus.jmx.config | nindent 4 }} | ||
{{- end }} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
{{- if and .Values.metrics.prometheus.jmx.enabled .Values.metrics.prometheus.jmx.serviceMonitor.enabled }} | ||
{{- if (not (.Capabilities.APIVersions.Has "monitoring.coreos.com/v1")) }} | ||
{{- if (not (.Values.metrics.prometheus.disableAPICheck)) }} | ||
{{- fail "ERROR: You have to deploy monitoring.coreos.com/v1 first" }} | ||
{{- end }} | ||
{{- end }} | ||
apiVersion: monitoring.coreos.com/v1 | ||
kind: ServiceMonitor | ||
metadata: | ||
name: {{ template "puppetserver.fullname" . }}-jmx | ||
namespace: {{ default .Release.Namespace .Values.metrics.prometheus.jmx.serviceMonitor.namespace | quote }} | ||
labels: | ||
{{- include "puppetserver.puppetserver.labels" . | nindent 4 }} | ||
{{- with .Values.metrics.prometheus.jmx.serviceMonitor.additionalLabels }} | ||
{{- toYaml . | nindent 4 }} | ||
{{- end }} | ||
release: kube-prometheus-stack | ||
spec: | ||
jobLabel: {{ .Values.metrics.prometheus.jmx.serviceMonitor.jobLabel | default "{{.Release.Name }}-jmx" }} | ||
endpoints: | ||
- port: metrics | ||
path: /metrics | ||
{{- with .Values.metrics.prometheus.jmx.serviceMonitor.honorLabels }} | ||
honorLabels: {{ . }} | ||
{{- end }} | ||
{{- with .Values.metrics.prometheus.jmx.serviceMonitor.honorTimestamps }} | ||
honorTimestamps: {{ . }} | ||
{{- end }} | ||
{{- with .Values.metrics.prometheus.jmx.serviceMonitor.enableHttp2 }} | ||
enableHttp2: {{ . }} | ||
{{- end }} | ||
{{- with .Values.metrics.prometheus.jmx.serviceMonitor.followRedirects }} | ||
followRedirects: {{ . }} | ||
{{- end }} | ||
{{- with .Values.metrics.prometheus.jmx.serviceMonitor.interval }} | ||
interval: {{ . }} | ||
{{- end }} | ||
{{- with .Values.metrics.prometheus.jmx.serviceMonitor.scrapeTimeout }} | ||
scrapeTimeout: {{ . }} | ||
{{- end }} | ||
{{- if .Values.metrics.prometheus.jmx.serviceMonitor.metricRelabelings }} | ||
metricRelabelings: | ||
{{ tpl (toYaml .Values.metrics.prometheus.jmx.serviceMonitor.metricRelabelings | indent 6) . }} | ||
{{- end }} | ||
{{- if .Values.metrics.prometheus.jmx.serviceMonitor.relabelings }} | ||
relabelings: | ||
{{ toYaml .Values.metrics.prometheus.jmx.serviceMonitor.relabelings | indent 6 }} | ||
{{- end }} | ||
namespaceSelector: | ||
matchNames: | ||
- {{ .Release.Namespace | quote }} | ||
selector: | ||
matchLabels: | ||
{{- include "puppetserver.puppetserver.matchLabels" . | nindent 6 }} | ||
{{- end }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.