Skip to content

Commit

Permalink
Set prometheus in agent mode and upgrade kube-prometheus-stack to 30.…
Browse files Browse the repository at this point in the history
…0.0 (#510)

* Upgrade kube-prometheus-stack to 30.0.0
  This to get the latest prometheus-operator version so we can use prometheus-agent.
* prometheus enableFeatures: ['agent']
  • Loading branch information
Edvin N authored Jan 12, 2022
1 parent b072358 commit c84b049
Show file tree
Hide file tree
Showing 6 changed files with 28 additions and 3 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),

## Unreleased

### Changed

- [#510](https://github.com/XenitAB/terraform-modules/pull/510) [Breaking] Run prometheus in agent mode and update kube-prometheus-stack to v30.0.0.

## 2022.01.1

### Added
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ type: application
# 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.
# Versions are expected to follow Semantic Versioning (https://semver.org/)
version: 0.1.31
version: 0.1.36

# 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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,19 @@ spec:
labels:
aadpodidbinding: prometheus
{{- end }}
containers:
- name: prometheus
args:
- --config.file=/etc/prometheus/config_out/prometheus.env.yaml
- --storage.agent.path=/prometheus
- --enable-feature=agent
- --web.enable-lifecycle
- --web.console.templates=/etc/prometheus/consoles
- --web.console.libraries=/etc/prometheus/console_libraries
- --web.route-prefix=/
- --web.config.file=/etc/prometheus/web_config/web-config.yaml
enableFeatures:
- agent
externalLabels:
cluster_name: {{ .Values.externalLabels.clusterName }}
environment: {{ .Values.externalLabels.environment }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ resources:
memory: "1Gi"
cpu: "20m"
limits:
memory: "8Gi"
memory: "3Gi"

volumeClaim:
storageClassName: default
Expand Down
2 changes: 1 addition & 1 deletion modules/kubernetes/prometheus/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ resource "helm_release" "prometheus" {
chart = "kube-prometheus-stack"
name = "prometheus"
namespace = kubernetes_namespace.this.metadata[0].name
version = "17.2.2"
version = "30.0.0"
max_history = 3
values = [templatefile("${path.module}/templates/values.yaml.tpl", {})]
}
Expand Down
8 changes: 8 additions & 0 deletions modules/kubernetes/prometheus/templates/values.yaml.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,10 @@ kube-state-metrics:
enabled: false
metricLabelsAllowlist:
- "namespaces=[xkf.xenit.io/kind]"
prometheus:
monitor:
additionalLabels:
xkf.xenit.io/monitoring: platform

commonLabels:
xkf.xenit.io/monitoring: platform
Expand All @@ -48,3 +52,7 @@ prometheusOperator:

prometheus-node-exporter:
priorityClassName: "platform-high"
prometheus:
monitor:
additionalLabels:
xkf.xenit.io/monitoring: platform

0 comments on commit c84b049

Please sign in to comment.