-
Notifications
You must be signed in to change notification settings - Fork 45
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
charts,salt,tools: Add Thanos querier in front of Prometheus
As part of kube-prometheus-stack chart, deploy Thanos sidecar as part of Prometheus Pod and the Thanos sidecar service used by Thanos querier to discover the Thanos sidecars IPs. Re-render the chart using: ``` ./charts/render.py prometheus-operator \ charts/kube-prometheus-stack.yaml \ charts/kube-prometheus-stack/ \ --namespace metalk8s-monitoring \ --service-config grafana \ metalk8s-grafana-config \ metalk8s/addons/prometheus-operator/config/grafana.yaml \ metalk8s-monitoring \ --service-config prometheus \ metalk8s-prometheus-config \ metalk8s/addons/prometheus-operator/config/prometheus.yaml \ metalk8s-monitoring \ --service-config alertmanager \ metalk8s-alertmanager-config \ metalk8s/addons/prometheus-operator/config/alertmanager.yaml \ metalk8s-monitoring \ --service-config dex \ metalk8s-dex-config \ metalk8s/addons/dex/config/dex.yaml.j2 metalk8s-auth \ --drop-prometheus-rules charts/drop-prometheus-rules.yaml \ > salt/metalk8s/addons/prometheus-operator/deployed/chart.sls ``` Import Thanos helm chart from banzaicloud: ``` helm repo add banzaicloud-stable https://kubernetes-charts.banzaicloud.com helm repo update helm fetch -d charts --untar banzaicloud-stable/thanos ``` Note that we only deploy the Thanos querier and not all other components. We also bump Thanos image since the one set in the helm chart is a bit old and do not support all Prometheus endpoint we need. Render the Thanos helm chart using ``` ./charts/render.py thanos \ charts/thanos.yaml charts/thanos/ \ --namespace metalk8s-monitoring \ > salt/metalk8s/addons/prometheus-operator/deployed/thanos-chart.sls ``` Then we replace the Prometheus datasource for Grafana in order to use this Thanos querier. We also replace the proxy ingress used by MetalK8s UI to use this Thanos querier as well. Since we now reach Thanos to retrieve Prometheus information, the order for the Prometheus rules changed a bit, so they get extracted again using ``` ./tools/rule_extractor/rule_extractor.py \ -i <control-plane-ip> -p 8443 -t rules ``` NOTE: Test not get updated a lot, just added sanity check to ensure Thanos querier Pod is running, since we already have some tests about Prometheus and for all those tests we now reach Thanos so we implicitly test Thanos querier
- Loading branch information
1 parent
af16ae3
commit 889fee7
Showing
61 changed files
with
7,731 additions
and
2,290 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
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
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,46 @@ | ||
store: | ||
enabled: false | ||
|
||
queryFrontend: | ||
enabled: false | ||
|
||
compact: | ||
enabled: false | ||
|
||
bucket: | ||
enabled: false | ||
|
||
rule: | ||
enabled: false | ||
|
||
# This one is deployed by Prometheus operator | ||
sidecar: | ||
enabled: false | ||
|
||
image: | ||
repository: '__image__(thanos)' | ||
tag: v0.23.1 | ||
|
||
query: | ||
enabled: true | ||
|
||
replicaLabels: | ||
- prometheus_replica | ||
|
||
storeDNSDiscovery: false | ||
sidecarDNSDiscovery: false | ||
|
||
stores: | ||
# Service deployed by Prometheus operator to expose Thanos sidecars | ||
- dnssrv+_grpc._tcp.prometheus-operator-thanos-discovery | ||
|
||
tolerations: | ||
- key: 'node-role.kubernetes.io/bootstrap' | ||
operator: 'Exists' | ||
effect: 'NoSchedule' | ||
- key: 'node-role.kubernetes.io/infra' | ||
operator: 'Exists' | ||
effect: 'NoSchedule' | ||
|
||
nodeSelector: | ||
node-role.kubernetes.io/infra: '' |
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,21 @@ | ||
# Patterns to ignore when building packages. | ||
# This supports shell glob matching, relative path matching, and | ||
# negation (prefixed with !). Only one pattern per line. | ||
.DS_Store | ||
# Common VCS dirs | ||
.git/ | ||
.gitignore | ||
.bzr/ | ||
.bzrignore | ||
.hg/ | ||
.hgignore | ||
.svn/ | ||
# Common backup files | ||
*.swp | ||
*.bak | ||
*.tmp | ||
*~ | ||
# Various IDEs | ||
.project | ||
.idea/ | ||
*.tmproj |
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,18 @@ | ||
apiVersion: v1 | ||
appVersion: 0.17.1 | ||
description: Thanos is a set of components that can be composed into a highly available | ||
metric system with unlimited storage capacity, which can be added seamlessly on | ||
top of existing Prometheus deployments. | ||
icon: https://raw.githubusercontent.com/thanos-io/thanos/master/docs/img/Thanos-logo_fullmedium.png | ||
keywords: | ||
- thanos | ||
- prometheus | ||
- metrics | ||
maintainers: | ||
- email: [email protected] | ||
name: Banzai Cloud | ||
name: thanos | ||
sources: | ||
- https://github.com/thanos-io/thanos | ||
- https://github.com/banzaicloud/banzai-charts/tree/master/thanos | ||
version: 0.4.6 |
Oops, something went wrong.