-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(prometheus): Switch to upstream prometheus as the default Prometheus image #166
Changes from all commits
9c4d2c4
10fd5fe
7833480
33bbae6
4aa60ef
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,35 @@ | ||
{{- if not .Values.prometheus.remote }} | ||
{{- if not .Values.prometheus.enableSideCar }} | ||
apiVersion: v1 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. These configurations match our specification, which can be found here or within the BindPlane repository under |
||
kind: ConfigMap | ||
metadata: | ||
name: {{ include "bindplane.fullname" . }}-prometheus | ||
data: | ||
prometheus.yml: | | ||
scrape_configs: [] | ||
rule_files: [/etc/prometheus/rules.yml] | ||
web.yml: | | ||
# This file should be empty unless configured | ||
# by the user. See the Prometheus auth and TLS | ||
# docs here: https://prometheus.io/docs/prometheus/latest/configuration/https/ | ||
rules.yml: | | ||
groups: | ||
- name: configuration-rollups | ||
interval: 1m | ||
rules: | ||
- record: bindplane_agent_measurements:rollup:rate:1m | ||
expr: sum without (agent) (rate(bindplane_agent_measurements{}[1m9s999ms] offset 10s)) | ||
- name: 5m-configuration-rollups | ||
interval: 5m | ||
rules: | ||
- record: bindplane_agent_measurements:rollup:rate:5m | ||
expr: sum without (agent) (rate(bindplane_agent_measurements:1m{}[5m59s999ms] offset 10s)) | ||
- name: 1h-configuration-rollups | ||
interval: 1h | ||
rules: | ||
- record: bindplane_agent_measurements:rollup:rate:1h | ||
expr: sum without (agent) (rate(bindplane_agent_measurements:15m{}[1h14m59s999ms] offset 10s)) | ||
--- | ||
apiVersion: apps/v1 | ||
kind: StatefulSet | ||
metadata: | ||
|
@@ -50,7 +80,16 @@ spec: | |
{{- end }} | ||
containers: | ||
- name: prometheus | ||
image: {{ .Values.prometheus.image.name }}:{{ include "prometheus.tag" . }} | ||
image: {{ .Values.prometheus.image.name }}:{{ .Values.prometheus.image.tag }} | ||
args: | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. These arguments match the args defined here. |
||
- --config.file=/etc/prometheus/prometheus.yml | ||
- --web.config.file=/etc/prometheus/web.yml | ||
- --storage.tsdb.retention.time=2d | ||
- --web.enable-remote-write-receiver | ||
- --web.listen-address=:9090 | ||
- --storage.tsdb.path=/prometheus | ||
- --web.console.templates=/etc/prometheus/consoles | ||
- --web.console.libraries=/etc/prometheus/console_libraries | ||
imagePullPolicy: IfNotPresent | ||
securityContext: | ||
allowPrivilegeEscalation: false | ||
|
@@ -70,6 +109,19 @@ spec: | |
volumeMounts: | ||
- mountPath: /prometheus | ||
name: {{ include "bindplane.fullname" . }}-prometheus-data | ||
- mountPath: /etc/prometheus/prometheus.yml | ||
subPath: prometheus.yml | ||
name: config | ||
- mountPath: /etc/prometheus/rules.yml | ||
subPath: rules.yml | ||
name: config | ||
- mountPath: /etc/prometheus/web.yml | ||
subPath: web.yml | ||
name: config | ||
volumes: | ||
- name: config | ||
configMap: | ||
name: {{ include "bindplane.fullname" . }}-prometheus | ||
persistentVolumeClaimRetentionPolicy: | ||
whenDeleted: Retain | ||
whenScaled: Retain | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We used this helper to set the Prometheus image based on the Chartfile's application version (BindPlane's version). This is no longer nessisary because the values file has a default value for
prometheus.image.tag
.