Compare commits

...

245 Commits

Author SHA1 Message Date
Adin Hodovic 6fedb045db
feat(jsonnet): Add queryUrl support (#330)
Signed-off-by: adinhodovic <hodovicadin@gmail.com>
2025-05-28 14:10:39 +02:00
Ben Ye a28d8ac336
Merge pull request #295 from dschaaff/receive-router-selector-fix 2024-05-03 10:31:07 -07:00
Daniel Schaaff e78ee31640
Merge branch 'main' into receive-router-selector-fix
Signed-off-by: Daniel Schaaff <daniel@danielschaaff.com>
2024-05-03 10:07:17 -07:00
Matthias Loibl 48639958cc
Add per-container SecurityContext (#313)
* Add per container SecurityContext

Signed-off-by: Matthias Loibl <mail@matthiasloibl.com>

* Update kubeconform to v0.6.3

Signed-off-by: Matthias Loibl <mail@matthiasloibl.com>

* Add changelog entry

Signed-off-by: Matthias Loibl <mail@matthiasloibl.com>

---------

Signed-off-by: Matthias Loibl <mail@matthiasloibl.com>
2023-10-25 18:20:49 +05:30
Philip Gough ac261330bb
Add Pod anti-affinity to Thanos Rule (#310)
Signed-off-by: Philip Gough <philip.p.gough@gmail.com>
2023-07-11 20:40:05 +05:30
Thibault Mange 4c734188ca
update receive store limits type to string (#309)
Signed-off-by: Thibault Mange <22740367+thibaultmg@users.noreply.github.com>
2023-07-05 19:31:00 +05:30
Thibault Mange 650a08bb33
receive: add store limits flags (#308)
* add store limits flags

Signed-off-by: Thibault Mange <22740367+thibaultmg@users.noreply.github.com>

* update changelog

Signed-off-by: Thibault Mange <22740367+thibaultmg@users.noreply.github.com>

---------

Signed-off-by: Thibault Mange <22740367+thibaultmg@users.noreply.github.com>
2023-07-05 18:57:08 +05:30
Vibhu Prashar dfc278d1a1
Add support for missing objectstorage secret for thanos store (#307)
* Add support for missing objectstorage secret for thanos store

Signed-off-by: Vibhu Prashar <vibhu.sharma2929@gmail.com>

* Add review comments

Signed-off-by: Vibhu Prashar <vibhu.sharma2929@gmail.com>

---------

Signed-off-by: Vibhu Prashar <vibhu.sharma2929@gmail.com>
2023-06-27 15:39:39 +05:30
Thibault Mange 04c9e46115
receive: allow configuration of limits-config-file (#305)
* add receive limits config file flag

Signed-off-by: Thibault Mange <22740367+thibaultmg@users.noreply.github.com>

* update changelog

Signed-off-by: Thibault Mange <22740367+thibaultmg@users.noreply.github.com>

* make fmt

Signed-off-by: Thibault Mange <22740367+thibaultmg@users.noreply.github.com>

---------

Signed-off-by: Thibault Mange <22740367+thibaultmg@users.noreply.github.com>
2023-06-01 17:03:11 +05:30
Philip Gough 4ab42ad96e
receive: Expose minReadySeconds as config (#301)
* receive: Expose minReadySeconds as config

Signed-off-by: Philip Gough <philip.p.gough@gmail.com>

* docs: Add changelog for minReadySeconds to receiver sts

Signed-off-by: Philip Gough <philip.p.gough@gmail.com>

---------

Signed-off-by: Philip Gough <philip.p.gough@gmail.com>
2023-05-03 16:25:08 +05:30
Jacob Baungård Hansen 3291d85cc8
Query: Allow configuring telemetry.request options (#299)
With this commit we allow configuring the following Thanos query
options:
- query.telemetry.request-duration-seconds-quantiles
- query.telemetry.request-samples-quantiles
- query.telemetry.request-series-seconds-quantiles

Note that the jsonnet variable expects a comma seperated list, which
will be expanded to the format required by Thanos. As an example the
following jsonnet configuration:

```
telemetryDurationQuantiles: '1, 2, 3',
telemetrySamplesQuantiles: '100,1000,10000,100000',
telemetrySeriesQuantiles: '10,100,1000,10000',
```

Will result in the following command line arguments to Thanos

```
--query.telemetry.request-duration-seconds-quantiles=1
--query.telemetry.request-duration-seconds-quantiles=2
--query.telemetry.request-duration-seconds-quantiles=3
--query.telemetry.request-samples-quantiles=100
--query.telemetry.request-samples-quantiles=1000
--query.telemetry.request-samples-quantiles=10000
--query.telemetry.request-samples-quantiles=100000
--query.telemetry.request-series-seconds-quantiles=10
--query.telemetry.request-series-seconds-quantiles=100
--query.telemetry.request-series-seconds-quantiles=1000
--query.telemetry.request-series-seconds-quantiles=10000
```

Signed-off-by: Jacob Baungard Hansen <jacobbaungard@redhat.com>
2023-04-24 16:57:57 +05:30
Jacob Baungård Hansen bbcb5bfcbc
Update jsonnet tools to v0.20.0 (#300)
Update jsonnet tools to latest versions.

Signed-off-by: Jacob Baungard Hansen <jacobbaungard@redhat.com>
2023-04-24 14:48:17 +05:30
Fran 74a2e3de83
query: Add support for ArgoCD: Define replace action in servicemonitor (#296)
* query: Add support for ArgoCD: Define replace action in servicemonitor relabeling

Signed-off-by: Fran Sanjuán <francesc.sanjuan@marfeel.com>

* Add modified YAML

Signed-off-by: Fran Sanjuán <francesc.sanjuan@marfeel.com>

* query: Add support for ArgoCD: Define replace action in servicemonitors

Signed-off-by: Fran Sanjuán <francesc.sanjuan@marfeel.com>

* Add missing templates

Signed-off-by: Fran Sanjuán <francesc.sanjuan@marfeel.com>

---------

Signed-off-by: Fran Sanjuán <francesc.sanjuan@marfeel.com>
2023-04-11 12:41:08 +05:30
Vibhu Prashar deef788f8f
Add support for endpoint flag in querier (#297)
Signed-off-by: Vibhu Prashar <vprashar@redhat.com>
2023-04-02 10:21:00 +05:30
Jacob Baungård Hansen 634606784e
Use `kubernetes.io/os` instead of beta version (#298)
`beta.kubernetes.io/os` has been deprecated since v1.14. Use the
non-beta version instead.

Signed-off-by: Jacob Baungard Hansen <jacobbaungard@redhat.com>
2023-03-30 16:07:25 +02:00
Daniel Schaaff fbf72b8906
fix component label on receive router
Signed-off-by: Daniel Schaaff <daniel@danielschaaff.com>
2023-02-03 10:19:56 -08:00
Daniel Schaaff bbe75956d5
fix: receive router deployment selector labels
The pod selector labels on the receive router deployment include the
version label. Selector labels are immutable and this prevents updating the
receive router.

```
Deployment/monitoring/thanos-receive-router dry-run failed, reason: Invalid, error: Deployment.apps "thanos-receive-router" is invalid: spec.selector: Invalid value: v1.LabelSelector{MatchLabels:map[string]string{"app.kubernetes.io/component":"thanos-receive-router", "app.kubernetes.io/instance":"thanos-receive", "app.kubernetes.io/name":"thanos-receive", "app.kubernetes.io/version":"v0.30.2"}, MatchExpressions:[]v1.LabelSelectorRequirement(nil)}: field is immutable
```

Signed-off-by: Daniel Schaaff <daniel@danielschaaff.com>
2023-02-03 10:12:06 -08:00
Saswata Mukherjee 6a7455882c
Mention correct version in changelog (#294)
Signed-off-by: Saswata Mukherjee <saswataminsta@yahoo.com>
2023-02-03 19:03:26 +05:30
Douglas Camata d2cac7b14a
Store: allow configuration of series, series sample, and downloaded bytes limits (#292)
* Thanos Store: allow configuration of series touched limit

Signed-off-by: Douglas Camata <159076+douglascamata@users.noreply.github.com>

* Store: fix limit validation issues

Signed-off-by: Douglas Camata <159076+douglascamata@users.noreply.github.com>

* Update the changelog

Signed-off-by: Douglas Camata <159076+douglascamata@users.noreply.github.com>

* Add support for all the new store limits

Signed-off-by: Douglas Camata <159076+douglascamata@users.noreply.github.com>

* Update changelog

Signed-off-by: Douglas Camata <159076+douglascamata@users.noreply.github.com>

* Assert that limits config is an object

Signed-off-by: Douglas Camata <159076+douglascamata@users.noreply.github.com>

* Rerun CI

Signed-off-by: Douglas Camata <159076+douglascamata@users.noreply.github.com>

---------

Signed-off-by: Douglas Camata <159076+douglascamata@users.noreply.github.com>
2023-02-03 10:58:09 +05:30
Douglas Camata e43a62814d
*: Upgrade to Thanos v0.30.1 (#293)
* *: Upgrade to Thanos v0.30.1

Signed-off-by: Douglas Camata <159076+douglascamata@users.noreply.github.com>

* Add changelog entry

Signed-off-by: Douglas Camata <159076+douglascamata@users.noreply.github.com>

* Bump to Thanos v0.30.2

Signed-off-by: Douglas Camata <159076+douglascamata@users.noreply.github.com>

* Add updated all.jsonnet file

Signed-off-by: Douglas Camata <159076+douglascamata@users.noreply.github.com>

---------

Signed-off-by: Douglas Camata <159076+douglascamata@users.noreply.github.com>
2023-02-03 10:54:02 +05:30
Giedrius Statkevičius c5c9cd256c
*: use 0.29.0 (#288)
Move to the new version.

Signed-off-by: Giedrius Statkevičius <giedrius.statkevicius@vinted.com>

Signed-off-by: Giedrius Statkevičius <giedrius.statkevicius@vinted.com>
2022-11-03 16:20:34 +01:00
Matthias Loibl f7da22f5c8
Merge pull request #287 from thanos-io/update-version-v0.28.1
*: Update version to v0.28.1 and regenerate
2022-10-17 12:28:31 +02:00
Ben Ye 969261408c update version to v0.28.1 and regenerate
Signed-off-by: Ben Ye <benye@amazon.com>
2022-10-16 20:47:42 -07:00
Ben Ye 5c8b734dd1
Merge pull request #286 from douglascamata/store-livenes-probe-config
Store: make the liveness probe timeout configurable
2022-10-11 09:37:06 -07:00
Douglas Camata 449e423dc6 Make Store liveness probe more configurable
Adds configuration for failure threshold and period seconds.

Signed-off-by: Douglas Camata <159076+douglascamata@users.noreply.github.com>
2022-10-11 12:04:58 +02:00
Ben Ye e57d1530c9
Merge pull request #285 from saswatamcode/new-engine
Add option for enabling new PromQL engine in querier
2022-10-10 09:08:09 -07:00
Douglas Camata 7361d93155 Update CHANGELOG
Signed-off-by: Douglas Camata <159076+douglascamata@users.noreply.github.com>
2022-10-10 16:48:12 +02:00
Douglas Camata 5fa86178a6 Make the Store liveness probe timeout configurable
Under heavy load, the 1s default timeout for the Store liveness probe
can be often triggered, which leads to Store restarts.

The default value is 1s, to keep the current behavior, and in affected
environments one can increase it.

Signed-off-by: Douglas Camata <159076+douglascamata@users.noreply.github.com>
2022-10-10 16:44:43 +02:00
Saswata Mukherjee 3f2c658934 Add option for enabling new PromQL engine in querier
Signed-off-by: Saswata Mukherjee <saswataminsta@yahoo.com>
2022-10-10 13:54:56 +05:30
Saswata Mukherjee 826595f0cc
Change Receive PDB to policy/v1 (#284)
Signed-off-by: Saswata Mukherjee <saswataminsta@yahoo.com>

Signed-off-by: Saswata Mukherjee <saswataminsta@yahoo.com>
2022-08-30 11:08:00 +02:00
Michael Burt a3f005e4f9
generate ServiceMonitor for Receive ingestors according to config (#280)
Signed-off-by: Michael Burt <michaelpburt@gmail.com>
2022-07-19 17:10:48 +02:00
Michael Burt 56fed32321
add common labels to receive router (#282)
Signed-off-by: Michael Burt <michaelpburt@gmail.com>
2022-07-19 08:50:20 +02:00
Dreampuf f1928b820c
Add annotation support for serviceaccount (#271) 2022-07-18 12:38:04 +02:00
Michael Burt 5d3901b773
change hashringConfigmapName to hashringConfigMapName (#279)
Signed-off-by: Michael Burt <michaelpburt@gmail.com>
2022-07-15 09:46:04 +02:00
Bartlomiej Plotka fd637a4f73
Added deprecated rules field in order to fix prod issue. (#273)
Signed-off-by: Bartlomiej Plotka <bwplotka@gmail.com>
2022-07-12 08:07:07 +02:00
Matej Gera 307c3a3558
Cut 0.27 (#278)
Signed-off-by: Matej Gera <matejgera@gmail.com>
2022-07-07 17:35:08 +02:00
SUN Haoyu 86a9d83c02
cut release v0.26.0 (#275)
Signed-off-by: Haoyu Sun <hasun@redhat.com>
2022-06-15 16:37:15 +01:00
Ben Ye 6328583a62
Merge pull request #265 from ahysing/concurrent-thanos-compact
Added multithreading support to thanos compact
2022-02-09 23:48:17 -08:00
Andreas Dreyer Hysing eff77b7048 Ran make --always-make vendor generate validate
Signed-off-by: Andreas Dreyer Hysing <andreashysing@gmail.com>
2022-02-10 08:37:18 +01:00
Andreas Dreyer Hysing 9643bb84d8 Added required comma to list
Signed-off-by: Andreas Dreyer Hysing <andreashysing@gmail.com>
2022-02-09 22:00:58 +01:00
Andreas Dreyer Hysing 809da52163 Passing arguments --compact.concurrency and --downsample.concurrency to thanos compact
Signed-off-by: Andreas Dreyer Hysing <andreashysing@gmail.com>
2022-02-09 20:08:00 +01:00
Ben Ye 336482e12c
Merge pull request #263 from saswatamcode/add-stateless-ruler
Support stateless Ruler
2022-02-08 14:53:14 -08:00
Saswata Mukherjee e401391d9b Add CHANGELOG
Signed-off-by: Saswata Mukherjee <saswataminsta@yahoo.com>
2022-02-08 10:15:58 +05:30
Saswata Mukherjee 002c8a8c0b Support stateless Ruler
Signed-off-by: Saswata Mukherjee <saswataminsta@yahoo.com>
2022-02-08 10:03:36 +05:30
Prashant Balachandran 55d79c62ff
fixing the build by generating files (#262) 2022-01-19 12:19:39 +01:00
Prashant Balachandran 7e8fc8c8b3
cut release v0.24.0 (#258)
Signed-off-by: Prashant Balachandran <pnair@redhat.com>
2022-01-13 16:29:22 +01:00
Ben Ye a891295887
Merge pull request #261 from morvencao/br_support_image_pullpolicy
support image pull policy.
2022-01-12 09:55:35 -08:00
morvencao d25492dfce add changelog.
Signed-off-by: morvencao <lcao@redhat.com>
2022-01-12 07:36:39 +00:00
morvencao 1236eaf0aa support imagepullpolicy.
Signed-off-by: morvencao <lcao@redhat.com>
2022-01-12 07:33:28 +00:00
Chunlin Yang c8a244f82a
Support custom certificate for the object store (#260)
* Support custom certificate for the object store

Signed-off-by: clyang82 <chuyang@redhat.com>

* Update changelog

Signed-off-by: clyang82 <chuyang@redhat.com>

* fix rebase issue

Signed-off-by: clyang82 <chuyang@redhat.com>
2022-01-05 15:15:57 +01:00
Philip Gough 5752646d6a
examples: Update minio command to fix crash looping (#257)
Signed-off-by: Philip Gough <philip.p.gough@gmail.com>
2022-01-05 15:12:18 +01:00
Morven Cao 19e913d56e
support alertmanager configuration and extra volumes for thanos ruler. (#225)
* support alertmanager configuration and extra volumes for thanos ruler.

Signed-off-by: morvencao <lcao@redhat.com>

* add test alerting configuration.

Signed-off-by: morvencao <lcao@redhat.com>
2022-01-05 13:12:48 +01:00
Matthias Loibl 33ac381e95
Merge pull request #253 from yeya24/switch-github-actions
switch from circle CI to github actions
2021-12-09 23:32:07 +01:00
Ben Ye c01bd9f5f2
Merge pull request #254 from marcolan018/tenant-header
receiver: make tenant-header of receiver configurable
2021-11-19 15:46:32 -08:00
marcolan018 4d9cddff2f update changedlog
Signed-off-by: Marco llan@redhat.com

Signed-off-by: marcolan018 <llan@redhat.com>
2021-11-19 14:59:09 -06:00
marcolan018 ce03c44251 make tenant-header of receiver configurable
Signed-off-by: Marco llan@redhat.com

Signed-off-by: marcolan018 <llan@redhat.com>
2021-11-19 14:59:09 -06:00
Ben Ye 71ca7de54c switch from circle CI to github actions
Signed-off-by: Ben Ye <ben.ye@bytedance.com>
2021-11-11 22:59:27 -08:00
Ben Ye b45cbba0c0
Merge pull request #249 from thanos-io/receive-configurable-domain
Make receiver cluster domain name configurable
2021-11-11 11:58:41 -08:00
Ben Ye 8c8b810ae0 make receiver cluster domain name configurable
Signed-off-by: Ben Ye <ben.ye@bytedance.com>
2021-10-03 20:35:25 -07:00
Ben Ye fdba356cad
Merge pull request #251 from mwasilew2/add-extra-env-vars
Add extra env vars to all components deployed with kube-thanos
2021-10-03 20:34:08 -07:00
Ben Ye 14b05c841d
Merge pull request #250 from aletessier/main
update dns discovery links (#242)
2021-10-03 20:31:58 -07:00
Michal Wasilewski 536eaa8c99
fix array concatenation broken due to an extra level of composition
Signed-off-by: Michal Wasilewski <mwasilewski@gmx.com>
2021-09-27 17:54:58 +02:00
Michal Wasilewski db798a88e7
changelog entry
Signed-off-by: Michal Wasilewski <mwasilewski@gmx.com>
2021-09-27 17:23:55 +02:00
Michal Wasilewski 29f0836c46
add extraEnv config option to all components in kube-thanos
Signed-off-by: Michal Wasilewski <mwasilewski@gmx.com>
2021-09-27 17:16:47 +02:00
Michal Wasilewski 00a6a01dc5
formatting in thanos-store
Signed-off-by: Michal Wasilewski <mwasilewski@gmx.com>
2021-09-27 16:59:02 +02:00
Alexis Letessier bc4c58c358 update dns discovery links (#242)
Signed-off-by: Alexis Letessier <alexis.letessier@gmail.com>
2021-09-22 11:29:36 +02:00
Steve Hipwell 1fe5b3bda1
compact: Make service headless (#247)
Signed-off-by: Steve Hipwell <steve.hipwell@gmail.com>
2021-09-20 11:14:27 +02:00
Philip Gough 24559b52b6
Support scraping config-reloader sidecar for Thanos Ruler (#245)
Signed-off-by: Philip Gough <philip.p.gough@gmail.com>
2021-09-15 08:18:17 +02:00
Maxime Brunet f89c45121e
example: Fix missing common resources for (compact|store)-shards/receive-hashrings (#234)
* (compact|store)-shards/receive-hashrings: Hide non-resource fields

Signed-off-by: Maxime Brunet <maxime.brunet@paytm.com>

* Filter out keys instead of hiding them

Signed-off-by: Maxime Brunet <maxime.brunet@paytm.com>
2021-09-15 08:13:21 +02:00
Ian Billett cfd8d7899c
Add functions to implement Thanos Receive split functionality (#244) 2021-09-01 13:08:38 +02:00
Ben Ye add27c34e1
add bucket replicate component (#237)
* add bucket replicate component

Signed-off-by: Ben Ye <ben.ye@bytedance.com>

* fix jsonnet fmt

Signed-off-by: Ben Ye <ben.ye@bytedance.com>

* revert minio changes

Signed-off-by: Ben Ye <ben.ye@bytedance.com>
2021-08-24 17:21:57 +02:00
Jayapriya Pai 812e6d6564
jsonnet/manifests/example: Update/generate nodeSelector to kubernetes.io/os instead of beta.kubernetes.io/os (#241)
* jsonnet: Update nodeSelector label to kubernetes.io/os

Signed-off-by: Jayapriya Pai <janantha@redhat.com>

* manifests/examples: regenerate

Signed-off-by: Jayapriya Pai <janantha@redhat.com>
2021-08-24 10:23:34 +02:00
Damien Grisonnet fe000a533f
Merge pull request #240 from dgrisonnet/cut-release-0.22
Cut release v0.22.0
2021-08-17 16:16:58 +02:00
Damien Grisonnet 733d66c150 Cut release v0.22.0
Signed-off-by: Damien Grisonnet <dgrisonn@redhat.com>
2021-08-17 14:31:55 +02:00
Kemal Akkoyun e76e196621
Merge pull request #232 from thanos-io/support-compactor-sharding
Support compactor hash sharding
2021-08-12 08:25:03 +02:00
ben.ye 55f2f98c46 add anti affinity configuration
Signed-off-by: ben.ye <ben.ye@bytedance.com>
2021-07-11 19:24:53 -07:00
ben.ye 9ad7bd34dc format changelog
Signed-off-by: ben.ye <ben.ye@bytedance.com>
2021-07-01 18:48:34 -07:00
ben.ye 2643e24c14 update changelog
Signed-off-by: ben.ye <ben.ye@bytedance.com>
2021-07-01 18:27:27 -07:00
ben.ye f9710235ab support compactor shards
Signed-off-by: ben.ye <ben.ye@bytedance.com>
2021-07-01 18:23:51 -07:00
Kemal Akkoyun e1a68590f5
Merge pull request #228 from onprem/prefix-header
Allow configuring `--web.prefix-header` of query.
2021-06-03 18:16:54 +02:00
Prem Saraswat edd4cd4741 Add changelog entry
Signed-off-by: Prem Saraswat <prmsrswt@gmail.com>
2021-06-03 18:28:52 +05:30
Prem Saraswat 3d63772edf Allow configuring of query.
Signed-off-by: Prem Saraswat <prmsrswt@gmail.com>
2021-06-03 18:27:30 +05:30
Matthias Loibl 5d95a53756
Merge pull request #226 from Luis-TT/add-nodeselector
.*: Only schedule on linux nodes
2021-06-02 15:34:04 +02:00
Luis Vidal Ernst 7970604bec Only schedule on linux nodes
Signed-off-by: Luis Vidal Ernst <l.vidalernst@traveltrex.com>
2021-05-20 12:13:14 +02:00
Kemal Akkoyun f53ad9856c
Merge pull request #224 from dgrisonnet/cut-release-0.19
Cut release v0.19.0
2021-04-20 11:18:44 +02:00
Damien Grisonnet 21ebb8f84c Cut release 0.19.0
Signed-off-by: Damien Grisonnet <dgrisonn@redhat.com>
2021-04-19 20:00:41 +02:00
Kemal Akkoyun a549c3d04f
Merge pull request #222 from dgrisonnet/changelog-0.18
Add v0.18.0 CHANGELOG
2021-04-19 18:55:11 +02:00
Damien Grisonnet 137baebf8d Add v0.18 CHANGELOG
Signed-off-by: Damien Grisonnet <dgrisonn@redhat.com>
2021-04-19 18:39:42 +02:00
Chunlin Yang a4c5b800c0
Support configure tsdb.retention and tsdb.block-duration for rule (#221)
* Support configure tsdb.retention and tsdb.block-duration for rule

Signed-off-by: clyang82 <chuyang@redhat.com>

* Update changelog

Signed-off-by: clyang82 <chuyang@redhat.com>
2021-04-19 17:04:04 +02:00
Frederic Branczyk c288ec08fe
Merge pull request #220 from brancz/env-host-ip
*: Add host ip env var to all containers
2021-04-15 14:21:58 +02:00
Frederic Branczyk 6031f75649
*: Add host ip env var to all containers
This makes configuring tracing much more convenient.

Signed-off-by: Frederic Branczyk <fbranczyk@gmail.com>
2021-04-15 14:06:27 +02:00
Kemal Akkoyun 8698db1765
Merge pull request #218 from vshn/query-auto-downsample
Query: Enable auto downsampling
2021-04-14 14:07:36 +02:00
Simon Rüegg f7280ea7a9
Enable query auto downsampling
Signed-off-by: Simon Rüegg <simon@rueggs.ch>
2021-04-08 10:21:21 +02:00
Matthias Loibl 0e6301db40
Merge pull request #216 from cten/main
fixed typo in placeholder variable
2021-03-29 11:24:52 +02:00
Caleb Tenberge 95aa7819df Merge branch 'main' of https://github.com/cten/kube-thanos into main 2021-03-26 14:22:38 -04:00
Caleb Tenberge dc4c1cdd76 fixed typo in placeholder variable
Signed-off-by: Caleb Tenberge <ctenberge@phishlabs.com>
2021-03-26 14:22:28 -04:00
Caleb Tenberge 5b51ae698b fixed typo in placeholder variable
Signed-off-by: Caleb Tenberge <ctenberge@phishlabs.com>
2021-03-25 16:10:55 -04:00
Frederic Branczyk 24ddf6aef1
Merge pull request #213 from brancz/min-max-time
store: Add min/max time flag configuration
2021-03-22 09:46:26 +01:00
Frederic Branczyk 0efc16233e
store: Add min/max time flag configuration
Signed-off-by: Frederic Branczyk <fbranczyk@gmail.com>
2021-03-22 09:28:52 +01:00
Kemal Akkoyun cb03ac9512
Merge pull request #209 from vshn/bucket-web-labels
Bucket Web: Extend configuration for labels and refresh
2021-03-17 17:42:38 +01:00
Frederic Branczyk 2ca480f615
Merge pull request #211 from clyang82/readwriteonce
enforce ReadWriteOnce
2021-03-17 14:11:16 +01:00
Bartlomiej Plotka d3c528bfda
Merge pull request #212 from clyang82/securitycontext
Make securityContext configurable
2021-03-17 12:28:56 +01:00
clyang82 9fb14c20f9 Make securityContext configurable
Signed-off-by: clyang82 <chuyang@redhat.com>
2021-03-17 15:20:12 +08:00
clyang82 aa753041fc handle volumeClaimTemplate does not exist
Signed-off-by: clyang82 <chuyang@redhat.com>
2021-03-17 14:30:39 +08:00
clyang82 5c02159c30 fix lint
Signed-off-by: clyang82 <chuyang@redhat.com>
2021-03-16 14:51:19 +08:00
clyang82 04946bbef0 enforce ReadWriteOnce
Signed-off-by: clyang82 <chuyang@redhat.com>
2021-03-16 14:48:37 +08:00
Simon Rüegg 0ee4cae44e
Write changelog
Signed-off-by: Simon Rüegg <simon@rueggs.ch>
2021-03-12 17:23:21 +01:00
Simon Rüegg 01660682b9
Configure bucket web refresh
Signed-off-by: Simon Rüegg <simon@rueggs.ch>
2021-03-12 17:20:15 +01:00
Simon Rüegg ea44da1191
Configure bucket web label
Signed-off-by: Simon Rüegg <simon@rueggs.ch>
2021-03-12 17:19:12 +01:00
Kemal Akkoyun a7188c678c
Merge pull request #207 from PaytmLabs/feature/kubeval-custom-resources
ci: Validate custom resources
2021-03-12 13:26:17 +01:00
Kemal Akkoyun 9fed07e7f1
Merge pull request #208 from jpugliesi/jpugliesi/master-to-main
Use main branch in documentation
2021-03-12 13:13:36 +01:00
John Pugliesi 8cc1c41426 Update CHANGELOG.md
Signed-off-by: John Pugliesi <jpugliesi12@gmail.com>
2021-03-11 14:09:45 -08:00
John Pugliesi 493aa658d1 Use main branch in documentation
Signed-off-by: John Pugliesi <jpugliesi12@gmail.com>
2021-03-11 14:09:45 -08:00
Maxime Brunet dbbb406c39
Replace kubeval by kubeconform
Signed-off-by: Maxime Brunet <maxime.brunet@paytm.com>
2021-03-06 19:48:38 -08:00
Maxime Brunet b8ecba635d
ci: Validate custom resources
* Add ServiceMonitor schema
* Remove --ignore-missing-schemas
* Force color output
* Validate against up-to-date Kubernetes schema
* Fix Sidecar ServiceMonitor

Signed-off-by: Maxime Brunet <maxime.brunet@paytm.com>
2021-03-06 18:40:59 -08:00
Maxime Brunet 32a21ed67a
ci: Enable kubeval strict mode (#206)
Signed-off-by: Maxime Brunet <maxime.brunet@paytm.com>
2021-03-07 01:10:15 +01:00
Kemal Akkoyun 151aa68f18
Merge pull request #192 from PaytmLabs/feature/thanos-sidecar-sd
sidecar: Add pod discovery
2021-03-06 16:45:57 +01:00
Kemal Akkoyun 6d7500fc32
Merge pull request #204 from brancz/receive-one-sm
jsonnet/kube-thanos: Ignore individual ServiceMonitor with catch-all
2021-03-06 16:04:11 +01:00
Frederic Branczyk bb1256ddda
jsonnet/kube-thanos: Ignore individual ServiceMonitor with catch-all
Signed-off-by: Frederic Branczyk <fbranczyk@gmail.com>
2021-03-06 15:42:32 +01:00
Kemal Akkoyun 5c91e2f7d7
Merge pull request #203 from brancz/fix-fsgroup
jsonnet/kube-thanos: Fix fsGroup position
2021-03-06 11:17:52 +01:00
Frederic Branczyk 52bdc2db5e
*: Re-generate
Signed-off-by: Frederic Branczyk <fbranczyk@gmail.com>
2021-03-06 11:14:48 +01:00
Frederic Branczyk 340625a76c
jsonnet/kube-thanos: Fix fsGroup position
Signed-off-by: Frederic Branczyk <fbranczyk@gmail.com>
2021-03-06 11:12:45 +01:00
Frederic Branczyk 22ed6838b8
Merge pull request #202 from PaytmLabs/feature/fsgroup
*: Set fsGroup when running as non-root
2021-03-06 10:09:25 +01:00
Maxime Brunet 59df39fa58
*: Set fsGroup when running as non-root
This is required to make the AWS WebIdentity token file readable for example.

Reference:
https://docs.aws.amazon.com/eks/latest/userguide/iam-roles-for-service-accounts-technical-overview.html#pod-configuration

Signed-off-by: Maxime Brunet <maxime.brunet@paytm.com>
2021-03-05 16:38:36 -08:00
Maxime Brunet ffe2bcf315
sidecar: Add pod discovery
Signed-off-by: Maxime Brunet <maxime.brunet@paytm.com>
2021-03-05 16:18:56 -08:00
Frederic Branczyk f72eaf36a1
Merge pull request #200 from brancz/non-root
*: Run all as non-root
2021-03-05 10:16:53 +01:00
Frederic Branczyk 7bd82122b4
Merge pull request #198 from kakkoyun/hashring_sms
receive: Add a single service monitor for hashring
2021-03-05 10:16:13 +01:00
Frederic Branczyk bd4de8e4bb
*: Run all as non-root
Signed-off-by: Frederic Branczyk <fbranczyk@gmail.com>
2021-03-05 10:14:04 +01:00
Kemal Akkoyun 7d327ee976
Fix store shard label (#199)
Signed-off-by: Kemal Akkoyun <kakkoyun@gmail.com>
2021-03-05 09:33:49 +01:00
Kemal Akkoyun 95124ddef1
Merge pull request #162 from clyang82/reload_rules
Reload rules configmap
2021-03-05 08:35:33 +01:00
Kemal Akkoyun 475b74ed5c Add a single service monitor for hashring
Signed-off-by: Kemal Akkoyun <kakkoyun@gmail.com>
2021-03-05 08:33:30 +01:00
clyang82 ef2fbe5f06 rebase
Signed-off-by: clyang82 <chuyang@redhat.com>
2021-03-05 15:31:03 +08:00
clyang82 f19fe31ebf update example manifests
Signed-off-by: clyang82 <chuyang@redhat.com>
2021-03-05 15:26:54 +08:00
clyang82 9acf22d5a2 Use upstream image
Signed-off-by: clyang82 <chuyang@redhat.com>
2021-03-05 15:26:54 +08:00
clyang82 b9389611fd Address review comments
Signed-off-by: clyang82 <chuyang@redhat.com>
2021-03-05 15:26:54 +08:00
clyang82 abe7d7d886 all examples in all.jsonnet
Signed-off-by: clyang82 <chuyang@redhat.com>
2021-03-05 15:26:50 +08:00
clyang82 83b7351597 Reload rules configmap
Signed-off-by: clyang82 <chuyang@redhat.com>
2021-03-05 15:25:37 +08:00
Frederic Branczyk 95c8cf9442
Merge pull request #197 from kakkoyun/add_pdb_for_hashrings
Add PodDisruptionBudget for receive hashrings
2021-03-04 20:23:52 +01:00
Kemal Akkoyun db3c476612 Fix formatting
Signed-off-by: Kemal Akkoyun <kakkoyun@gmail.com>
2021-03-04 18:47:34 +01:00
Kemal Akkoyun 86c32cf94f Render only it makes sense
Signed-off-by: Kemal Akkoyun <kakkoyun@gmail.com>
2021-03-04 18:46:11 +01:00
Kemal Akkoyun 3c6e1019c3 Add PodDisruptionBudget for receive hashrings
Signed-off-by: Kemal Akkoyun <kakkoyun@gmail.com>
2021-03-04 18:11:07 +01:00
Kemal Akkoyun c943d1b8c4
Merge pull request #196 from brancz/sa
*: Add non-default service accounts to all components
2021-03-04 17:23:11 +01:00
Frederic Branczyk 522f20ee22
*: Add non-default service accounts to all components
Signed-off-by: Frederic Branczyk <fbranczyk@gmail.com>
2021-03-04 17:22:17 +01:00
Kemal Akkoyun 452a9b3d32
Merge pull request #194 from brancz/cfg
receive: Extend configuration for labels
2021-03-04 14:44:49 +01:00
Frederic Branczyk 97293b1894
CHANGELOG.md: Add changelog entry
Signed-off-by: Frederic Branczyk <fbranczyk@gmail.com>
2021-03-04 14:39:55 +01:00
Frederic Branczyk e35202f13f
receive: Allow configuring --receive.tenant-label-name
Signed-off-by: Frederic Branczyk <fbranczyk@gmail.com>
2021-03-04 14:38:57 +01:00
Frederic Branczyk 71f15c4ec2
receive: Allow configuring labels
Signed-off-by: Frederic Branczyk <fbranczyk@gmail.com>
2021-03-04 14:38:48 +01:00
Kemal Akkoyun e00c4f23e7
Merge pull request #189 from craigfurman/breaking-188
Mark a change as breaking
2021-01-25 18:56:33 +03:00
Craig Furman 018011252a
Mark a change as breaking
https://github.com/thanos-io/kube-thanos/pull/188

Signed-off-by: Craig Furman <craig.furman89@gmail.com>
2021-01-25 14:26:43 +00:00
Kemal Akkoyun a622108c30
Merge pull request #188 from craigfurman/store-shards-single-job
Single ServiceMonitor for store shards
2021-01-25 16:04:50 +03:00
Craig Furman 17a8138b9e
Single ServiceMonitor for store shards
The Prometheus operator creates 1 job per endpoint on each
ServiceMonitor object it discovers. When using the thanos-store hashmod
sharding feature of kube-thanos, 1 ServiceMonitor was created per store
shard.  This resulted in 1 prometheus job per shard, with names like
"thanos-store-0", "thanos-store-1".

This commit changes this behavior to instead create only 1
ServiceMonitor, with a Service label selector that selects all Services
for the shards.

Signed-off-by: Craig Furman <craig.furman89@gmail.com>
2021-01-15 13:32:03 +00:00
Kemal Akkoyun f1118ca71a
Merge pull request #177 from kakkoyun/jsonnet_linter
Add jsonnet linter
2021-01-12 18:01:27 +03:00
Kemal Akkoyun 28bcc0d086 Fix gojsontoyaml binary issues
Signed-off-by: Kemal Akkoyun <kakkoyun@gmail.com>
2021-01-12 17:54:33 +03:00
Kemal Akkoyun 02b7396f99 Upgrade all jsonnet tools to latest master
Signed-off-by: Kemal Akkoyun <kakkoyun@gmail.com>
2021-01-12 17:48:20 +03:00
Kemal Akkoyun 66eaf832b1 Upgrade jsonnet-linter to latest master
Signed-off-by: Kemal Akkoyun <kakkoyun@gmail.com>
2021-01-12 17:45:07 +03:00
Kemal Akkoyun cc1b53a479 Fix discovered issues
Signed-off-by: Kemal Akkoyun <kakkoyun@gmail.com>
2021-01-12 17:43:52 +03:00
Kemal Akkoyun 656a9ab3c5 Update jsonnet tooling
Add linter CI step

Signed-off-by: Kemal Akkoyun <kakkoyun@gmail.com>
2021-01-12 17:43:52 +03:00
Kemal Akkoyun b50112cf6e
Merge pull request #185 from craigfurman/case-insensitive-caches
Make cache types case insensitive
2021-01-04 13:10:58 +03:00
Craig Furman 11ed80121a
Make cache types case insensitive
This appears to be the case in thanos itself
(https://github.com/thanos-io/thanos/blob/master/pkg/queryfrontend/config.go#L81
and https://github.com/thanos-io/thanos/blob/master/pkg/store/cache/factory.go#L45).

The thanos docs use upper-case cache types.

Signed-off-by: Craig Furman <craig.furman89@gmail.com>
2020-12-14 15:51:13 +00:00
Matthias Loibl e6c97a0163
Merge pull request #183 from dgrisonnet/fix-0.17-changelog
Fix CHANGELOG for release-0.17 cut
2020-12-08 18:51:49 +01:00
Damien Grisonnet aa83abc2f2 Fix CHANGELOG for release-0.17 cut
Signed-off-by: Damien Grisonnet <dgrisonn@redhat.com>
2020-12-08 18:46:46 +01:00
Kemal Akkoyun 87d04e10da
Merge pull request #182 from dgrisonnet/cut-release-0.17
Cut release-0.17
2020-12-08 19:54:56 +03:00
Damien Grisonnet 73de19d6bc Cut release-0.17
Signed-off-by: Damien Grisonnet <dgrisonn@redhat.com>
2020-12-08 17:14:21 +01:00
Kemal Akkoyun d7696758dd
Merge pull request #180 from metalmatze/delete-flag-experimental.enable-index-cache-postings-compression
Delete the removed flag experimental.enable-index-cache-postings-compression
2020-11-30 13:56:54 +03:00
Matthias Loibl 825b16b940
Delete the removed flag experimental.enable-index-cache-postings-compression
This flag was removed in v0.17.0 and the compression is enabled by
default

Signed-off-by: Matthias Loibl <mail@matthiasloibl.com>
2020-11-30 11:54:33 +01:00
Kemal Akkoyun 6a4a1749db
Merge pull request #178 from craigfurman/log-format-elsewhere
compact, rule, tools: add log format flag
2020-11-26 17:05:18 +03:00
Craig Furman e063e9ccbc
compact, rule, tools: add log format flag
It was already added to store, query, and query-frontend.

Signed-off-by: Craig Furman <craig.furman89@gmail.com>
2020-11-25 15:01:42 +00:00
Matthias Loibl cd6b00d688
Merge pull request #168 from surajnarwade/fix-typo
Fix typo for memcached service
2020-11-25 13:11:23 +01:00
Matthias Loibl c584d22578
Merge pull request #176 from craigfurman/fix-store-without-bucket-cache
store: fix error when bucket cache not used
2020-11-25 11:17:13 +01:00
Matthias Loibl bc95ea676e
Merge pull request #173 from craigfurman/log-format
store, query, frontend: add log.format flag
2020-11-25 10:53:20 +01:00
Craig Furman 31e5565573
store: fix error when bucket cache not used
The default bucketCache is `{}`, which caused a runtime error when
trying to access the `type` field.

Signed-off-by: Craig Furman <craig.furman89@gmail.com>
2020-11-23 14:05:06 +00:00
Craig Furman 82e824bdca
Add log format parameter to store, query, frontend
Default to "logfmt", the same as the upstream default.

Also fix bug in which logLevel was not passed to query frontend.

Signed-off-by: Craig Furman <craig.furman89@gmail.com>
2020-11-20 14:26:43 +00:00
Kemal Akkoyun 39435d26b2
Merge pull request #172 from kakkoyun/fix_copy_paste_error
query-frontend: Fix wrongly referred config
2020-11-20 14:23:02 +01:00
Kemal Akkoyun b915e8dc8e Fix wrongly referred config
Signed-off-by: Kemal Akkoyun <kakkoyun@gmail.com>
2020-11-20 13:29:19 +01:00
Kemal Akkoyun b93dc34b94
Merge pull request #171 from kakkoyun/guards
query-frontend: Add guards for empty cache scenario
2020-11-20 11:38:12 +01:00
Kemal Akkoyun 587c6d987f Add guards for empty cache scenerio
Signed-off-by: Kemal Akkoyun <kakkoyun@gmail.com>
2020-11-20 11:28:23 +01:00
Kemal Akkoyun 217c7a0c1e
Merge pull request #170 from kakkoyun/helpers
Add Store sharding and Receive hashrings
2020-11-18 18:11:02 +01:00
Kemal Akkoyun be0eed0f57 Address review issues
Signed-off-by: Kemal Akkoyun <kakkoyun@gmail.com>
2020-11-18 17:59:28 +01:00
Kemal Akkoyun 809eca96c6 Add changelog entry
Signed-off-by: Kemal Akkoyun <kakkoyun@gmail.com>
2020-11-18 11:16:53 +01:00
Kemal Akkoyun d7e3c4f0a9 Add sharding and hashring helpers
Signed-off-by: Kemal Akkoyun <kakkoyun@gmail.com>
2020-11-18 11:13:25 +01:00
Kemal Akkoyun c6ec5706c9
Merge pull request #169 from metalmatze/tracing
Add --tracing.config support to all components
2020-11-11 12:19:36 +01:00
Matthias Loibl 4e45fe36f8
Add --tracing.config support to all components
Signed-off-by: Matthias Loibl <mail@matthiasloibl.com>
2020-11-11 12:15:18 +01:00
Suraj Narwade b928d5b37c Fix typo for memcached service
replace `SERCIVE` with `SERVICE`

Signed-off-by: Suraj Narwade <suraj.narwade@rvu.co.uk>
2020-11-09 11:35:47 +00:00
Bartlomiej Plotka a878b4681e
Merge pull request #166 from yeya24/qf-new-flags
Add new flags and memcached support to query frontend
2020-11-04 16:56:41 +01:00
Kemal Akkoyun 4aa6ed67dd
Merge pull request #167 from metalmatze/cut-release-0.16
Cut release-0.16
2020-11-04 16:09:18 +01:00
Matthias Loibl 9a444dbe02
Cut release-0.16
Signed-off-by: Matthias Loibl <mail@matthiasloibl.com>
2020-11-04 16:07:00 +01:00
Ben Ye 2216a61e14 add memcached support and new flags to query frontend
Signed-off-by: Ben Ye <yb532204897@gmail.com>
2020-11-04 08:55:09 -05:00
Ben Ye 35c7841b0f remove unused comment
Signed-off-by: Ben Ye <yb532204897@gmail.com>
2020-11-03 16:44:26 -05:00
Ben Ye bfd2450cf7 add new flags and memcached support to query frontend
Signed-off-by: Ben Ye <yb532204897@gmail.com>
2020-11-03 16:42:00 -05:00
Kemal Akkoyun c157b38e8c
Merge pull request #165 from metalmatze/config-ports
Create high level config for ports that get use by other objects
2020-11-03 18:31:40 +01:00
Matthias Loibl 601b850aea
Create high level config for ports that get use by other objects
Signed-off-by: Matthias Loibl <mail@matthiasloibl.com>
2020-11-03 18:18:39 +01:00
Kemal Akkoyun e8230d3af6
Merge pull request #164 from thanos-io/no-ksonnet-functions
Expose components via functions with params merged with defaults
2020-11-03 12:49:20 +01:00
Matthias Loibl 6533e7c402
Fix structure of memcached store caches
Signed-off-by: Matthias Loibl <mail@matthiasloibl.com>
2020-11-03 12:42:49 +01:00
Matthias Loibl 58511091d6
thanos compact replicas can be 0 or 1
Signed-off-by: Matthias Loibl <mail@matthiasloibl.com>
2020-11-03 12:09:55 +01:00
Matthias Loibl 443b84283c
Use v0.16.0 as default version
Signed-off-by: Matthias Loibl <mail@matthiasloibl.com>
2020-11-03 12:07:14 +01:00
Matthias Loibl c7eac108e8
Move resources to containers
Signed-off-by: Matthias Loibl <mail@matthiasloibl.com>
2020-11-02 19:01:56 +01:00
Matthias Loibl b5ea451855
Improve examples
Signed-off-by: Matthias Loibl <mail@matthiasloibl.com>
2020-11-02 18:53:54 +01:00
Matthias Loibl ea9c2b97ea
Fix bug in thanos-rule when no rulesConfig given
Signed-off-by: Matthias Loibl <mail@matthiasloibl.com>
2020-11-02 18:53:52 +01:00
Matthias Loibl 7e51c09daa
Make thanos-store a function with default params
Signed-off-by: Matthias Loibl <mail@matthiasloibl.com>
2020-11-02 18:53:49 +01:00
Matthias Loibl ce62f424c3
Make thanos-rule a function with default params
Signed-off-by: Matthias Loibl <mail@matthiasloibl.com>
2020-10-30 17:16:41 +01:00
Matthias Loibl af16dc5193
Set example resources in common config
Signed-off-by: Matthias Loibl <mail@matthiasloibl.com>
2020-10-30 17:11:09 +01:00
Matthias Loibl 2f3b786dce
Make thanos-query-frontend a function with default params
Signed-off-by: Matthias Loibl <mail@matthiasloibl.com>
2020-10-30 16:46:35 +01:00
Matthias Loibl d78479c00a
Fix error messages with correct component name
Signed-off-by: Matthias Loibl <mail@matthiasloibl.com>
2020-10-30 16:13:33 +01:00
Matthias Loibl 1ec9cac3e9
Make thanos-query-frontend a function with default params
Signed-off-by: Matthias Loibl <mail@matthiasloibl.com>
2020-10-30 15:41:08 +01:00
Matthias Loibl b4e5954480
Remove unused thanos-query extensions
Signed-off-by: Matthias Loibl <mail@matthiasloibl.com>
2020-10-30 14:59:06 +01:00
Matthias Loibl a8f1ab3ce3
Make thanos-compact function with default params
Signed-off-by: Matthias Loibl <mail@matthiasloibl.com>
2020-10-30 13:24:46 +01:00
Matthias Loibl f3b7cdb8ac
Make thanos-bucket a function with default params
Signed-off-by: Matthias Loibl <mail@matthiasloibl.com>
2020-10-30 12:50:43 +01:00
Matthias Loibl f441e26db6
Make thanos-query a function with default params
Signed-off-by: Matthias Loibl <mail@matthiasloibl.com>
2020-10-30 12:50:24 +01:00
Kemal Akkoyun 7d78178269
Merge pull request #160 from metalmatze/bingo
Introduce bingo for tool deps and kubeval for validation
2020-10-27 15:26:01 +01:00
Matthias Loibl 2840d8064b
Introduce bingo for tool deps and kubeval for validation
We want to validate the generated YAMl with kubeval.
To add this tools dependency as binary I moved to using bingo for
managing those.

Signed-off-by: Matthias Loibl <mail@matthiasloibl.com>
2020-10-22 13:12:25 +02:00
Kemal Akkoyun 353c898cc8
Merge pull request #159 from metalmatze/remove-ksonnet
Remove ksonnet
2020-10-22 13:02:12 +02:00
Matthias Loibl 5bda260d62
Remove ksonnet
All ksonnet dependencies have been removed.
As a matter of fact there are no dependencies for kube-thanos left.
These are pure jsonnet,JSON,YAML files now.

Signed-off-by: Matthias Loibl <mail@matthiasloibl.com>
2020-10-22 12:29:19 +02:00
Kemal Akkoyun 419db243b3
Merge pull request #158 from metalmatze/no-ksonnet-thanos-store
Rewrite the thanos-receive component without ksonnet
2020-10-22 12:13:15 +02:00
Kemal Akkoyun ffb7a517db
Merge pull request #157 from metalmatze/no-ksonnet-thanos-rule
Rewrite the thanos-receive component without ksonnet
2020-10-22 12:12:43 +02:00
Matthias Loibl 3f651e97d4
Rewrite the thanos-receive component without ksonnet
There was one inconsistency in the service ports, otherwise it's all the
same.

Signed-off-by: Matthias Loibl <mail@matthiasloibl.com>
2020-10-22 12:10:03 +02:00
Matthias Loibl 076c23e38f
Rewrite the thanos-receive component without ksonnet
Adding rules to the all example too.

Signed-off-by: Matthias Loibl <mail@matthiasloibl.com>
2020-10-22 11:46:28 +02:00
Kemal Akkoyun 002a4c61e3
Merge pull request #156 from metalmatze/no-ksonnet-thanos-receive
Rewrite the thanos-receive component without ksonnet
2020-10-22 08:40:59 +02:00
Matthias Loibl 24551948b5
Rewrite the thanos-receive component without ksonnet
There were some changes in places were the receive component hasn't been
consistent with the other components.
Additionally, I also added PodDisruptionBudget to the examples/all/

Signed-off-by: Matthias Loibl <mail@matthiasloibl.com>
2020-10-21 19:22:44 +02:00
Kemal Akkoyun 9ac8214572
Merge pull request #154 from metalmatze/no-ksonnet-thanos-query-frontend
Rewrite the thanos-query-frontend component without ksonnet
2020-10-21 18:35:03 +02:00
Kemal Akkoyun 1a43623445
Rewrite the thanos-query component without ksonnet (#155)
As you can see there are no changes in the examples/all so the output
generated is equal to before.

Signed-off-by: Matthias Loibl <mail@matthiasloibl.com>
2020-10-21 18:34:48 +02:00
Matthias Loibl 23f983c9df
Rewrite the thanos-compact component without ksonnet (#153)
As you can see there are no changes in the examples/all so the output
generated is equal to before.

Signed-off-by: Matthias Loibl <mail@matthiasloibl.com>
2020-10-21 18:34:34 +02:00
Matthias Loibl 33fd23e9ea
Rewrite the thanos-query component without ksonnet
As you can see there are no changes in the examples/all so the output
generated is equal to before.

Signed-off-by: Matthias Loibl <mail@matthiasloibl.com>
2020-10-21 18:24:24 +02:00
Matthias Loibl a05a42190c
Rewrite the thanos-bucket component without ksonnet (#152)
As you can see there are no changes in the examples/all so the output
generated is equal to before.

Signed-off-by: Matthias Loibl <mail@matthiasloibl.com>
2020-10-21 18:07:44 +02:00
Matthias Loibl f6dbb77a2e
Rewrite the thanos-query-frontend component without ksonnet
As you can see there are no changes in the examples/all so the output
generated is equal to before.

Signed-off-by: Matthias Loibl <mail@matthiasloibl.com>
2020-10-21 17:55:42 +02:00
Matthias Loibl f56a9a0772
Add notice on all example usage (#151)
Signed-off-by: Matthias Loibl <mail@matthiasloibl.com>
2020-10-05 18:05:32 +02:00
Ben Ye 4eb672b042
update query frontend flag name (#150)
Signed-off-by: Ben Ye <yb532204897@gmail.com>
2020-09-28 20:48:22 +02:00
Matthias Loibl 66b017f9c7
Merge pull request #148 from clyang82/alertmanager
Support configure alertmanager
2020-09-23 11:14:09 +02:00
clyang82 e701891632 Support multiple configmap
Signed-off-by: clyang82 <chuyang@redhat.com>
2020-09-23 16:56:34 +08:00
clyang82 84a4bfba0d separate alertmanager with rules
Signed-off-by: clyang82 <chuyang@redhat.com>
2020-09-23 15:15:54 +08:00
clyang82 f08555a40d Update message
Signed-off-by: clyang82 <chuyang@redhat.com>
2020-09-22 18:30:26 +08:00
clyang82 23894fd005 support ruleFileKey
Signed-off-by: clyang82 <chuyang@redhat.com>
2020-09-22 18:14:42 +08:00
clyang82 a9f39efb02 read all yaml file in /etc/thanos/rules
Signed-off-by: clyang82 <chuyang@redhat.com>
2020-09-22 16:16:41 +08:00
clyang82 6eee0db52f support configure alertmanager
Signed-off-by: clyang82 <chuyang@redhat.com>
2020-09-22 15:18:08 +08:00
Kemal Akkoyun ef77a1120c
Cut v0.15.0 (#146)
Signed-off-by: Kemal Akkoyun <kakkoyun@gmail.com>
2020-09-07 13:36:37 +03:00
Kemal Akkoyun a6a0027a3c
querier: Add lookback delta for querier (#145)
* Add lookback delta for querier

Signed-off-by: Kemal Akkoyun <kakkoyun@gmail.com>

* Add changelog entry

Signed-off-by: Kemal Akkoyun <kakkoyun@gmail.com>
2020-09-01 18:43:47 +03:00
Matthias Loibl 44edee6baf
Merge pull request #144 from yeya24/dont-hardcode-service-port
Specify the downstreamURL port from service port
2020-08-17 11:59:28 +02:00
Ben Ye 86a4fd4bad specify the downstreamURL port from service port rather than a hardcoded value
Signed-off-by: Ben Ye <yb532204897@gmail.com>
2020-08-12 18:55:38 -04:00
Ben Ye 1c19d6ec9f
Add Thanos Query Frontend component (#142)
* add thanos query frontend component

Signed-off-by: Ben Ye <yb532204897@gmail.com>

* add changelog

Signed-off-by: Ben Ye <yb532204897@gmail.com>
2020-08-12 13:47:04 +02:00
Bartlomiej Plotka 683c533e7e
Merge pull request #143 from kakkoyun/loglevel
*: Add log level for all commands
2020-08-11 14:56:48 +01:00
Kemal Akkoyun 825acc819a Add log level for all commands
Signed-off-by: Kemal Akkoyun <kakkoyun@gmail.com>
2020-08-11 15:51:47 +02:00
Kemal Akkoyun c0eebc5e66
Cut v0.14.0 (#139) (#140)
Signed-off-by: Kemal Akkoyun <kakkoyun@gmail.com>
2020-07-31 13:54:13 +02:00
Kemal Akkoyun 757f54ad72
Cut v0.13.0 (#137) (#138)
Signed-off-by: Kemal Akkoyun <kakkoyun@gmail.com>
2020-07-30 14:56:48 +02:00
Frederic Branczyk c070408f18
Merge pull request #135 from thanos-io/pod-reference-instance
*: Relabel pod reference into instance label
2020-07-03 15:20:45 +02:00
Frederic Branczyk 369abbd272
receive: Only perform anti affinity against receive pods (#134)
Signed-off-by: Frederic Branczyk <fbranczyk@gmail.com>
2020-07-03 14:22:28 +02:00
Frederic Branczyk e9824dfa11
*: Relabel pod reference into instance label
The instance label is univesally used to refer to an instance in
alerting rules and dashboards. To make it easy to identify in a
Kubernetes environment it's most useful to relabel an identifier of the
pod into the instance label.

Signed-off-by: Frederic Branczyk <fbranczyk@gmail.com>
2020-07-03 12:34:28 +02:00
130 changed files with 7477 additions and 1566 deletions

13
.bingo/.gitignore vendored Executable file
View File

@ -0,0 +1,13 @@
# Ignore everything
*
# But not these files:
!.gitignore
!*.mod
!*.sum
!README.md
!Variables.mk
!variables.env
*tmp.mod

14
.bingo/README.md Executable file
View File

@ -0,0 +1,14 @@
# Project Development Dependencies.
This is directory which stores Go modules with pinned buildable package that is used within this repository, managed by https://github.com/bwplotka/bingo.
* Run `bingo get` to install all tools having each own module file in this directory.
* Run `bingo get <tool>` to install <tool> that have own module file in this directory.
* For Makefile: Make sure to put `include .bingo/Variables.mk` in your Makefile, then use $(<upper case tool name>) variable where <tool> is the .bingo/<tool>.mod.
* For shell: Run `source .bingo/variables.env` to source all environment variable for each tool.
* For go: Import `.bingo/variables.go` to for variable names.
* See https://github.com/bwplotka/bingo or -h on how to add, remove or change binaries dependencies.
## Requirements
* Go 1.14+

61
.bingo/Variables.mk Normal file
View File

@ -0,0 +1,61 @@
# Auto generated binary variables helper managed by https://github.com/bwplotka/bingo v0.8. DO NOT EDIT.
# All tools are designed to be build inside $GOBIN.
BINGO_DIR := $(dir $(lastword $(MAKEFILE_LIST)))
GOPATH ?= $(shell go env GOPATH)
GOBIN ?= $(firstword $(subst :, ,${GOPATH}))/bin
GO ?= $(shell which go)
# Below generated variables ensure that every time a tool under each variable is invoked, the correct version
# will be used; reinstalling only if needed.
# For example for embedmd variable:
#
# In your main Makefile (for non array binaries):
#
#include .bingo/Variables.mk # Assuming -dir was set to .bingo .
#
#command: $(EMBEDMD)
# @echo "Running embedmd"
# @$(EMBEDMD) <flags/args..>
#
EMBEDMD := $(GOBIN)/embedmd-v1.0.0
$(EMBEDMD): $(BINGO_DIR)/embedmd.mod
@# Install binary/ries using Go 1.14+ build command. This is using bwplotka/bingo-controlled, separate go module with pinned dependencies.
@echo "(re)installing $(GOBIN)/embedmd-v1.0.0"
@cd $(BINGO_DIR) && GOWORK=off $(GO) build -mod=mod -modfile=embedmd.mod -o=$(GOBIN)/embedmd-v1.0.0 "github.com/campoy/embedmd"
GOJSONTOYAML := $(GOBIN)/gojsontoyaml-v0.0.0-20200602132005-3697ded27e8c
$(GOJSONTOYAML): $(BINGO_DIR)/gojsontoyaml.mod
@# Install binary/ries using Go 1.14+ build command. This is using bwplotka/bingo-controlled, separate go module with pinned dependencies.
@echo "(re)installing $(GOBIN)/gojsontoyaml-v0.0.0-20200602132005-3697ded27e8c"
@cd $(BINGO_DIR) && GOWORK=off $(GO) build -mod=mod -modfile=gojsontoyaml.mod -o=$(GOBIN)/gojsontoyaml-v0.0.0-20200602132005-3697ded27e8c "github.com/brancz/gojsontoyaml"
JB := $(GOBIN)/jb-v0.4.0
$(JB): $(BINGO_DIR)/jb.mod
@# Install binary/ries using Go 1.14+ build command. This is using bwplotka/bingo-controlled, separate go module with pinned dependencies.
@echo "(re)installing $(GOBIN)/jb-v0.4.0"
@cd $(BINGO_DIR) && GOWORK=off $(GO) build -mod=mod -modfile=jb.mod -o=$(GOBIN)/jb-v0.4.0 "github.com/jsonnet-bundler/jsonnet-bundler/cmd/jb"
JSONNET_LINT := $(GOBIN)/jsonnet-lint-v0.20.0
$(JSONNET_LINT): $(BINGO_DIR)/jsonnet-lint.mod
@# Install binary/ries using Go 1.14+ build command. This is using bwplotka/bingo-controlled, separate go module with pinned dependencies.
@echo "(re)installing $(GOBIN)/jsonnet-lint-v0.20.0"
@cd $(BINGO_DIR) && GOWORK=off $(GO) build -mod=mod -modfile=jsonnet-lint.mod -o=$(GOBIN)/jsonnet-lint-v0.20.0 "github.com/google/go-jsonnet/cmd/jsonnet-lint"
JSONNET := $(GOBIN)/jsonnet-v0.20.0
$(JSONNET): $(BINGO_DIR)/jsonnet.mod
@# Install binary/ries using Go 1.14+ build command. This is using bwplotka/bingo-controlled, separate go module with pinned dependencies.
@echo "(re)installing $(GOBIN)/jsonnet-v0.20.0"
@cd $(BINGO_DIR) && GOWORK=off $(GO) build -mod=mod -modfile=jsonnet.mod -o=$(GOBIN)/jsonnet-v0.20.0 "github.com/google/go-jsonnet/cmd/jsonnet"
JSONNETFMT := $(GOBIN)/jsonnetfmt-v0.20.0
$(JSONNETFMT): $(BINGO_DIR)/jsonnetfmt.mod
@# Install binary/ries using Go 1.14+ build command. This is using bwplotka/bingo-controlled, separate go module with pinned dependencies.
@echo "(re)installing $(GOBIN)/jsonnetfmt-v0.20.0"
@cd $(BINGO_DIR) && GOWORK=off $(GO) build -mod=mod -modfile=jsonnetfmt.mod -o=$(GOBIN)/jsonnetfmt-v0.20.0 "github.com/google/go-jsonnet/cmd/jsonnetfmt"
KUBECONFORM := $(GOBIN)/kubeconform-v0.6.3
$(KUBECONFORM): $(BINGO_DIR)/kubeconform.mod
@# Install binary/ries using Go 1.14+ build command. This is using bwplotka/bingo-controlled, separate go module with pinned dependencies.
@echo "(re)installing $(GOBIN)/kubeconform-v0.6.3"
@cd $(BINGO_DIR) && GOWORK=off $(GO) build -mod=mod -modfile=kubeconform.mod -o=$(GOBIN)/kubeconform-v0.6.3 "github.com/yannh/kubeconform/cmd/kubeconform"

5
.bingo/embedmd.mod Normal file
View File

@ -0,0 +1,5 @@
module _ // Auto generated by https://github.com/bwplotka/bingo. DO NOT EDIT
go 1.15
require github.com/campoy/embedmd v1.0.0

4
.bingo/embedmd.sum Normal file
View File

@ -0,0 +1,4 @@
github.com/campoy/embedmd v1.0.0 h1:V4kI2qTJJLf4J29RzI/MAt2c3Bl4dQSYPuflzwFH2hY=
github.com/campoy/embedmd v1.0.0/go.mod h1:oxyr9RCiSXg0M3VJ3ks0UGfp98BpSSGr0kpiX3MzVl8=
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=

1
.bingo/go.mod Executable file
View File

@ -0,0 +1 @@
module _ // Fake go.mod auto-created by 'bingo' for go -moddir compatibility with non-Go projects. Commit this file, together with other .mod files.

5
.bingo/gojsontoyaml.mod Normal file
View File

@ -0,0 +1,5 @@
module _ // Auto generated by https://github.com/bwplotka/bingo. DO NOT EDIT
go 1.15
require github.com/brancz/gojsontoyaml v0.0.0-20200602132005-3697ded27e8c

7
.bingo/gojsontoyaml.sum Normal file
View File

@ -0,0 +1,7 @@
github.com/brancz/gojsontoyaml v0.0.0-20200602132005-3697ded27e8c h1:hb6WqfcKQZlNx/vahy51SaIvKnoXD5609Nm0PC4msEM=
github.com/brancz/gojsontoyaml v0.0.0-20200602132005-3697ded27e8c/go.mod h1:+00lOjYXPgMfxHVPvg9GDtc3BX5Xh5aFpB4gMB8gfMo=
github.com/ghodss/yaml v1.0.0 h1:wQHKEahhL6wmXdzwWG11gIVCkOv05bNOh+Rxn0yngAk=
github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/yaml.v2 v2.3.0 h1:clyUAQHOM3G0M3f5vQj7LuJrETvjVot3Z5el9nffUtU=
gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=

5
.bingo/jb.mod Normal file
View File

@ -0,0 +1,5 @@
module _ // Auto generated by https://github.com/bwplotka/bingo. DO NOT EDIT
go 1.15
require github.com/jsonnet-bundler/jsonnet-bundler v0.4.0 // cmd/jb

24
.bingo/jb.sum Normal file
View File

@ -0,0 +1,24 @@
github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc h1:cAKDfWh5VpdgMhJosfJnn5/FoN2SRZ4p7fJNX58YPaU=
github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc=
github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf h1:qet1QNfXsQxTZqLG4oE62mJzwPIB8+Tee4RNCL9ulrY=
github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0=
github.com/campoy/embedmd v1.0.0/go.mod h1:oxyr9RCiSXg0M3VJ3ks0UGfp98BpSSGr0kpiX3MzVl8=
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/fatih/color v1.7.0 h1:DkWD4oS2D8LGGgTQ6IvwJJXSL5Vp2ffcQg58nFV38Ys=
github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4=
github.com/jsonnet-bundler/jsonnet-bundler v0.4.0 h1:4BKZ6LDqPc2wJDmaKnmYD/vDjUptJtnUpai802MibFc=
github.com/jsonnet-bundler/jsonnet-bundler v0.4.0/go.mod h1:/by7P/OoohkI3q4CgSFqcoFsVY+IaNbzOVDknEsKDeU=
github.com/mattn/go-colorable v0.0.9 h1:UVL0vNpWh04HeJXV0KLcaT7r06gOH2l4OW6ddYRUIY4=
github.com/mattn/go-colorable v0.0.9/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU=
github.com/mattn/go-isatty v0.0.6 h1:SrwhHcpV4nWrMGdNcC2kXpMfcBVYGDuTArqyhocJgvA=
github.com/mattn/go-isatty v0.0.6/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s=
github.com/pkg/errors v0.8.0 h1:WdK/asTD0HN+q6hsWO3/vpuAkAr+tw6aNJNDFFf0+qw=
github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI=
golang.org/x/sys v0.0.0-20190222072716-a9d3bda3a223/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20190310054646-10058d7d4faa h1:lqti/xP+yD/6zH5TqEwx2MilNIJY5Vbc6Qr8J3qyPIQ=
golang.org/x/sys v0.0.0-20190310054646-10058d7d4faa/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
gopkg.in/alecthomas/kingpin.v2 v2.2.6 h1:jMFz6MfLP0/4fUyZle81rXUoxOBFi19VUFKVDOQfozc=
gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw=

5
.bingo/jsonnet-lint.mod Normal file
View File

@ -0,0 +1,5 @@
module _ // Auto generated by https://github.com/bwplotka/bingo. DO NOT EDIT
go 1.15
require github.com/google/go-jsonnet v0.20.0 // cmd/jsonnet-lint

41
.bingo/jsonnet-lint.sum Normal file
View File

@ -0,0 +1,41 @@
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/fatih/color v1.9.0/go.mod h1:eQcE1qtQxscV5RaZvpXrrb8Drkc3/DdQ+uUYCNjL+zU=
github.com/fatih/color v1.10.0 h1:s36xzo75JdqLaaWoiEHk767eHiwo0598uUxyfiPkDsg=
github.com/fatih/color v1.10.0/go.mod h1:ELkj/draVOlAH/xkhN6mQ50Qd0MPOk5AAr3maGEBuJM=
github.com/fatih/color v1.12.0 h1:mRhaKNwANqRgUBGKmnI5ZxEk7QXmjQeCcuYFMX2bfcc=
github.com/fatih/color v1.12.0/go.mod h1:ELkj/draVOlAH/xkhN6mQ50Qd0MPOk5AAr3maGEBuJM=
github.com/google/go-jsonnet v0.17.1-0.20210101181740-31d71aaccda6 h1:91EupyycmO5ctzKuWEZ9nX0Cal1NveMiWcXxmRtLyLQ=
github.com/google/go-jsonnet v0.17.1-0.20210101181740-31d71aaccda6/go.mod h1:sOcuej3UW1vpPTZOr8L7RQimqai1a57bt5j22LzGZCw=
github.com/google/go-jsonnet v0.20.0 h1:WG4TTSARuV7bSm4PMB4ohjxe33IHT5WVTrJSU33uT4g=
github.com/google/go-jsonnet v0.20.0/go.mod h1:VbgWF9JX7ztlv770x/TolZNGGFfiHEVx9G6ca2eUmeA=
github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo=
github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ=
github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI=
github.com/mattn/go-colorable v0.1.4/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE=
github.com/mattn/go-colorable v0.1.8 h1:c1ghPdyEDarC70ftn0y+A/Ee++9zz8ljHG1b13eJ0s8=
github.com/mattn/go-colorable v0.1.8/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc=
github.com/mattn/go-isatty v0.0.8/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s=
github.com/mattn/go-isatty v0.0.11/go.mod h1:PhnuNfih5lzO57/f3n+odYbM4JtupLOxQOAqxQCu2WE=
github.com/mattn/go-isatty v0.0.12 h1:wuysRhFDzyxgEmMf5xjvJ2M9dZoWAXNNr5LSBS7uHXY=
github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU=
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/sergi/go-diff v1.1.0/go.mod h1:STckp+ISIX8hZLjrqAeVduY0gWCT9IjLuqbuNXdaHfM=
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4=
golang.org/x/sys v0.0.0-20190222072716-a9d3bda3a223/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20191026070338-33540a1f6037/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200116001909-b77594299b42/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20210112091331-59c308dcf3cc h1:y0Og6AYdwus7SIAnKnDxjc4gJetRiYEWOx4AKbOeyEI=
golang.org/x/sys v0.0.0-20210112091331-59c308dcf3cc/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.1.0 h1:kunALQeHf1/185U1i0GOB/fy1IPRDDpuoOOqRReG57U=
golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
gopkg.in/yaml.v2 v2.2.7 h1:VUgggvou5XRW9mHwD/yXxIYSMtY0zoKQf/v226p2nyo=
gopkg.in/yaml.v2 v2.2.7/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
sigs.k8s.io/yaml v1.1.0 h1:4A07+ZFc2wgJwo8YNlQpr1rVlgUDlxXHhPJciaPY5gs=
sigs.k8s.io/yaml v1.1.0/go.mod h1:UJmg0vDUVViEyp3mgSv9WPwZCDxu4rQW1olrI1uml+o=

5
.bingo/jsonnet.mod Normal file
View File

@ -0,0 +1,5 @@
module _ // Auto generated by https://github.com/bwplotka/bingo. DO NOT EDIT
go 1.15
require github.com/google/go-jsonnet v0.20.0 // cmd/jsonnet

41
.bingo/jsonnet.sum Normal file
View File

@ -0,0 +1,41 @@
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/fatih/color v1.9.0/go.mod h1:eQcE1qtQxscV5RaZvpXrrb8Drkc3/DdQ+uUYCNjL+zU=
github.com/fatih/color v1.10.0 h1:s36xzo75JdqLaaWoiEHk767eHiwo0598uUxyfiPkDsg=
github.com/fatih/color v1.10.0/go.mod h1:ELkj/draVOlAH/xkhN6mQ50Qd0MPOk5AAr3maGEBuJM=
github.com/fatih/color v1.12.0 h1:mRhaKNwANqRgUBGKmnI5ZxEk7QXmjQeCcuYFMX2bfcc=
github.com/fatih/color v1.12.0/go.mod h1:ELkj/draVOlAH/xkhN6mQ50Qd0MPOk5AAr3maGEBuJM=
github.com/google/go-jsonnet v0.17.1-0.20210101181740-31d71aaccda6 h1:91EupyycmO5ctzKuWEZ9nX0Cal1NveMiWcXxmRtLyLQ=
github.com/google/go-jsonnet v0.17.1-0.20210101181740-31d71aaccda6/go.mod h1:sOcuej3UW1vpPTZOr8L7RQimqai1a57bt5j22LzGZCw=
github.com/google/go-jsonnet v0.20.0 h1:WG4TTSARuV7bSm4PMB4ohjxe33IHT5WVTrJSU33uT4g=
github.com/google/go-jsonnet v0.20.0/go.mod h1:VbgWF9JX7ztlv770x/TolZNGGFfiHEVx9G6ca2eUmeA=
github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo=
github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ=
github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI=
github.com/mattn/go-colorable v0.1.4/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE=
github.com/mattn/go-colorable v0.1.8 h1:c1ghPdyEDarC70ftn0y+A/Ee++9zz8ljHG1b13eJ0s8=
github.com/mattn/go-colorable v0.1.8/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc=
github.com/mattn/go-isatty v0.0.8/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s=
github.com/mattn/go-isatty v0.0.11/go.mod h1:PhnuNfih5lzO57/f3n+odYbM4JtupLOxQOAqxQCu2WE=
github.com/mattn/go-isatty v0.0.12 h1:wuysRhFDzyxgEmMf5xjvJ2M9dZoWAXNNr5LSBS7uHXY=
github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU=
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/sergi/go-diff v1.1.0/go.mod h1:STckp+ISIX8hZLjrqAeVduY0gWCT9IjLuqbuNXdaHfM=
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4=
golang.org/x/sys v0.0.0-20190222072716-a9d3bda3a223/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20191026070338-33540a1f6037/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200116001909-b77594299b42/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20210112091331-59c308dcf3cc h1:y0Og6AYdwus7SIAnKnDxjc4gJetRiYEWOx4AKbOeyEI=
golang.org/x/sys v0.0.0-20210112091331-59c308dcf3cc/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.1.0 h1:kunALQeHf1/185U1i0GOB/fy1IPRDDpuoOOqRReG57U=
golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
gopkg.in/yaml.v2 v2.2.7 h1:VUgggvou5XRW9mHwD/yXxIYSMtY0zoKQf/v226p2nyo=
gopkg.in/yaml.v2 v2.2.7/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
sigs.k8s.io/yaml v1.1.0 h1:4A07+ZFc2wgJwo8YNlQpr1rVlgUDlxXHhPJciaPY5gs=
sigs.k8s.io/yaml v1.1.0/go.mod h1:UJmg0vDUVViEyp3mgSv9WPwZCDxu4rQW1olrI1uml+o=

5
.bingo/jsonnetfmt.mod Normal file
View File

@ -0,0 +1,5 @@
module _ // Auto generated by https://github.com/bwplotka/bingo. DO NOT EDIT
go 1.15
require github.com/google/go-jsonnet v0.20.0 // cmd/jsonnetfmt

41
.bingo/jsonnetfmt.sum Normal file
View File

@ -0,0 +1,41 @@
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/fatih/color v1.9.0/go.mod h1:eQcE1qtQxscV5RaZvpXrrb8Drkc3/DdQ+uUYCNjL+zU=
github.com/fatih/color v1.10.0 h1:s36xzo75JdqLaaWoiEHk767eHiwo0598uUxyfiPkDsg=
github.com/fatih/color v1.10.0/go.mod h1:ELkj/draVOlAH/xkhN6mQ50Qd0MPOk5AAr3maGEBuJM=
github.com/fatih/color v1.12.0 h1:mRhaKNwANqRgUBGKmnI5ZxEk7QXmjQeCcuYFMX2bfcc=
github.com/fatih/color v1.12.0/go.mod h1:ELkj/draVOlAH/xkhN6mQ50Qd0MPOk5AAr3maGEBuJM=
github.com/google/go-jsonnet v0.17.1-0.20210101181740-31d71aaccda6 h1:91EupyycmO5ctzKuWEZ9nX0Cal1NveMiWcXxmRtLyLQ=
github.com/google/go-jsonnet v0.17.1-0.20210101181740-31d71aaccda6/go.mod h1:sOcuej3UW1vpPTZOr8L7RQimqai1a57bt5j22LzGZCw=
github.com/google/go-jsonnet v0.20.0 h1:WG4TTSARuV7bSm4PMB4ohjxe33IHT5WVTrJSU33uT4g=
github.com/google/go-jsonnet v0.20.0/go.mod h1:VbgWF9JX7ztlv770x/TolZNGGFfiHEVx9G6ca2eUmeA=
github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo=
github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ=
github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI=
github.com/mattn/go-colorable v0.1.4/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE=
github.com/mattn/go-colorable v0.1.8 h1:c1ghPdyEDarC70ftn0y+A/Ee++9zz8ljHG1b13eJ0s8=
github.com/mattn/go-colorable v0.1.8/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc=
github.com/mattn/go-isatty v0.0.8/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s=
github.com/mattn/go-isatty v0.0.11/go.mod h1:PhnuNfih5lzO57/f3n+odYbM4JtupLOxQOAqxQCu2WE=
github.com/mattn/go-isatty v0.0.12 h1:wuysRhFDzyxgEmMf5xjvJ2M9dZoWAXNNr5LSBS7uHXY=
github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU=
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/sergi/go-diff v1.1.0/go.mod h1:STckp+ISIX8hZLjrqAeVduY0gWCT9IjLuqbuNXdaHfM=
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4=
golang.org/x/sys v0.0.0-20190222072716-a9d3bda3a223/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20191026070338-33540a1f6037/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200116001909-b77594299b42/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20210112091331-59c308dcf3cc h1:y0Og6AYdwus7SIAnKnDxjc4gJetRiYEWOx4AKbOeyEI=
golang.org/x/sys v0.0.0-20210112091331-59c308dcf3cc/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.1.0 h1:kunALQeHf1/185U1i0GOB/fy1IPRDDpuoOOqRReG57U=
golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
gopkg.in/yaml.v2 v2.2.7 h1:VUgggvou5XRW9mHwD/yXxIYSMtY0zoKQf/v226p2nyo=
gopkg.in/yaml.v2 v2.2.7/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
sigs.k8s.io/yaml v1.1.0 h1:4A07+ZFc2wgJwo8YNlQpr1rVlgUDlxXHhPJciaPY5gs=
sigs.k8s.io/yaml v1.1.0/go.mod h1:UJmg0vDUVViEyp3mgSv9WPwZCDxu4rQW1olrI1uml+o=

5
.bingo/kubeconform.mod Normal file
View File

@ -0,0 +1,5 @@
module _ // Auto generated by https://github.com/bwplotka/bingo. DO NOT EDIT
go 1.21
require github.com/yannh/kubeconform v0.6.3 // cmd/kubeconform

25
.bingo/kubeconform.sum Normal file
View File

@ -0,0 +1,25 @@
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/santhosh-tekuri/jsonschema/v5 v5.1.1 h1:lEOLY2vyGIqKWUI9nzsOJRV3mb3WC9dXYORsLEUcoeY=
github.com/santhosh-tekuri/jsonschema/v5 v5.1.1/go.mod h1:FKdcjfQW6rpZSnxxUvEA5H/cDPdvJ/SZJQLWWXWGrZ0=
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI=
github.com/xeipuuv/gojsonpointer v0.0.0-20180127040702-4e3ac2762d5f h1:J9EGpcZtP0E/raorCMxlFGSTBrsSlaDGf3jU/qvAE2c=
github.com/xeipuuv/gojsonpointer v0.0.0-20180127040702-4e3ac2762d5f/go.mod h1:N2zxlSyiKSe5eX1tZViRH5QA0qijqEDrYZiPEAiq3wU=
github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415 h1:EzJWgHovont7NscjpAxXsDA8S8BMYve8Y5+7cuRE7R0=
github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415/go.mod h1:GwrjFmJcFw6At/Gs6z4yjiIwzuJ1/+UwLxMQDVQXShQ=
github.com/xeipuuv/gojsonschema v1.2.0 h1:LhYJRs+L4fBtjZUfuSZIKGeVu0QRy8e5Xi7D17UxZ74=
github.com/xeipuuv/gojsonschema v1.2.0/go.mod h1:anYRn/JVcOK2ZgGU+IjEV4nwlhoK5sQluxsYJ78Id3Y=
github.com/yannh/kubeconform v0.4.4 h1:1+Wmd2QnZFaHd5hrNXWxwvPbE/pVTDNNWWXRaoN1Zbs=
github.com/yannh/kubeconform v0.4.4/go.mod h1:Ysf3RSreh2rX8IJsVt/uT3Um/U3e3ykx6Fcz8nCdskM=
github.com/yannh/kubeconform v0.6.3 h1:lNmb/kphyzitA+GBsOxjBsagCEpjLvt3+qo3XMiEOUA=
github.com/yannh/kubeconform v0.6.3/go.mod h1:4E6oaL+lh7KgCG2SaOabeeAFBkyKu5D9ab0OEekGcbs=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
gopkg.in/yaml.v2 v2.3.0 h1:clyUAQHOM3G0M3f5vQj7LuJrETvjVot3Z5el9nffUtU=
gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY=
gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ=
sigs.k8s.io/yaml v1.2.0 h1:kr/MCeFWJWTwyaHoR9c8EjH9OumOmoF9YGiZd7lFm/Q=
sigs.k8s.io/yaml v1.2.0/go.mod h1:yfXDCHCao9+ENCvLSE62v9VSji2MKu5jeNfTrofGhJc=

57
.bingo/kubeval.sum Normal file
View File

@ -0,0 +1,57 @@
github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU=
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/fatih/color v1.7.0 h1:DkWD4oS2D8LGGgTQ6IvwJJXSL5Vp2ffcQg58nFV38Ys=
github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4=
github.com/fsnotify/fsnotify v1.4.7 h1:IXs+QLmnXW2CcXuY+8Mzv/fWEsPGWxqefPtCP5CnV9I=
github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo=
github.com/hashicorp/errwrap v0.0.0-20180715044906-d6c0cd880357 h1:Rem2+U35z1QtPQc6r+WolF7yXiefXqDKyk+lN2pE164=
github.com/hashicorp/errwrap v0.0.0-20180715044906-d6c0cd880357/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4=
github.com/hashicorp/go-multierror v0.0.0-20180717150148-3d5d8f294aa0 h1:j30noezaCfvNLcdMYSvHLv81DxYRSt1grlpseG67vhU=
github.com/hashicorp/go-multierror v0.0.0-20180717150148-3d5d8f294aa0/go.mod h1:JMRHfdO9jKNzS/+BTlxCjKNQHg/jZAft8U7LloJvN7I=
github.com/hashicorp/hcl v0.0.0-20180404174102-ef8a98b0bbce h1:xdsDDbiBDQTKASoGEZ+pEmF1OnWuu8AQ9I8iNbHNeno=
github.com/hashicorp/hcl v0.0.0-20180404174102-ef8a98b0bbce/go.mod h1:oZtUIOe8dh44I2q6ScRibXws4Ajl+d+nod3AaR9vL5w=
github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8=
github.com/instrumenta/kubeval v0.0.0-20201005082916-38668c6c5b23 h1:M1Ms+wV9kd4g65MWhdyoMmaVIZj4U18t5bFRPs/zJUs=
github.com/instrumenta/kubeval v0.0.0-20201005082916-38668c6c5b23/go.mod h1:cD+P/oZrBwOnaIHXrqvKPuN353KPxGomnsXSXf8pFJs=
github.com/magiconair/properties v1.8.0 h1:LLgXmsheXeRoUOBOjtwPQCWIYqM/LU1ayDtDePerRcY=
github.com/magiconair/properties v1.8.0/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ=
github.com/mattn/go-colorable v0.1.0 h1:v2XXALHHh6zHfYTJ+cSkwtyffnaOyR1MXaA91mTrb8o=
github.com/mattn/go-colorable v0.1.0/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU=
github.com/mattn/go-isatty v0.0.4 h1:bnP0vzxcAdeI1zdubAl5PjU6zsERjGZb7raWodagDYs=
github.com/mattn/go-isatty v0.0.4/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4=
github.com/mitchellh/mapstructure v0.0.0-20180715050151-f15292f7a699 h1:KXZJFdun9knAVAR8tg/aHJEr5DgtcbqyvzacK+CDCaI=
github.com/mitchellh/mapstructure v0.0.0-20180715050151-f15292f7a699/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y=
github.com/pelletier/go-toml v0.0.0-20180724185102-c2dbbc24a979 h1:Uh8pTMDzw+nuDTW7lyxcpmYqQJFE8SnO93F3lyY4XzY=
github.com/pelletier/go-toml v0.0.0-20180724185102-c2dbbc24a979/go.mod h1:5z9KED0ma1S8pY6P1sdut58dfprrGBbd/94hg7ilaic=
github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/spf13/afero v1.1.1 h1:Lt3ihYMlE+lreX1GS4Qw4ZsNpYQLxIXKBTEOXm3nt6I=
github.com/spf13/afero v1.1.1/go.mod h1:j4pytiNVoe2o6bmDsKpLACNPDBIoEAkihy7loJ1B0CQ=
github.com/spf13/cast v1.2.0 h1:HHl1DSRbEQN2i8tJmtS6ViPyHx35+p51amrdsiTCrkg=
github.com/spf13/cast v1.2.0/go.mod h1:r2rcYCSwa1IExKTDiTfzaxqT2FNHs8hODu4LnUfgKEg=
github.com/spf13/cobra v0.0.0-20180820174524-ff0d02e85550 h1:LB9SHuuXO8gnsHtexOQSpsJrrAHYA35lvHUaE74kznU=
github.com/spf13/cobra v0.0.0-20180820174524-ff0d02e85550/go.mod h1:1l0Ry5zgKvJasoi3XT1TypsSe7PqH0Sj9dhYf7v3XqQ=
github.com/spf13/jwalterweatherman v0.0.0-20180814060501-14d3d4c51834 h1:kJI9pPzfsULT/72wy7mxkRQZPtKWgFdCA2RTGZ4v8/E=
github.com/spf13/jwalterweatherman v0.0.0-20180814060501-14d3d4c51834/go.mod h1:cQK4TGJAtQXfYWX+Ddv3mKDzgVb68N+wFjFa4jdeBTo=
github.com/spf13/pflag v0.0.0-20180821114517-d929dcbb1086 h1:iU+nPfqRqK8ShQqnpZLv8cZ9oklo6NFUcmX1JT5Rudg=
github.com/spf13/pflag v0.0.0-20180821114517-d929dcbb1086/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4=
github.com/spf13/viper v1.1.0 h1:V7OZpY8i3C1x/pDmU0zNNlfVoDz112fSYvtWMjjS3f4=
github.com/spf13/viper v1.1.0/go.mod h1:A8kyI5cUJhb8N+3pkfONlcEcZbueH6nhAm0Fq7SrnBM=
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI=
github.com/xeipuuv/gojsonpointer v0.0.0-20180127040702-4e3ac2762d5f h1:J9EGpcZtP0E/raorCMxlFGSTBrsSlaDGf3jU/qvAE2c=
github.com/xeipuuv/gojsonpointer v0.0.0-20180127040702-4e3ac2762d5f/go.mod h1:N2zxlSyiKSe5eX1tZViRH5QA0qijqEDrYZiPEAiq3wU=
github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415 h1:EzJWgHovont7NscjpAxXsDA8S8BMYve8Y5+7cuRE7R0=
github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415/go.mod h1:GwrjFmJcFw6At/Gs6z4yjiIwzuJ1/+UwLxMQDVQXShQ=
github.com/xeipuuv/gojsonschema v0.0.0-20180816142147-da425ebb7609 h1:BcMExZAULPkihVZ7UJXK7t8rwGqisXFw75tILnafhBY=
github.com/xeipuuv/gojsonschema v0.0.0-20180816142147-da425ebb7609/go.mod h1:5yf86TLmAcydyeJq5YvxkGPE2fm/u4myDekKRoLuqhs=
golang.org/x/sys v0.0.0-20180821044426-4ea2f632f6e9 h1:0RHCP7KEw0rDuVXXaT2gfV77uu6lTKa5aItB+EoFbQk=
golang.org/x/sys v0.0.0-20180821044426-4ea2f632f6e9/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/text v0.0.0-20180810153555-6e3c4e7365dd h1:e/dojZNNKqwK3xq7UQTKTQJim18r/FxvQk7PFXULeZg=
golang.org/x/text v0.0.0-20180810153555-6e3c4e7365dd/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/yaml.v2 v2.2.1 h1:mUhvW9EsL+naU5Q3cakzfE91YhliOondGd6ZrsDBHQE=
gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
sigs.k8s.io/yaml v1.1.0 h1:4A07+ZFc2wgJwo8YNlQpr1rVlgUDlxXHhPJciaPY5gs=
sigs.k8s.io/yaml v1.1.0/go.mod h1:UJmg0vDUVViEyp3mgSv9WPwZCDxu4rQW1olrI1uml+o=

24
.bingo/variables.env Normal file
View File

@ -0,0 +1,24 @@
# Auto generated binary variables helper managed by https://github.com/bwplotka/bingo v0.8. DO NOT EDIT.
# All tools are designed to be build inside $GOBIN.
# Those variables will work only until 'bingo get' was invoked, or if tools were installed via Makefile's Variables.mk.
GOBIN=${GOBIN:=$(go env GOBIN)}
if [ -z "$GOBIN" ]; then
GOBIN="$(go env GOPATH)/bin"
fi
EMBEDMD="${GOBIN}/embedmd-v1.0.0"
GOJSONTOYAML="${GOBIN}/gojsontoyaml-v0.0.0-20200602132005-3697ded27e8c"
JB="${GOBIN}/jb-v0.4.0"
JSONNET_LINT="${GOBIN}/jsonnet-lint-v0.20.0"
JSONNET="${GOBIN}/jsonnet-v0.20.0"
JSONNETFMT="${GOBIN}/jsonnetfmt-v0.20.0"
KUBECONFORM="${GOBIN}/kubeconform-v0.4.4"

View File

@ -1,14 +0,0 @@
jobs:
build:
working_directory: /go/src/github.com/{{ORG_NAME}}/{{REPO_NAME}}
docker:
- image: quay.io/coreos/jsonnet-ci
steps:
- checkout
- run: make --always-make vendor generate
- run: git diff --exit-code
workflows:
version: 2
build_and_test:
jobs:
- build

View File

@ -0,0 +1,500 @@
{
"description": "ServiceMonitor defines monitoring for a set of services.",
"properties": {
"apiVersion": {
"description": "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources",
"type": "string"
},
"kind": {
"description": "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds",
"type": "string"
},
"metadata": {
"type": "object"
},
"spec": {
"description": "Specification of desired Service selection for target discovery by Prometheus.",
"properties": {
"endpoints": {
"description": "A list of endpoints allowed as part of this ServiceMonitor.",
"items": {
"description": "Endpoint defines a scrapeable endpoint serving Prometheus metrics.",
"properties": {
"basicAuth": {
"description": "BasicAuth allow an endpoint to authenticate over basic authentication More info: https://prometheus.io/docs/operating/configuration/#endpoints",
"properties": {
"password": {
"description": "The secret in the service monitor namespace that contains the password for authentication.",
"properties": {
"key": {
"description": "The key of the secret to select from. Must be a valid secret key.",
"type": "string"
},
"name": {
"description": "Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names TODO: Add other useful fields. apiVersion, kind, uid?",
"type": "string"
},
"optional": {
"description": "Specify whether the Secret or its key must be defined",
"type": "boolean"
}
},
"required": [
"key"
],
"type": "object",
"additionalProperties": false
},
"username": {
"description": "The secret in the service monitor namespace that contains the username for authentication.",
"properties": {
"key": {
"description": "The key of the secret to select from. Must be a valid secret key.",
"type": "string"
},
"name": {
"description": "Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names TODO: Add other useful fields. apiVersion, kind, uid?",
"type": "string"
},
"optional": {
"description": "Specify whether the Secret or its key must be defined",
"type": "boolean"
}
},
"required": [
"key"
],
"type": "object",
"additionalProperties": false
}
},
"type": "object",
"additionalProperties": false
},
"bearerTokenFile": {
"description": "File to read bearer token for scraping targets.",
"type": "string"
},
"bearerTokenSecret": {
"description": "Secret to mount to read bearer token for scraping targets. The secret needs to be in the same namespace as the service monitor and accessible by the Prometheus Operator.",
"properties": {
"key": {
"description": "The key of the secret to select from. Must be a valid secret key.",
"type": "string"
},
"name": {
"description": "Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names TODO: Add other useful fields. apiVersion, kind, uid?",
"type": "string"
},
"optional": {
"description": "Specify whether the Secret or its key must be defined",
"type": "boolean"
}
},
"required": [
"key"
],
"type": "object",
"additionalProperties": false
},
"honorLabels": {
"description": "HonorLabels chooses the metric's labels on collisions with target labels.",
"type": "boolean"
},
"honorTimestamps": {
"description": "HonorTimestamps controls whether Prometheus respects the timestamps present in scraped data.",
"type": "boolean"
},
"interval": {
"description": "Interval at which metrics should be scraped",
"type": "string"
},
"metricRelabelings": {
"description": "MetricRelabelConfigs to apply to samples before ingestion.",
"items": {
"description": "RelabelConfig allows dynamic rewriting of the label set, being applied to samples before ingestion. It defines `<metric_relabel_configs>`-section of Prometheus configuration. More info: https://prometheus.io/docs/prometheus/latest/configuration/configuration/#metric_relabel_configs",
"properties": {
"action": {
"description": "Action to perform based on regex matching. Default is 'replace'",
"type": "string"
},
"modulus": {
"description": "Modulus to take of the hash of the source label values.",
"format": "int64",
"type": "integer"
},
"regex": {
"description": "Regular expression against which the extracted value is matched. Default is '(.*)'",
"type": "string"
},
"replacement": {
"description": "Replacement value against which a regex replace is performed if the regular expression matches. Regex capture groups are available. Default is '$1'",
"type": "string"
},
"separator": {
"description": "Separator placed between concatenated source label values. default is ';'.",
"type": "string"
},
"sourceLabels": {
"description": "The source labels select values from existing labels. Their content is concatenated using the configured separator and matched against the configured regular expression for the replace, keep, and drop actions.",
"items": {
"type": "string"
},
"type": "array"
},
"targetLabel": {
"description": "Label to which the resulting value is written in a replace action. It is mandatory for replace actions. Regex capture groups are available.",
"type": "string"
}
},
"type": "object",
"additionalProperties": false
},
"type": "array"
},
"params": {
"additionalProperties": {
"items": {
"type": "string"
},
"type": "array"
},
"description": "Optional HTTP URL parameters",
"type": "object"
},
"path": {
"description": "HTTP path to scrape for metrics.",
"type": "string"
},
"port": {
"description": "Name of the service port this endpoint refers to. Mutually exclusive with targetPort.",
"type": "string"
},
"proxyUrl": {
"description": "ProxyURL eg http://proxyserver:2195 Directs scrapes to proxy through this endpoint.",
"type": "string"
},
"relabelings": {
"description": "RelabelConfigs to apply to samples before scraping. More info: https://prometheus.io/docs/prometheus/latest/configuration/configuration/#relabel_config",
"items": {
"description": "RelabelConfig allows dynamic rewriting of the label set, being applied to samples before ingestion. It defines `<metric_relabel_configs>`-section of Prometheus configuration. More info: https://prometheus.io/docs/prometheus/latest/configuration/configuration/#metric_relabel_configs",
"properties": {
"action": {
"description": "Action to perform based on regex matching. Default is 'replace'",
"type": "string"
},
"modulus": {
"description": "Modulus to take of the hash of the source label values.",
"format": "int64",
"type": "integer"
},
"regex": {
"description": "Regular expression against which the extracted value is matched. Default is '(.*)'",
"type": "string"
},
"replacement": {
"description": "Replacement value against which a regex replace is performed if the regular expression matches. Regex capture groups are available. Default is '$1'",
"type": "string"
},
"separator": {
"description": "Separator placed between concatenated source label values. default is ';'.",
"type": "string"
},
"sourceLabels": {
"description": "The source labels select values from existing labels. Their content is concatenated using the configured separator and matched against the configured regular expression for the replace, keep, and drop actions.",
"items": {
"type": "string"
},
"type": "array"
},
"targetLabel": {
"description": "Label to which the resulting value is written in a replace action. It is mandatory for replace actions. Regex capture groups are available.",
"type": "string"
}
},
"type": "object",
"additionalProperties": false
},
"type": "array"
},
"scheme": {
"description": "HTTP scheme to use for scraping.",
"type": "string"
},
"scrapeTimeout": {
"description": "Timeout after which the scrape is ended",
"type": "string"
},
"targetPort": {
"anyOf": [
{
"type": "integer"
},
{
"type": "string"
}
],
"description": "Name or number of the target port of the Pod behind the Service, the port must be specified with container port property. Mutually exclusive with port.",
"x-kubernetes-int-or-string": true
},
"tlsConfig": {
"description": "TLS configuration to use when scraping the endpoint",
"properties": {
"ca": {
"description": "Struct containing the CA cert to use for the targets.",
"properties": {
"configMap": {
"description": "ConfigMap containing data to use for the targets.",
"properties": {
"key": {
"description": "The key to select.",
"type": "string"
},
"name": {
"description": "Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names TODO: Add other useful fields. apiVersion, kind, uid?",
"type": "string"
},
"optional": {
"description": "Specify whether the ConfigMap or its key must be defined",
"type": "boolean"
}
},
"required": [
"key"
],
"type": "object",
"additionalProperties": false
},
"secret": {
"description": "Secret containing data to use for the targets.",
"properties": {
"key": {
"description": "The key of the secret to select from. Must be a valid secret key.",
"type": "string"
},
"name": {
"description": "Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names TODO: Add other useful fields. apiVersion, kind, uid?",
"type": "string"
},
"optional": {
"description": "Specify whether the Secret or its key must be defined",
"type": "boolean"
}
},
"required": [
"key"
],
"type": "object",
"additionalProperties": false
}
},
"type": "object",
"additionalProperties": false
},
"caFile": {
"description": "Path to the CA cert in the Prometheus container to use for the targets.",
"type": "string"
},
"cert": {
"description": "Struct containing the client cert file for the targets.",
"properties": {
"configMap": {
"description": "ConfigMap containing data to use for the targets.",
"properties": {
"key": {
"description": "The key to select.",
"type": "string"
},
"name": {
"description": "Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names TODO: Add other useful fields. apiVersion, kind, uid?",
"type": "string"
},
"optional": {
"description": "Specify whether the ConfigMap or its key must be defined",
"type": "boolean"
}
},
"required": [
"key"
],
"type": "object",
"additionalProperties": false
},
"secret": {
"description": "Secret containing data to use for the targets.",
"properties": {
"key": {
"description": "The key of the secret to select from. Must be a valid secret key.",
"type": "string"
},
"name": {
"description": "Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names TODO: Add other useful fields. apiVersion, kind, uid?",
"type": "string"
},
"optional": {
"description": "Specify whether the Secret or its key must be defined",
"type": "boolean"
}
},
"required": [
"key"
],
"type": "object",
"additionalProperties": false
}
},
"type": "object",
"additionalProperties": false
},
"certFile": {
"description": "Path to the client cert file in the Prometheus container for the targets.",
"type": "string"
},
"insecureSkipVerify": {
"description": "Disable target certificate validation.",
"type": "boolean"
},
"keyFile": {
"description": "Path to the client key file in the Prometheus container for the targets.",
"type": "string"
},
"keySecret": {
"description": "Secret containing the client key file for the targets.",
"properties": {
"key": {
"description": "The key of the secret to select from. Must be a valid secret key.",
"type": "string"
},
"name": {
"description": "Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names TODO: Add other useful fields. apiVersion, kind, uid?",
"type": "string"
},
"optional": {
"description": "Specify whether the Secret or its key must be defined",
"type": "boolean"
}
},
"required": [
"key"
],
"type": "object",
"additionalProperties": false
},
"serverName": {
"description": "Used to verify the hostname for the targets.",
"type": "string"
}
},
"type": "object",
"additionalProperties": false
}
},
"type": "object",
"additionalProperties": false
},
"type": "array"
},
"jobLabel": {
"description": "The label to use to retrieve the job name from.",
"type": "string"
},
"namespaceSelector": {
"description": "Selector to select which namespaces the Endpoints objects are discovered from.",
"properties": {
"any": {
"description": "Boolean describing whether all namespaces are selected in contrast to a list restricting them.",
"type": "boolean"
},
"matchNames": {
"description": "List of namespace names.",
"items": {
"type": "string"
},
"type": "array"
}
},
"type": "object",
"additionalProperties": false
},
"podTargetLabels": {
"description": "PodTargetLabels transfers labels on the Kubernetes Pod onto the target.",
"items": {
"type": "string"
},
"type": "array"
},
"sampleLimit": {
"description": "SampleLimit defines per-scrape limit on number of scraped samples that will be accepted.",
"format": "int64",
"type": "integer"
},
"selector": {
"description": "Selector to select Endpoints objects.",
"properties": {
"matchExpressions": {
"description": "matchExpressions is a list of label selector requirements. The requirements are ANDed.",
"items": {
"description": "A label selector requirement is a selector that contains values, a key, and an operator that relates the key and values.",
"properties": {
"key": {
"description": "key is the label key that the selector applies to.",
"type": "string"
},
"operator": {
"description": "operator represents a key's relationship to a set of values. Valid operators are In, NotIn, Exists and DoesNotExist.",
"type": "string"
},
"values": {
"description": "values is an array of string values. If the operator is In or NotIn, the values array must be non-empty. If the operator is Exists or DoesNotExist, the values array must be empty. This array is replaced during a strategic merge patch.",
"items": {
"type": "string"
},
"type": "array"
}
},
"required": [
"key",
"operator"
],
"type": "object",
"additionalProperties": false
},
"type": "array"
},
"matchLabels": {
"additionalProperties": {
"type": "string"
},
"description": "matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels map is equivalent to an element of matchExpressions, whose key field is \"key\", the operator is \"In\", and the values array contains only \"value\". The requirements are ANDed.",
"type": "object"
}
},
"type": "object",
"additionalProperties": false
},
"targetLabels": {
"description": "TargetLabels transfers labels on the Kubernetes Service onto the target.",
"items": {
"type": "string"
},
"type": "array"
},
"targetLimit": {
"description": "TargetLimit defines a limit on the number of scraped targets that will be accepted.",
"format": "int64",
"type": "integer"
}
},
"required": [
"endpoints",
"selector"
],
"type": "object",
"additionalProperties": false
}
},
"required": [
"spec"
],
"type": "object"
}

38
.github/workflows/ci.yml vendored Normal file
View File

@ -0,0 +1,38 @@
name: CI
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
workflow_dispatch:
jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: 1.17
- name: Vendor
run: make vendor
- name: Vendor Diff
run: git diff --exit-code
- name: Format
run: make --always-make fmt lint
- name: Format Diff
run: git diff --exit-code
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: 1.17
- name: Generate
run: make --always-make vendor generate validate
- name: Generate Diff
run: git diff --exit-code

1
.gitignore vendored
View File

@ -1,3 +1,4 @@
tmp
vendor/
jsonnet/kube-thanos/jsonnetfile.lock.json
.idea/

View File

@ -7,26 +7,200 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
NOTE: As semantic versioning states all 0.y.z releases can contain breaking changes.
> kube-thanos' major versions are in sync with upstream Thos project.
> kube-thanos' major and minor versions are in sync with upstream Thanos project.
We use *breaking* word for marking changes that are not backward compatible (relates only to v0.y.z releases.)
## Unreleased
### Breaking Changes
### Changed
- [#279](https://github.com/thanos-io/kube-thanos/pull/279) Change `hashringConfigmapName` to `hashringConfigMapName` in Receive configuration.
- [#284](https://github.com/thanos-io/kube-thanos/pull/284) Change Receive `PodDisruptionBudget` api version to `policy/v1`
- [#293](https://github.com/thanos-io/kube-thanos/pull/293) Upgrade to Thanos v0.30.2
### Added
- [#263](https://github.com/thanos-io/kube-thanos/pull/263) Add support for stateless Rulers.
- [#271](https://github.com/thanos-io/kube-thanos/pull/271) Add annotation support for ServiceAccount.
- [#286](https://github.com/thanos-io/kube-thanos/pull/286) Store: make the liveness probe timeout configurable.
- [#292](https://github.com/thanos-io/kube-thanos/pull/292) Store: allow configuration of series, series sample, and downloaded bytes limits.
- [#299](https://github.com/thanos-io/kube-thanos/pull/299) Query: allow configuration of telemetry.request options
- [#301](https://github.com/thanos-io/kube-thanos/pull/301) Receive: allow configuration of `minReadySeconds` for StatefulSet
- [#305](https://github.com/thanos-io/kube-thanos/pull/305) Receive: allow configuration of limits-config-file
- [#308](https://github.com/thanos-io/kube-thanos/pull/308) Recive: add store limits flags
- [#310](https://github.com/thanos-io/kube-thanos/pull/310) Ruler: Add host anti-affinity to ruler
- [#313](https://github.com/thanos-io/kube-thanos/pull/313) Add per-container SecurityContext
- [#330](https://github.com/thanos-io/kube-thanos/pull/330) Query: Add query url support to jsonnet library
### Fixed
- [#298](https://github.com/thanos-io/kube-thanos/pull/298) Use `kubernetes.io/os` instead of `beta.kubernetes.io/os` which has been deprecated since Kubernetes v1.14.
## [v0.27.0](https://github.com/thanos-io/kube-thanos/tree/v0.27.0) (2022-07-07)
- (no changes from `v0.26.0`)
## [v0.26.0](https://github.com/thanos-io/kube-thanos/tree/v0.26.0) (2022-06-13)
### Added
- [#263](https://github.com/thanos-io/kube-thanos/pull/263) Add support for stateless Rulers.
## [v0.24.0](https://github.com/thanos-io/kube-thanos/tree/v0.24.0) (2021-12-17)
### Changed
- [#254](https://github.com/thanos-io/kube-thanos/pull/254) Add support for tenant header configuration to receiver.
- [#247](https://github.com/thanos-io/kube-thanos/pull/247) Make Compact service headless.
### Added
- [#265](https://github.com/thanos-io/kube-thanos/pull/265) Added support for multithreaded thanos compact.
- [#237](https://github.com/thanos-io/kube-thanos/pull/237) Add new bucket replicate component.
- [#245](https://github.com/thanos-io/kube-thanos/pull/245) Support scraping config reloader sidecar for ruler.
- [#251](https://github.com/thanos-io/kube-thanos/pull/251) Add support for extraEnv (custom environment variables) to all components.
- [#260](https://github.com/thanos-io/kube-thanos/pull/260) Add support custom certificate for the object store by configuring `tlsSecretName` and `tlsSecretMountPath` in `objectStorageConfig`.
- [#261](https://github.com/thanos-io/kube-thanos/pull/261) Add support for imagePullPolicy to all components.
[Full Changelog](https://github.com/thanos-io/kube-thanos/compare/v0.22.0...v0.24.0)
## [v0.22.0](https://github.com/thanos-io/kube-thanos/tree/v0.22.0) (2021-08-17)
### Added
- [#232](https://github.com/thanos-io/kube-thanos/pull/232) Support compactor hash sharding.
[Full Changelog](https://github.com/thanos-io/kube-thanos/compare/v0.21.0...v0.22.0)
## [v0.21.0](https://github.com/thanos-io/kube-thanos/tree/v0.21.0) (2021-08-17)
### Changed
- [#226](https://github.com/thanos-io/kube-thanos/pull/226) Only schedule thanos components on linux nodes.
### Added
- [#244](https://github.com/thanos-io/kube-thanos/pull/244) Add functions to implement Thanos Receive split functionality.
- [#228](https://github.com/thanos-io/kube-thanos/pull/228) Allow configuring `--web.prefix-header` of query.
[Full Changelog](https://github.com/thanos-io/kube-thanos/compare/v0.20.0...v0.21.0)
## [v0.20.0](https://github.com/thanos-io/kube-thanos/tree/v0.20.0) (2021-04-28)
[Full Changelog](https://github.com/thanos-io/kube-thanos/compare/v0.19.0...v0.20.0)
## [v0.19.0](https://github.com/thanos-io/kube-thanos/tree/v0.19.0) (2020-04-19)
### Breaking Changes
- [#196](https://github.com/thanos-io/kube-thanos/pull/196) Single ServiceAccount for all hashrings, causing hashrings position in the object tree to change.
### Changed
- [#196](https://github.com/thanos-io/kube-thanos/pull/196) Single ServiceAccount for each component.
- [#200](https://github.com/thanos-io/kube-thanos/pull/200) [#202](https://github.com/thanos-io/kube-thanos/pull/200) Run all components as non-root.
- [#208](https://github.com/thanos-io/kube-thanos/pull/208) Documentation: Refer to `main` branch in docs
### Added
- [#192](https://github.com/thanos-io/kube-thanos/pull/192) sidecar: Add pod discovery
- [#194](https://github.com/thanos-io/kube-thanos/pull/194) Allow configuring --label and --receive.tenant-label-name flags.
- [#209](https://github.com/thanos-io/kube-thanos/pull/209) Allow configuring --label and --refresh flags of bucket web.
- [#213](https://github.com/thanos-io/kube-thanos/pull/213) Allow configuring `--min-time` and `--max-time` of store.
- [#218](https://github.com/thanos-io/kube-thanos/pull/218) Enable `--query.auto-downsampling` for query by default.
- [#221](https://github.com/thanos-io/kube-thanos/pull/221) Allow configuring `--tsdb.retention` and `--tsdb.block-duration` for rule.
- [#225](https://github.com/thanos-io/kube-thanos/pull/225) Add support for alertmanager configuration and extra volumes for rule.
[Full Changelog](https://github.com/thanos-io/kube-thanos/compare/v0.18.0...v0.19.0)
## [v0.18.0](https://github.com/thanos-io/kube-thanos/tree/v0.18.0) (2020-04-19)
### Breaking Changes
- [#188](https://github.com/thanos-io/kube-thanos/pull/188) Single ServiceMonitor for store shards
### Fixed
- [#185](https://github.com/thanos-io/kube-thanos/pull/185) query-frontend, store: make cache types case insensitive
[Full Changelog](https://github.com/thanos-io/kube-thanos/compare/v0.17.0...v0.18.0)
## [v0.17.0](https://github.com/thanos-io/kube-thanos/tree/v0.17.0) (2020-12-08)
### Added
- [#166](https://github.com/thanos-io/kube-thanos/pull/166) Add new flags and memcached support to query frontend
- [#169](https://github.com/thanos-io/kube-thanos/pull/169) Add --tracing.config support to all components
- [#170](https://github.com/thanos-io/kube-thanos/pull/170) Add Store shard and Receive hashring helpers
- [#173](https://github.com/thanos-io/kube-thanos/pull/173) Store, query, frontend: add log.format flag
- [#178](https://github.com/thanos-io/kube-thanos/pull/178) compact, rule, tools: add log format flag
### Fixed
- [#176](https://github.com/thanos-io/kube-thanos/pull/176) store: fix error when bucket cache not used
[Full Changelog](https://github.com/thanos-io/kube-thanos/compare/v0.16.0...v0.17.0)
## [v0.16.0](https://github.com/thanos-io/kube-thanos/tree/v0.16.0) (2020-11-04)
### Changed
- [#164](https://github.com/thanos-io/kube-thanos/pull/164) Expose components via functions with params merged with defaults
- #152 #153 #154 #155 #156 #157 #158 #159 Rewrite all components to not use ksonnet anymore (mostly internal change)
### Added
- [#148](https://github.com/thanos-io/kube-thanos/pull/148) Support for configuring Alertmanager on Thanos Ruler
### Fixed
- [#150](https://github.com/thanos-io/kube-thanos/pull/150) Update query frontend flag name
[Full Changelog](https://github.com/thanos-io/kube-thanos/compare/v0.15.0...v0.16.0)
## [v0.15.0](https://github.com/thanos-io/kube-thanos/tree/v0.15.0) (2020-09-07)
### Added
- [#142](https://github.com/thanos-io/kube-thanos/pull/142) query-frontend: Add thanos query frontend component.
- [#145](https://github.com/thanos-io/kube-thanos/pull/145) querier: Add a new mixin to specify `--query.lookback-delta` flag.
[Full Changelog](https://github.com/thanos-io/kube-thanos/compare/v0.14.0...v0.15.0)
## [v0.14.0](https://github.com/thanos-io/kube-thanos/tree/v0.14.0) (2020-07-10)
Compatible with https://github.com/thanos-io/thanos/releases/tag/v0.14.0
### Changed
- [#135](https://github.com/thanos-io/kube-thanos/pull/135) *: Relabel pod reference into instance label
- [#134](https://github.com/thanos-io/kube-thanos/pull/131) receive: Only perform anti affinity against receive pods
[Full Changelog](https://github.com/thanos-io/kube-thanos/compare/v0.13.0...v0.14.0)
## [v0.13.0](https://github.com/thanos-io/kube-thanos/tree/v0.13.0) (2020-06-22)
Compatible with https://github.com/thanos-io/thanos/releases/tag/v0.13.0
### Changed
- [#118](https://github.com/thanos-io/kube-thanos/pull/118) receive: Extend shutdown grace period to 900s (15min).
- [#122](https://github.com/thanos-io/kube-thanos/pull/122) store: Rename `withMemcachedIndexCache` to `withIndexCacheMemcached`
- [#131](https://github.com/thanos-io/kube-thanos/pull/131) bucket: Update bucket web to tools bucket web
### Added
- [#105](https://github.com/thanos-io/kube-thanos/pull/105) compactor, store: Add deduplication replica label flags and delete delay labels
- [#105](https://github.com/thanos-io/kube-thanos/pull/105) compactor, store: Add deduplication replica label flags and delete delay labels
- [#119](https://github.com/thanos-io/kube-thanos/pull/119) receive: Distribute receive instances across node zones via pod anti affinity (note: only available on Kubernetes 1.17+)
- [#122](https://github.com/thanos-io/kube-thanos/pull/122) store: Rename `withMemcachedIndexCache` to `withIndexCacheMemcached`
- [#122](https://github.com/thanos-io/kube-thanos/pull/122) store: Enable caching bucket support
- [#128](https://github.com/thanos-io/kube-thanos/pull/128) query: Allow configuring query timeout
@ -35,11 +209,23 @@ We use *breaking* word for marking changes that are not backward compatible (rel
### Fixed
-
- [#116](https://github.com/thanos-io/kube-thanos/pull/116) rule: No quotation marks on alert.label-drop
[Full Changelog](https://github.com/thanos-io/kube-thanos/compare/master...v0.11.0)
[Full Changelog](https://github.com/thanos-io/kube-thanos/compare/v0.12.0...v0.13.0)
## [v0.11.0](https://github.com/thanos-io/kube-thanos/tree/v0.11.0) (2020-02-11)
## [v0.12.0](https://github.com/thanos-io/kube-thanos/tree/v0.12.0) (2020-04-16)
Compatible with https://github.com/thanos-io/thanos/releases/tag/v0.12.0
### Added
- [#105](https://github.com/thanos-io/kube-thanos/pull/105) compactor, store: Add deduplication replica label flags and delete delay labels
- [#106](https://github.com/thanos-io/kube-thanos/pull/106) store: Add memcached mixin
[Full Changelog](https://github.com/thanos-io/kube-thanos/compare/v0.11.0...v0.12.0)
## [v0.11.0](https://github.com/thanos-io/kube-thanos/tree/v0.11.0) (2020-04-08)
Compatible with https://github.com/thanos-io/thanos/releases/tag/v0.11.0

103
Makefile
View File

@ -1,32 +1,22 @@
SHELL=/usr/bin/env bash -o pipefail
BIN_DIR ?= $(shell pwd)/tmp/bin
include .bingo/Variables.mk
EMBEDMD ?= $(BIN_DIR)/embedmd
GOJSONTOYAML ?= $(BIN_DIR)/gojsontoyaml
JSONNET ?= $(BIN_DIR)/jsonnet
JSONNET_BUNDLER ?= $(BIN_DIR)/jb
JSONNET_FMT ?= $(BIN_DIR)/jsonnetfmt
FIRST_GOPATH := $(firstword $(subst :, ,$(shell go env GOPATH)))
JSONNET_SRC = $(shell find . -name 'vendor' -prune -o -name 'jsonnet/vendor' -prune -o -name 'tmp' -prune -o -name '*.libsonnet' -print -o -name '*.jsonnet' -print)
JSONNET_FMT_CMD := $(JSONNET_FMT) -n 2 --max-blank-lines 2 --string-style s --comment-style s
CONTAINER_CMD:=docker run --rm \
-u="$(shell id -u):$(shell id -g)" \
-v "$(shell go env GOCACHE):/.cache/go-build" \
-v "$(PWD):/go/src/github.com/thanos-io/kube-thanos:Z" \
-w "/go/src/github.com/thanos-io/kube-thanos" \
-e USER=deadbeef \
-e GO111MODULE=on \
quay.io/coreos/jsonnet-ci
JSONNETFMT_CMD := $(JSONNETFMT) -n 2 --max-blank-lines 2 --string-style s --comment-style s
EXAMPLES := examples
MANIFESTS := manifests
CRDSCHEMAS := .crdschemas
TMP := tmp
all: generate fmt
K8S_VERSION := 1.27.0
PROM_OPERATOR_VERSION := 0.46.0
.PHONY: generate-in-docker
generate-in-docker:
@echo ">> Compiling assets and generating Kubernetes manifests"
$(CONTAINER_CMD) make $(MFLAGS) generate
PIP := pip3
CRDS := \
https://raw.githubusercontent.com/prometheus-operator/prometheus-operator/v$(PROM_OPERATOR_VERSION)/jsonnet/prometheus-operator/servicemonitor-crd.libsonnet \
all: fmt generate validate
.PHONY: generate
generate: vendor ${MANIFESTS} **.md
@ -35,42 +25,59 @@ generate: vendor ${MANIFESTS} **.md
$(EMBEDMD) -w `find . -name "*.md" | grep -v vendor`
.PHONY: ${MANIFESTS}
${MANIFESTS}: $(JSONNET) $(GOJSONTOYAML) vendor example.jsonnet build.sh
${MANIFESTS}: $(JSONNET) $(GOJSONTOYAML) vendor example.jsonnet all.jsonnet build.sh
@rm -rf ${MANIFESTS}
@mkdir -p ${MANIFESTS}
PATH=$$PATH:$$(pwd)/$(BIN_DIR) ./build.sh
JSONNET=$(JSONNET) GOJSONTOYAML=$(GOJSONTOYAML) ./build.sh
.PHONY: fmt
fmt: $(JSONNET_FMT)
PATH=$$PATH:$$(pwd)/$(BIN_DIR) echo ${JSONNET_SRC} | xargs -n 1 -- $(JSONNET_FMT_CMD) -i
fmt: $(JSONNETFMT)
echo ${JSONNET_SRC} | xargs -n 1 -- $(JSONNETFMT_CMD) -i
vendor: | $(JSONNET_BUNDLER) jsonnetfile.json jsonnetfile.lock.json
$(JSONNET_BUNDLER) install
.PHONY: lint
lint: $(JSONNET_LINT) vendor
echo ${JSONNET_SRC} | xargs -n 1 -- $(JSONNET_LINT) -J vendor
.PHONY: vendor
vendor: | $(JB) jsonnetfile.json jsonnetfile.lock.json
$(JB) install
.PHONY: deploy
deploy:
kubectl create ns thanos
kubectl create ns minio
kubectl apply -f https://raw.githubusercontent.com/prometheus-operator/prometheus-operator/v$(PROM_OPERATOR_VERSION)/example/prometheus-operator-crd/monitoring.coreos.com_servicemonitors.yaml
kubectl create -f examples/development-minio/
kubectl create -f manifests/
.PHONY: teardown
teardown:
kubectl delete -f examples/development-minio/
kubectl delete -f manifests/
kubectl delete ns thanos
kubectl delete ns minio
.PHONY: clean
clean:
-rm -rf tmp/bin
rm -rf manifests/
$(BIN_DIR):
mkdir -p $(BIN_DIR)
${TMP}/bin/openapi2jsonschema.py:
@$(PIP) show pyyaml >/dev/null
@mkdir -p $(TMP)
@curl -sSfo $@ https://raw.githubusercontent.com/yannh/kubeconform/v0.4.4/scripts/openapi2jsonschema.py
@chmod +x $@
$(EMBEDMD): $(BIN_DIR)
go get -d github.com/campoy/embedmd
go build -o $@ github.com/campoy/embedmd
${CRDSCHEMAS}: $(TMP)/bin/openapi2jsonschema.py
@rm -rf $@
@mkdir -p $@
@cd $@ && for crd in $(CRDS); do \
FILENAME_FORMAT='{kind}-{group}-{version}' $(CURDIR)/$(TMP)/bin/openapi2jsonschema.py "$${crd}"; \
done
$(GOJSONTOYAML): $(BIN_DIR)
go get -d github.com/brancz/gojsontoyaml
go build -o $@ github.com/brancz/gojsontoyaml
$(JSONNET): $(BIN_DIR)
go get -d github.com/google/go-jsonnet/cmd/jsonnet
go build -o $@ github.com/google/go-jsonnet/cmd/jsonnet
$(JSONNET_FMT): $(BIN_DIR)
go get -d github.com/google/go-jsonnet/cmd/jsonnetfmt
go build -o $@ github.com/google/go-jsonnet/cmd/jsonnetfmt
$(JSONNET_BUNDLER): $(BIN_DIR)
curl -L -o $(JSONNET_BUNDLER) "https://github.com/jsonnet-bundler/jsonnet-bundler/releases/download/v0.3.1/jb-$(shell go env GOOS)-$(shell go env GOARCH)"
chmod +x $(JSONNET_BUNDLER)
.PHONY: validate
validate: $(KUBECONFORM) $(MANIFESTS) $(EXAMPLES)/all/manifests
$(KUBECONFORM) -strict -kubernetes-version $(K8S_VERSION) -output tap \
-schema-location 'https://raw.githubusercontent.com/yannh/kubernetes-json-schema/master' \
-schema-location '$(CRDSCHEMAS)/{{ .ResourceKind }}{{ .KindSuffix }}.json' \
$(MANIFESTS) $(EXAMPLES)/all/manifests

123
README.md
View File

@ -23,12 +23,12 @@ This project is intended to be used as a library (i.e. the intent is not for you
Though for a quickstart a compiled version of the Kubernetes [manifests](manifests) generated with this library (specifically with `example.jsonnet`) is checked into this repository in order to try the content out quickly. To try out the stack un-customized run:
* Simply create the stack:
```shell
$ kubectl create -f manifests/
$ make deploy
```
* And to teardown the stack:
```shell
$ kubectl delete -f manifests/
$ make teardown
```
## Customizing kube-thanos
@ -46,12 +46,12 @@ Install this library in your own project with [jsonnet-bundler](https://github.c
$ mkdir my-kube-thanos; cd my-kube-thanos
$ jb init # Creates the initial/empty `jsonnetfile.json`
# Install the kube-thanos dependency
$ jb install github.com/thanos-io/kube-thanos/jsonnet/kube-thanos@master # Creates `vendor/` & `jsonnetfile.lock.json`, and fills in `jsonnetfile.json`
$ jb install github.com/thanos-io/kube-thanos/jsonnet/kube-thanos@main # Creates `vendor/` & `jsonnetfile.lock.json`, and fills in `jsonnetfile.json`
```
> `jb` can be installed with `go get github.com/jsonnet-bundler/jsonnet-bundler/cmd/jb`
> An e.g. of how to install a given version of this library: `jb install github.com/thanos-io/kube-thanos/jsonnet/kube-thanos@master`
> An e.g. of how to install a given version of this library: `jb install github.com/thanos-io/kube-thanos/jsonnet/kube-thanos@main`
In order to update the kube-thanos dependency, simply use the jsonnet-bundler update functionality:
```shell
@ -68,21 +68,22 @@ Here's [example.jsonnet](example.jsonnet):
[embedmd]:# (example.jsonnet)
```jsonnet
local k = import 'ksonnet/ksonnet.beta.4/k.libsonnet';
local sts = k.apps.v1.statefulSet;
local deployment = k.apps.v1.deployment;
local t = (import 'kube-thanos/thanos.libsonnet');
local t = import 'kube-thanos/thanos.libsonnet';
// For an example with every option and component, please check all.jsonnet
local commonConfig = {
config+:: {
local cfg = self,
namespace: 'thanos',
version: 'v0.13.0-rc.0',
version: 'v0.31.0',
image: 'quay.io/thanos/thanos:' + cfg.version,
imagePullPolicy: 'IfNotPresent',
objectStorageConfig: {
name: 'thanos-objectstorage',
key: 'thanos.yaml',
},
hashringConfigMapName: 'hashring-config',
volumeClaimTemplate: {
spec: {
accessModes: ['ReadWriteOnce'],
@ -96,66 +97,46 @@ local commonConfig = {
},
};
//local b = t.bucket + commonConfig + {
// config+:: {
// name: 'thanos-bucket',
// replicas: 1,
// },
//};
//
//local c = t.compact + t.compact.withVolumeClaimTemplate + t.compact.withServiceMonitor + commonConfig + {
// config+:: {
// name: 'thanos-compact',
// replicas: 1,
// },
//};
//
//local re = t.receive + t.receive.withVolumeClaimTemplate + t.receive.withServiceMonitor + commonConfig + {
// config+:: {
// name: 'thanos-receive',
// replicas: 1,
// replicationFactor: 1,
// },
//};
//
//local ru = t.rule + t.rule.withVolumeClaimTemplate + t.rule.withServiceMonitor + commonConfig + {
// config+:: {
// name: 'thanos-rule',
// replicas: 1,
// },
//};
local i = t.receiveIngestor(commonConfig.config {
replicas: 1,
replicaLabels: ['receive_replica'],
replicationFactor: 1,
// Disable shipping to object storage for the purposes of this example
objectStorageConfig: null,
serviceMonitor: true,
});
local s = t.store + t.store.withVolumeClaimTemplate + t.store.withServiceMonitor + commonConfig + {
config+:: {
name: 'thanos-store',
replicas: 1,
},
};
local r = t.receiveRouter(commonConfig.config {
replicas: 1,
replicaLabels: ['receive_replica'],
replicationFactor: 1,
// Disable shipping to object storage for the purposes of this example
objectStorageConfig: null,
endpoints: i.endpoints,
});
local q = t.query + t.query.withServiceMonitor + commonConfig + {
config+:: {
name: 'thanos-query',
replicas: 1,
stores: [
'dnssrv+_grpc._tcp.%s.%s.svc.cluster.local' % [service.metadata.name, service.metadata.namespace]
for service in [s.service]
],
replicaLabels: ['prometheus_replica', 'rule_replica'],
},
};
local s = t.store(commonConfig.config {
replicas: 1,
serviceMonitor: true,
});
//local finalRu = ru {
// config+:: {
// queriers: ['dnssrv+_http._tcp.%s.%s.svc.cluster.local' % [q.service.metadata.name, q.service.metadata.namespace]],
// },
//};
local q = t.query(commonConfig.config {
replicas: 1,
replicaLabels: ['prometheus_replica', 'rule_replica'],
serviceMonitor: true,
stores: [s.storeEndpoint] + i.storeEndpoints,
});
//{ ['thanos-bucket-' + name]: b[name] for name in std.objectFields(b) } +
//{ ['thanos-compact-' + name]: c[name] for name in std.objectFields(c) } +
//{ ['thanos-receive-' + name]: re[name] for name in std.objectFields(re) } +
//{ ['thanos-rule-' + name]: finalRu[name] for name in std.objectFields(finalRu) } +
{ ['thanos-store-' + name]: s[name] for name in std.objectFields(s) } +
{ ['thanos-query-' + name]: q[name] for name in std.objectFields(q) }
{ ['thanos-query-' + name]: q[name] for name in std.objectFields(q) } +
{ ['thanos-receive-router-' + resource]: r[resource] for resource in std.objectFields(r) } +
{ ['thanos-receive-ingestor-' + resource]: i[resource] for resource in std.objectFields(i) if resource != 'ingestors' } +
{
['thanos-receive-ingestor-' + hashring + '-' + resource]: i.ingestors[hashring][resource]
for hashring in std.objectFields(i.ingestors)
for resource in std.objectFields(i.ingestors[hashring])
if i.ingestors[hashring][resource] != null
}
```
And here's the [build.sh](build.sh) script (which uses `vendor/` to render all manifests in a json structure of `{filename: manifest-content}`):
@ -171,19 +152,29 @@ set -x
# only exit with zero if all commands of the pipeline exit successfully
set -o pipefail
JSONNET=${JSONNET:-jsonnet}
GOJSONTOYAML=${GOJSONTOYAML:-gojsontoyaml}
# Make sure to start with a clean 'manifests' dir
rm -rf manifests
mkdir manifests
# optional, but we would like to generate yaml, not json
jsonnet -J vendor -m manifests "${1-example.jsonnet}" | xargs -I{} sh -c 'cat {} | gojsontoyaml > {}.yaml; rm -f {}' -- {}
${JSONNET} -J vendor -m manifests "${1-example.jsonnet}" | xargs -I{} sh -c "cat {} | ${GOJSONTOYAML} > {}.yaml; rm -f {}" -- {}
find manifests -type f ! -name '*.yaml' -delete
# The following script generates all components, mostly used for testing
rm -rf examples/all/manifests
rm -rf examples/development-minio
mkdir examples/all/manifests
mkdir examples/development-minio
jsonnet -J vendor -m examples/all/manifests "${1-all.jsonnet}" | xargs -I{} sh -c 'cat {} | gojsontoyaml > {}.yaml; rm -f {}' -- {}
${JSONNET} -J vendor -m examples/all/manifests "${1-all.jsonnet}" | xargs -I{} sh -c "cat {} | ${GOJSONTOYAML} > {}.yaml; rm -f {}" -- {}
find examples/all/manifests -type f ! -name '*.yaml' -delete
${JSONNET} -J vendor -m examples/development-minio "${1-minio.jsonnet}" | xargs -I{} sh -c "cat {} | ${GOJSONTOYAML} > {}.yaml; rm -f {}" -- {}
find examples/development-minio -type f ! -name '*.yaml' -delete
```
> Note you need `jsonnet` (`go get github.com/google/go-jsonnet/cmd/jsonnet`) and `gojsontoyaml` (`go get github.com/brancz/gojsontoyaml`) installed to run `build.sh`. If you just want json output, not yaml, then you can skip the pipe and everything afterwards.

View File

@ -1,131 +1,268 @@
local k = import 'ksonnet/ksonnet.beta.4/k.libsonnet';
local sts = k.apps.v1.statefulSet;
local deployment = k.apps.v1.deployment;
local t = (import 'kube-thanos/thanos.libsonnet');
local t = import 'kube-thanos/thanos.libsonnet';
// THIS IS MERELY AN EXAMPLE MEANT TO SHOW HOW TO USE ALL COMPONENTS!
// Neither this example nor its manifests in examples/all/manifests/ are meant to ever be run.
local commonConfig = {
config+:: {
local cfg = self,
namespace: 'thanos',
version: 'master-2020-05-24-079ad427', // v0.13.0-rc.1 candiate
image: 'quay.io/thanos/thanos:' + cfg.version,
objectStorageConfig: {
name: 'thanos-objectstorage',
key: 'thanos.yaml',
},
volumeClaimTemplate: {
spec: {
accessModes: ['ReadWriteOnce'],
resources: {
requests: {
storage: '10Gi',
},
local cfg = self,
namespace: 'thanos',
version: 'v0.30.2',
image: 'quay.io/thanos/thanos:' + cfg.version,
replicaLabels: ['prometheus_replica', 'rule_replica'],
objectStorageConfig: {
name: 'thanos-objectstorage',
key: 'thanos.yaml',
tlsSecretName: '',
tlsSecretMountPath: '',
},
resources: {
requests: { cpu: 0.123, memory: '123Mi' },
limits: { cpu: 0.420, memory: '420Mi' },
},
volumeClaimTemplate: {
spec: {
accessModes: ['ReadWriteOnce'],
resources: {
requests: {
storage: '10Gi',
},
},
},
},
};
local b =
t.bucket +
commonConfig + {
config+:: {
name: 'thanos-bucket',
replicas: 1,
// This enables jaeger tracing for all components, as commonConfig is shared
tracing+: {
type: 'JAEGER',
config+: {
sampler_type: 'ratelimiting',
sampler_param: 2,
},
};
local c =
t.compact +
t.compact.withVolumeClaimTemplate +
t.compact.withServiceMonitor +
commonConfig + {
config+:: {
name: 'thanos-compact',
replicas: 1,
},
};
local re =
t.receive +
t.receive.withVolumeClaimTemplate +
t.receive.withServiceMonitor +
commonConfig + {
config+:: {
name: 'thanos-receive',
replicas: 1,
replicationFactor: 1,
},
};
local ru =
t.rule +
t.rule.withVolumeClaimTemplate +
t.rule.withServiceMonitor +
commonConfig + {
config+:: {
name: 'thanos-rule',
replicas: 1,
},
};
local s =
t.store +
t.store.withVolumeClaimTemplate +
t.store.withServiceMonitor +
commonConfig + {
config+:: {
name: 'thanos-store',
replicas: 1,
},
};
local swm =
t.store +
t.store.withVolumeClaimTemplate +
t.store.withServiceMonitor +
t.store.withIndexCacheMemcached +
t.store.withCachingBucketMemcached +
commonConfig + {
config+:: {
name: 'thanos-store',
replicas: 1,
memcached+: {
// NOTICE: <MEMCACHED_SERCIVE> is a placeholder to generate examples.
// List of memcached addresses, that will get resolved with the DNS service discovery provider.
// For DNS service discovery reference https://thanos.io/service-discovery.md/#dns-service-discovery
addresses: ['dnssrv+_client._tcp.<MEMCACHED_SERCIVE>.%s.svc.cluster.local' % commonConfig.config.namespace],
},
},
};
local q =
t.query +
t.query.withServiceMonitor +
t.query.withQueryTimeout +
commonConfig + {
config+:: {
name: 'thanos-query',
replicas: 1,
stores: [
'dnssrv+_grpc._tcp.%s.%s.svc.cluster.local' % [service.metadata.name, service.metadata.namespace]
for service in [re.service, ru.service, s.service]
],
replicaLabels: ['prometheus_replica', 'rule_replica'],
queryTimeout: '5m',
},
};
local finalRu = ru {
config+:: {
queriers: ['dnssrv+_http._tcp.%s.%s.svc.cluster.local' % [q.service.metadata.name, q.service.metadata.namespace]],
},
};
{ ['thanos-bucket-' + name]: b[name] for name in std.objectFields(b) } +
{ ['thanos-compact-' + name]: c[name] for name in std.objectFields(c) } +
{ ['thanos-receive-' + name]: re[name] for name in std.objectFields(re) } +
{ ['thanos-rule-' + name]: finalRu[name] for name in std.objectFields(finalRu) } +
{ ['thanos-store-' + name]: s[name] for name in std.objectFields(s) } +
{ ['thanos-query-' + name]: q[name] for name in std.objectFields(q) } +
{ 'thanos-store-statefulSet-with-memcached': swm.statefulSet }
local b = t.bucket(commonConfig {
replicas: 1,
label: 'cluster_name',
refresh: '5m',
// Example on how to overwrite the tracing config on a per component basis
// tracing+: {
// config+: {
// service_name: 'awesome-thanos-bucket',
// },
// },
});
local br = t.bucketReplicate(commonConfig {
replicas: 1,
// Use the same object storage secret as an example.
// Need to use another one in real cases.
objectStorageToConfig: {
name: 'thanos-objectstorage',
key: 'thanos.yaml',
},
compactionLevels: [1, 2, 3],
resolutions: ['0s'],
});
local c = t.compact(commonConfig {
replicas: 1,
serviceMonitor: true,
disableDownsampling: true,
deduplicationReplicaLabels: super.replicaLabels, // reuse same labels for deduplication
});
local cs = t.compactShards(commonConfig {
shards: 3,
sourceLabels: ['cluster'],
replicas: 1,
serviceMonitor: true,
disableDownsampling: true,
});
local re = t.receive(commonConfig {
replicas: 1,
replicationFactor: 1,
serviceMonitor: true,
hashringConfigMapName: 'hashring',
});
local ru = t.rule(commonConfig {
replicas: 1,
rulesConfig: [{ name: 'test', key: 'test' }],
alertmanagersURLs: ['alertmanager:9093'],
alertmanagerConfigFile: {
name: 'thanos-ruler-config',
key: 'config.yaml',
},
remoteWriteConfigFile: {
name: 'thanos-stateless-ruler-config',
key: 'rw-config.yaml',
},
reloaderImage: 'jimmidyson/configmap-reload:v0.5.0',
serviceMonitor: true,
});
local sc = t.sidecar(commonConfig {
// namespace: 'monitoring',
serviceMonitor: true,
// Labels of the Prometheus pods with a Thanos Sidecar container
podLabelSelector: {
// Here it is the default label given by the prometheus-operator
// to all Prometheus pods
app: 'prometheus',
},
});
local s = t.store(commonConfig {
replicas: 1,
serviceMonitor: true,
bucketCache: {
type: 'memcached',
config+: {
// NOTICE: <MEMCACHED_SERVICE> is a placeholder to generate examples.
// List of memcached addresses, that will get resolved with the DNS service discovery provider.
// For DNS service discovery reference https://thanos.io/tip/thanos/service-discovery.md/#dns-service-discovery
addresses: ['dnssrv+_client._tcp.<MEMCACHED_SERVICE>.%s.svc.cluster.local' % commonConfig.namespace],
},
},
indexCache: {
type: 'memcached',
config+: {
// NOTICE: <MEMCACHED_SERVICE> is a placeholder to generate examples.
// List of memcached addresses, that will get resolved with the DNS service discovery provider.
// For DNS service discovery reference https://thanos.io/tip/thanos/service-discovery.md/#dns-service-discovery
addresses: ['dnssrv+_client._tcp.<MEMCACHED_SERVICE>.%s.svc.cluster.local' % commonConfig.namespace],
},
},
});
local q = t.query(commonConfig {
name: 'thanos-query',
replicas: 1,
externalPrefix: '',
resources: {},
queryTimeout: '5m',
autoDownsampling: true,
lookbackDelta: '15m',
ports: {
grpc: 10901,
http: 9090,
},
serviceMonitor: true,
logLevel: 'debug',
});
local finalRu = t.rule(ru.config {
queriers: ['dnssrv+_http._tcp.%s.%s.svc.cluster.local' % [q.service.metadata.name, q.service.metadata.namespace]],
});
local qf = t.queryFrontend(commonConfig {
replicas: 1,
downstreamURL: 'http://%s.%s.svc.cluster.local.:%d' % [
q.service.metadata.name,
q.service.metadata.namespace,
q.service.spec.ports[1].port,
],
splitInterval: '12h',
maxRetries: 10,
logQueriesLongerThan: '10s',
serviceMonitor: true,
queryRangeCache: {
type: 'memcached',
config+: {
// NOTICE: <MEMCACHED_SERVICE> is a placeholder to generate examples.
// List of memcached addresses, that will get resolved with the DNS service discovery provider.
// For DNS service discovery reference https://thanos.io/tip/thanos/service-discovery.md/#dns-service-discovery
addresses: ['dnssrv+_client._tcp.<MEMCACHED_SERVICE>.%s.svc.cluster.local' % commonConfig.namespace],
},
},
labelsCache: {
type: 'memcached',
config+: {
// NOTICE: <MEMCACHED_SERVICE> is a placeholder to generate examples.
// List of memcached addresses, that will get resolved with the DNS service discovery provider.
// For DNS service discovery reference https://thanos.io/tip/thanos/service-discovery.md/#dns-service-discovery
addresses: ['dnssrv+_client._tcp.<MEMCACHED_SERVICE>.%s.svc.cluster.local' % commonConfig.namespace],
},
},
});
local rcvs = t.receiveHashrings(commonConfig {
hashrings: [
{
hashring: 'default',
tenants: [],
},
{
hashring: 'region-1',
tenants: [],
},
],
replicas: 3,
replicationFactor: 2,
serviceMonitor: true,
hashringConfigMapName: 'hashring',
});
local strs = t.storeShards(commonConfig {
shards: 3,
replicas: 1,
serviceMonitor: true,
bucketCache: {
type: 'memcached',
config+: {
// NOTICE: <MEMCACHED_SERVICE> is a placeholder to generate examples.
// List of memcached addresses, that will get resolved with the DNS service discovery provider.
// For DNS service discovery reference https://thanos.io/tip/thanos/service-discovery.md/#dns-service-discovery
addresses: ['dnssrv+_client._tcp.<MEMCACHED_SERVICE>.%s.svc.cluster.local' % commonConfig.namespace],
},
},
indexCache: {
type: 'memcached',
config+: {
// NOTICE: <MEMCACHED_SERVICE> is a placeholder to generate examples.
// List of memcached addresses, that will get resolved with the DNS service discovery provider.
// For DNS service discovery reference https://thanos.io/tip/thanos/service-discovery.md/#dns-service-discovery
addresses: ['dnssrv+_client._tcp.<MEMCACHED_SERVICE>.%s.svc.cluster.local' % commonConfig.namespace],
},
},
});
local finalQ = t.query(q.config {
stores: [
'dnssrv+_grpc._tcp.%s.%s.svc.cluster.local' % [service.metadata.name, service.metadata.namespace]
for service in [re.service, ru.service, sc.service, s.service] +
[rcvs.hashrings[hashring].service for hashring in std.objectFields(rcvs.hashrings)] +
[strs.shards[shard].service for shard in std.objectFields(strs.shards)]
],
});
{ ['thanos-bucket-' + name]: b[name] for name in std.objectFields(b) if b[name] != null } +
{ ['thanos-bucket-replicate-' + name]: br[name] for name in std.objectFields(br) if br[name] != null } +
{ ['thanos-compact-' + name]: c[name] for name in std.objectFields(c) if c[name] != null } +
{
['thanos-compact-' + shard + '-' + name]: cs.shards[shard][name]
for shard in std.objectFields(cs.shards)
for name in std.objectFields(cs.shards[shard])
if cs.shards[shard][name] != null
} +
{ ['thanos-receive-' + name]: re[name] for name in std.objectFields(re) if re[name] != null } +
{ ['thanos-rule-' + name]: finalRu[name] for name in std.objectFields(finalRu) if finalRu[name] != null } +
{ ['thanos-sidecar-' + name]: sc[name] for name in std.objectFields(sc) if sc[name] != null } +
{ ['thanos-store-' + name]: s[name] for name in std.objectFields(s) if s[name] != null } +
{ ['thanos-query-' + name]: finalQ[name] for name in std.objectFields(finalQ) if finalQ[name] != null } +
{ ['thanos-query-frontend-' + name]: qf[name] for name in std.objectFields(qf) if qf[name] != null } +
{
['thanos-receive-' + hashring + '-' + name]: rcvs.hashrings[hashring][name]
for hashring in std.objectFields(rcvs.hashrings)
for name in std.objectFields(rcvs.hashrings[hashring])
if rcvs.hashrings[hashring][name] != null
} +
{
['thanos-store-' + shard + '-' + name]: strs.shards[shard][name]
for shard in std.objectFields(strs.shards)
for name in std.objectFields(strs.shards[shard])
if strs.shards[shard][name] != null
} +
{ ['thanos-compact-shards-' + name]: cs[name] for name in std.objectFields(cs) if name != 'shards' && cs[name] != null } +
{ ['thanos-receive-hashrings-' + name]: rcvs[name] for name in std.objectFields(rcvs) if name != 'hashrings' && rcvs[name] != null } +
{ ['thanos-store-shards-' + name]: strs[name] for name in std.objectFields(strs) if name != 'shards' && strs[name] != null }

View File

@ -7,16 +7,26 @@ set -x
# only exit with zero if all commands of the pipeline exit successfully
set -o pipefail
JSONNET=${JSONNET:-jsonnet}
GOJSONTOYAML=${GOJSONTOYAML:-gojsontoyaml}
# Make sure to start with a clean 'manifests' dir
rm -rf manifests
mkdir manifests
# optional, but we would like to generate yaml, not json
jsonnet -J vendor -m manifests "${1-example.jsonnet}" | xargs -I{} sh -c 'cat {} | gojsontoyaml > {}.yaml; rm -f {}' -- {}
${JSONNET} -J vendor -m manifests "${1-example.jsonnet}" | xargs -I{} sh -c "cat {} | ${GOJSONTOYAML} > {}.yaml; rm -f {}" -- {}
find manifests -type f ! -name '*.yaml' -delete
# The following script generates all components, mostly used for testing
rm -rf examples/all/manifests
rm -rf examples/development-minio
mkdir examples/all/manifests
mkdir examples/development-minio
jsonnet -J vendor -m examples/all/manifests "${1-all.jsonnet}" | xargs -I{} sh -c 'cat {} | gojsontoyaml > {}.yaml; rm -f {}' -- {}
${JSONNET} -J vendor -m examples/all/manifests "${1-all.jsonnet}" | xargs -I{} sh -c "cat {} | ${GOJSONTOYAML} > {}.yaml; rm -f {}" -- {}
find examples/all/manifests -type f ! -name '*.yaml' -delete
${JSONNET} -J vendor -m examples/development-minio "${1-minio.jsonnet}" | xargs -I{} sh -c "cat {} | ${GOJSONTOYAML} > {}.yaml; rm -f {}" -- {}
find examples/development-minio -type f ! -name '*.yaml' -delete

View File

@ -1,18 +1,19 @@
local k = import 'ksonnet/ksonnet.beta.4/k.libsonnet';
local sts = k.apps.v1.statefulSet;
local deployment = k.apps.v1.deployment;
local t = (import 'kube-thanos/thanos.libsonnet');
local t = import 'kube-thanos/thanos.libsonnet';
// For an example with every option and component, please check all.jsonnet
local commonConfig = {
config+:: {
local cfg = self,
namespace: 'thanos',
version: 'v0.13.0-rc.0',
version: 'v0.31.0',
image: 'quay.io/thanos/thanos:' + cfg.version,
imagePullPolicy: 'IfNotPresent',
objectStorageConfig: {
name: 'thanos-objectstorage',
key: 'thanos.yaml',
},
hashringConfigMapName: 'hashring-config',
volumeClaimTemplate: {
spec: {
accessModes: ['ReadWriteOnce'],
@ -26,63 +27,43 @@ local commonConfig = {
},
};
//local b = t.bucket + commonConfig + {
// config+:: {
// name: 'thanos-bucket',
// replicas: 1,
// },
//};
//
//local c = t.compact + t.compact.withVolumeClaimTemplate + t.compact.withServiceMonitor + commonConfig + {
// config+:: {
// name: 'thanos-compact',
// replicas: 1,
// },
//};
//
//local re = t.receive + t.receive.withVolumeClaimTemplate + t.receive.withServiceMonitor + commonConfig + {
// config+:: {
// name: 'thanos-receive',
// replicas: 1,
// replicationFactor: 1,
// },
//};
//
//local ru = t.rule + t.rule.withVolumeClaimTemplate + t.rule.withServiceMonitor + commonConfig + {
// config+:: {
// name: 'thanos-rule',
// replicas: 1,
// },
//};
local i = t.receiveIngestor(commonConfig.config {
replicas: 1,
replicaLabels: ['receive_replica'],
replicationFactor: 1,
// Disable shipping to object storage for the purposes of this example
objectStorageConfig: null,
serviceMonitor: true,
});
local s = t.store + t.store.withVolumeClaimTemplate + t.store.withServiceMonitor + commonConfig + {
config+:: {
name: 'thanos-store',
replicas: 1,
},
};
local r = t.receiveRouter(commonConfig.config {
replicas: 1,
replicaLabels: ['receive_replica'],
replicationFactor: 1,
// Disable shipping to object storage for the purposes of this example
objectStorageConfig: null,
endpoints: i.endpoints,
});
local q = t.query + t.query.withServiceMonitor + commonConfig + {
config+:: {
name: 'thanos-query',
replicas: 1,
stores: [
'dnssrv+_grpc._tcp.%s.%s.svc.cluster.local' % [service.metadata.name, service.metadata.namespace]
for service in [s.service]
],
replicaLabels: ['prometheus_replica', 'rule_replica'],
},
};
local s = t.store(commonConfig.config {
replicas: 1,
serviceMonitor: true,
});
//local finalRu = ru {
// config+:: {
// queriers: ['dnssrv+_http._tcp.%s.%s.svc.cluster.local' % [q.service.metadata.name, q.service.metadata.namespace]],
// },
//};
local q = t.query(commonConfig.config {
replicas: 1,
replicaLabels: ['prometheus_replica', 'rule_replica'],
serviceMonitor: true,
stores: [s.storeEndpoint] + i.storeEndpoints,
});
//{ ['thanos-bucket-' + name]: b[name] for name in std.objectFields(b) } +
//{ ['thanos-compact-' + name]: c[name] for name in std.objectFields(c) } +
//{ ['thanos-receive-' + name]: re[name] for name in std.objectFields(re) } +
//{ ['thanos-rule-' + name]: finalRu[name] for name in std.objectFields(finalRu) } +
{ ['thanos-store-' + name]: s[name] for name in std.objectFields(s) } +
{ ['thanos-query-' + name]: q[name] for name in std.objectFields(q) }
{ ['thanos-query-' + name]: q[name] for name in std.objectFields(q) } +
{ ['thanos-receive-router-' + resource]: r[resource] for resource in std.objectFields(r) } +
{ ['thanos-receive-ingestor-' + resource]: i[resource] for resource in std.objectFields(i) if resource != 'ingestors' } +
{
['thanos-receive-ingestor-' + hashring + '-' + resource]: i.ingestors[hashring][resource]
for hashring in std.objectFields(i.ingestors)
for resource in std.objectFields(i.ingestors[hashring])
if i.ingestors[hashring][resource] != null
}

View File

@ -5,7 +5,7 @@ metadata:
app.kubernetes.io/component: object-store-bucket-debugging
app.kubernetes.io/instance: thanos-bucket
app.kubernetes.io/name: thanos-bucket
app.kubernetes.io/version: master-2020-05-24-079ad427
app.kubernetes.io/version: v0.30.2
name: thanos-bucket
namespace: thanos
spec:
@ -21,21 +21,36 @@ spec:
app.kubernetes.io/component: object-store-bucket-debugging
app.kubernetes.io/instance: thanos-bucket
app.kubernetes.io/name: thanos-bucket
app.kubernetes.io/version: master-2020-05-24-079ad427
app.kubernetes.io/version: v0.30.2
spec:
containers:
- args:
- tools
- bucket
- web
- --log.level=info
- --log.format=logfmt
- --objstore.config=$(OBJSTORE_CONFIG)
- |-
--tracing.config="config":
"sampler_param": 2
"sampler_type": "ratelimiting"
"service_name": "thanos-bucket"
"type": "JAEGER"
- --label=cluster_name
- --refresh=5m
env:
- name: OBJSTORE_CONFIG
valueFrom:
secretKeyRef:
key: thanos.yaml
name: thanos-objectstorage
image: quay.io/thanos/thanos:master-2020-05-24-079ad427
- name: HOST_IP_ADDRESS
valueFrom:
fieldRef:
fieldPath: status.hostIP
image: quay.io/thanos/thanos:v0.30.2
imagePullPolicy: IfNotPresent
livenessProbe:
failureThreshold: 4
httpGet:
@ -54,5 +69,35 @@ spec:
port: 10902
scheme: HTTP
periodSeconds: 5
resources:
limits:
cpu: 0.42
memory: 420Mi
requests:
cpu: 0.123
memory: 123Mi
securityContext:
allowPrivilegeEscalation: false
capabilities:
drop:
- ALL
readOnlyRootFilesystem: true
runAsGroup: 65532
runAsNonRoot: true
runAsUser: 65534
seccompProfile:
type: RuntimeDefault
terminationMessagePolicy: FallbackToLogsOnError
volumeMounts: []
nodeSelector:
kubernetes.io/os: linux
securityContext:
fsGroup: 65534
runAsGroup: 65532
runAsNonRoot: true
runAsUser: 65534
seccompProfile:
type: RuntimeDefault
serviceAccountName: thanos-bucket
terminationGracePeriodSeconds: 120
volumes: []

View File

@ -0,0 +1,100 @@
apiVersion: apps/v1
kind: Deployment
metadata:
labels:
app.kubernetes.io/component: object-store-bucket-replicate
app.kubernetes.io/instance: thanos-bucket-replicate
app.kubernetes.io/name: thanos-bucket-replicate
app.kubernetes.io/version: v0.30.2
name: thanos-bucket-replicate
namespace: thanos
spec:
replicas: 1
selector:
matchLabels:
app.kubernetes.io/component: object-store-bucket-replicate
app.kubernetes.io/instance: thanos-bucket-replicate
app.kubernetes.io/name: thanos-bucket-replicate
template:
metadata:
labels:
app.kubernetes.io/component: object-store-bucket-replicate
app.kubernetes.io/instance: thanos-bucket-replicate
app.kubernetes.io/name: thanos-bucket-replicate
app.kubernetes.io/version: v0.30.2
spec:
containers:
- args:
- tools
- bucket
- replicate
- --log.level=info
- --log.format=logfmt
- --objstore.config=$(OBJSTORE_CONFIG)
- --objstore-to.config=$(OBJSTORE_TO_CONFIG)
- |-
--tracing.config="config":
"sampler_param": 2
"sampler_type": "ratelimiting"
"service_name": "thanos-bucket-replicate"
"type": "JAEGER"
- --compaction=1
- --compaction=2
- --compaction=3
- --resolution=0s
env:
- name: OBJSTORE_CONFIG
valueFrom:
secretKeyRef:
key: thanos.yaml
name: thanos-objectstorage
- name: OBJSTORE_TO_CONFIG
valueFrom:
secretKeyRef:
key: thanos.yaml
name: thanos-objectstorage
- name: HOST_IP_ADDRESS
valueFrom:
fieldRef:
fieldPath: status.hostIP
image: quay.io/thanos/thanos:v0.30.2
imagePullPolicy: IfNotPresent
livenessProbe:
failureThreshold: 4
httpGet:
path: /-/healthy
port: 10902
scheme: HTTP
periodSeconds: 30
name: thanos-bucket-replicate
ports:
- containerPort: 10902
name: http
readinessProbe:
failureThreshold: 20
httpGet:
path: /-/ready
port: 10902
scheme: HTTP
periodSeconds: 5
resources:
limits:
cpu: 0.42
memory: 420Mi
requests:
cpu: 0.123
memory: 123Mi
terminationMessagePolicy: FallbackToLogsOnError
volumeMounts: []
nodeSelector:
kubernetes.io/os: linux
securityContext:
fsGroup: 65534
runAsGroup: 65532
runAsNonRoot: true
runAsUser: 65534
seccompProfile:
type: RuntimeDefault
serviceAccountName: thanos-bucket-replicate
terminationGracePeriodSeconds: 120
volumes: []

View File

@ -0,0 +1,19 @@
apiVersion: v1
kind: Service
metadata:
labels:
app.kubernetes.io/component: object-store-bucket-replicate
app.kubernetes.io/instance: thanos-bucket-replicate
app.kubernetes.io/name: thanos-bucket-replicate
app.kubernetes.io/version: v0.30.2
name: thanos-bucket-replicate
namespace: thanos
spec:
ports:
- name: http
port: 10902
targetPort: 10902
selector:
app.kubernetes.io/component: object-store-bucket-replicate
app.kubernetes.io/instance: thanos-bucket-replicate
app.kubernetes.io/name: thanos-bucket-replicate

View File

@ -0,0 +1,11 @@
apiVersion: v1
kind: ServiceAccount
metadata:
annotations: {}
labels:
app.kubernetes.io/component: object-store-bucket-replicate
app.kubernetes.io/instance: thanos-bucket-replicate
app.kubernetes.io/name: thanos-bucket-replicate
app.kubernetes.io/version: v0.30.2
name: thanos-bucket-replicate
namespace: thanos

View File

@ -5,14 +5,14 @@ metadata:
app.kubernetes.io/component: object-store-bucket-debugging
app.kubernetes.io/instance: thanos-bucket
app.kubernetes.io/name: thanos-bucket
app.kubernetes.io/version: master-2020-05-24-079ad427
app.kubernetes.io/version: v0.30.2
name: thanos-bucket
namespace: thanos
spec:
ports:
- name: http
port: 10902
targetPort: http
targetPort: 10902
selector:
app.kubernetes.io/component: object-store-bucket-debugging
app.kubernetes.io/instance: thanos-bucket

View File

@ -0,0 +1,11 @@
apiVersion: v1
kind: ServiceAccount
metadata:
annotations: {}
labels:
app.kubernetes.io/component: object-store-bucket-debugging
app.kubernetes.io/instance: thanos-bucket
app.kubernetes.io/name: thanos-bucket
app.kubernetes.io/version: v0.30.2
name: thanos-bucket
namespace: thanos

View File

@ -5,14 +5,15 @@ metadata:
app.kubernetes.io/component: database-compactor
app.kubernetes.io/instance: thanos-compact
app.kubernetes.io/name: thanos-compact
app.kubernetes.io/version: master-2020-05-24-079ad427
app.kubernetes.io/version: v0.30.2
name: thanos-compact
namespace: thanos
spec:
clusterIP: None
ports:
- name: http
port: 10902
targetPort: http
targetPort: 10902
selector:
app.kubernetes.io/component: database-compactor
app.kubernetes.io/instance: thanos-compact

View File

@ -0,0 +1,11 @@
apiVersion: v1
kind: ServiceAccount
metadata:
annotations: {}
labels:
app.kubernetes.io/component: database-compactor
app.kubernetes.io/instance: thanos-compact
app.kubernetes.io/name: thanos-compact
app.kubernetes.io/version: v0.30.2
name: thanos-compact
namespace: thanos

View File

@ -5,12 +5,19 @@ metadata:
app.kubernetes.io/component: database-compactor
app.kubernetes.io/instance: thanos-compact
app.kubernetes.io/name: thanos-compact
app.kubernetes.io/version: master-2020-05-24-079ad427
app.kubernetes.io/version: v0.30.2
name: thanos-compact
namespace: thanos
spec:
endpoints:
- port: http
relabelings:
- action: replace
separator: /
sourceLabels:
- namespace
- pod
targetLabel: instance
selector:
matchLabels:
app.kubernetes.io/component: database-compactor

View File

@ -0,0 +1,22 @@
apiVersion: v1
kind: Service
metadata:
labels:
app.kubernetes.io/component: database-compactor
app.kubernetes.io/instance: thanos-compact-0
app.kubernetes.io/name: thanos-compact
app.kubernetes.io/version: v0.30.2
compact.thanos.io/shard: shard-0
name: thanos-compact-0
namespace: thanos
spec:
clusterIP: None
ports:
- name: http
port: 10902
targetPort: 10902
selector:
app.kubernetes.io/component: database-compactor
app.kubernetes.io/instance: thanos-compact-0
app.kubernetes.io/name: thanos-compact
compact.thanos.io/shard: shard-0

View File

@ -0,0 +1,146 @@
apiVersion: apps/v1
kind: StatefulSet
metadata:
labels:
app.kubernetes.io/component: database-compactor
app.kubernetes.io/instance: thanos-compact-0
app.kubernetes.io/name: thanos-compact
app.kubernetes.io/version: v0.30.2
compact.thanos.io/shard: shard-0
name: thanos-compact-0
namespace: thanos
spec:
replicas: 1
selector:
matchLabels:
app.kubernetes.io/component: database-compactor
app.kubernetes.io/instance: thanos-compact-0
app.kubernetes.io/name: thanos-compact
compact.thanos.io/shard: shard-0
serviceName: thanos-compact-0
template:
metadata:
labels:
app.kubernetes.io/component: database-compactor
app.kubernetes.io/instance: thanos-compact-0
app.kubernetes.io/name: thanos-compact
app.kubernetes.io/version: v0.30.2
compact.thanos.io/shard: shard-0
spec:
affinity:
podAntiAffinity:
preferredDuringSchedulingIgnoredDuringExecution:
- podAffinityTerm:
labelSelector:
matchExpressions:
- key: app.kubernetes.io/name
operator: In
values:
- thanos-compact
- key: app.kubernetes.io/instance
operator: In
values:
- thanos-compact-0
namespaces:
- thanos
topologyKey: kubernetes.io/hostname
weight: 100
containers:
- args:
- compact
- --wait
- --log.level=info
- --log.format=logfmt
- --objstore.config=$(OBJSTORE_CONFIG)
- --data-dir=/var/thanos/compact
- --debug.accept-malformed-index
- --retention.resolution-raw=0d
- --retention.resolution-5m=0d
- --retention.resolution-1h=0d
- --delete-delay=48h
- --compact.concurrency=1
- --downsample.concurrency=1
- --downsampling.disable
- |-
--tracing.config="config":
"sampler_param": 2
"sampler_type": "ratelimiting"
"service_name": "thanos-compact"
"type": "JAEGER"
- |
--selector.relabel-config=
- action: hashmod
source_labels: ["cluster"]
target_label: shard
modulus: 3
- action: keep
source_labels: ["shard"]
regex: 0
env:
- name: OBJSTORE_CONFIG
valueFrom:
secretKeyRef:
key: thanos.yaml
name: thanos-objectstorage
- name: HOST_IP_ADDRESS
valueFrom:
fieldRef:
fieldPath: status.hostIP
image: quay.io/thanos/thanos:v0.30.2
imagePullPolicy: IfNotPresent
livenessProbe:
failureThreshold: 4
httpGet:
path: /-/healthy
port: 10902
scheme: HTTP
periodSeconds: 30
name: thanos-compact
ports:
- containerPort: 10902
name: http
readinessProbe:
failureThreshold: 20
httpGet:
path: /-/ready
port: 10902
scheme: HTTP
periodSeconds: 5
resources:
limits:
cpu: 0.42
memory: 420Mi
requests:
cpu: 0.123
memory: 123Mi
terminationMessagePolicy: FallbackToLogsOnError
volumeMounts:
- mountPath: /var/thanos/compact
name: data
readOnly: false
nodeSelector:
kubernetes.io/os: linux
securityContext:
fsGroup: 65534
runAsGroup: 65532
runAsNonRoot: true
runAsUser: 65534
seccompProfile:
type: RuntimeDefault
serviceAccountName: thanos-compact
terminationGracePeriodSeconds: 120
volumes: []
volumeClaimTemplates:
- metadata:
labels:
app.kubernetes.io/component: database-compactor
app.kubernetes.io/instance: thanos-compact-0
app.kubernetes.io/name: thanos-compact
compact.thanos.io/shard: shard-0
name: data
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 10Gi

View File

@ -0,0 +1,22 @@
apiVersion: v1
kind: Service
metadata:
labels:
app.kubernetes.io/component: database-compactor
app.kubernetes.io/instance: thanos-compact-1
app.kubernetes.io/name: thanos-compact
app.kubernetes.io/version: v0.30.2
compact.thanos.io/shard: shard-1
name: thanos-compact-1
namespace: thanos
spec:
clusterIP: None
ports:
- name: http
port: 10902
targetPort: 10902
selector:
app.kubernetes.io/component: database-compactor
app.kubernetes.io/instance: thanos-compact-1
app.kubernetes.io/name: thanos-compact
compact.thanos.io/shard: shard-1

View File

@ -0,0 +1,146 @@
apiVersion: apps/v1
kind: StatefulSet
metadata:
labels:
app.kubernetes.io/component: database-compactor
app.kubernetes.io/instance: thanos-compact-1
app.kubernetes.io/name: thanos-compact
app.kubernetes.io/version: v0.30.2
compact.thanos.io/shard: shard-1
name: thanos-compact-1
namespace: thanos
spec:
replicas: 1
selector:
matchLabels:
app.kubernetes.io/component: database-compactor
app.kubernetes.io/instance: thanos-compact-1
app.kubernetes.io/name: thanos-compact
compact.thanos.io/shard: shard-1
serviceName: thanos-compact-1
template:
metadata:
labels:
app.kubernetes.io/component: database-compactor
app.kubernetes.io/instance: thanos-compact-1
app.kubernetes.io/name: thanos-compact
app.kubernetes.io/version: v0.30.2
compact.thanos.io/shard: shard-1
spec:
affinity:
podAntiAffinity:
preferredDuringSchedulingIgnoredDuringExecution:
- podAffinityTerm:
labelSelector:
matchExpressions:
- key: app.kubernetes.io/name
operator: In
values:
- thanos-compact
- key: app.kubernetes.io/instance
operator: In
values:
- thanos-compact-1
namespaces:
- thanos
topologyKey: kubernetes.io/hostname
weight: 100
containers:
- args:
- compact
- --wait
- --log.level=info
- --log.format=logfmt
- --objstore.config=$(OBJSTORE_CONFIG)
- --data-dir=/var/thanos/compact
- --debug.accept-malformed-index
- --retention.resolution-raw=0d
- --retention.resolution-5m=0d
- --retention.resolution-1h=0d
- --delete-delay=48h
- --compact.concurrency=1
- --downsample.concurrency=1
- --downsampling.disable
- |-
--tracing.config="config":
"sampler_param": 2
"sampler_type": "ratelimiting"
"service_name": "thanos-compact"
"type": "JAEGER"
- |
--selector.relabel-config=
- action: hashmod
source_labels: ["cluster"]
target_label: shard
modulus: 3
- action: keep
source_labels: ["shard"]
regex: 1
env:
- name: OBJSTORE_CONFIG
valueFrom:
secretKeyRef:
key: thanos.yaml
name: thanos-objectstorage
- name: HOST_IP_ADDRESS
valueFrom:
fieldRef:
fieldPath: status.hostIP
image: quay.io/thanos/thanos:v0.30.2
imagePullPolicy: IfNotPresent
livenessProbe:
failureThreshold: 4
httpGet:
path: /-/healthy
port: 10902
scheme: HTTP
periodSeconds: 30
name: thanos-compact
ports:
- containerPort: 10902
name: http
readinessProbe:
failureThreshold: 20
httpGet:
path: /-/ready
port: 10902
scheme: HTTP
periodSeconds: 5
resources:
limits:
cpu: 0.42
memory: 420Mi
requests:
cpu: 0.123
memory: 123Mi
terminationMessagePolicy: FallbackToLogsOnError
volumeMounts:
- mountPath: /var/thanos/compact
name: data
readOnly: false
nodeSelector:
kubernetes.io/os: linux
securityContext:
fsGroup: 65534
runAsGroup: 65532
runAsNonRoot: true
runAsUser: 65534
seccompProfile:
type: RuntimeDefault
serviceAccountName: thanos-compact
terminationGracePeriodSeconds: 120
volumes: []
volumeClaimTemplates:
- metadata:
labels:
app.kubernetes.io/component: database-compactor
app.kubernetes.io/instance: thanos-compact-1
app.kubernetes.io/name: thanos-compact
compact.thanos.io/shard: shard-1
name: data
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 10Gi

View File

@ -0,0 +1,22 @@
apiVersion: v1
kind: Service
metadata:
labels:
app.kubernetes.io/component: database-compactor
app.kubernetes.io/instance: thanos-compact-2
app.kubernetes.io/name: thanos-compact
app.kubernetes.io/version: v0.30.2
compact.thanos.io/shard: shard-2
name: thanos-compact-2
namespace: thanos
spec:
clusterIP: None
ports:
- name: http
port: 10902
targetPort: 10902
selector:
app.kubernetes.io/component: database-compactor
app.kubernetes.io/instance: thanos-compact-2
app.kubernetes.io/name: thanos-compact
compact.thanos.io/shard: shard-2

View File

@ -0,0 +1,146 @@
apiVersion: apps/v1
kind: StatefulSet
metadata:
labels:
app.kubernetes.io/component: database-compactor
app.kubernetes.io/instance: thanos-compact-2
app.kubernetes.io/name: thanos-compact
app.kubernetes.io/version: v0.30.2
compact.thanos.io/shard: shard-2
name: thanos-compact-2
namespace: thanos
spec:
replicas: 1
selector:
matchLabels:
app.kubernetes.io/component: database-compactor
app.kubernetes.io/instance: thanos-compact-2
app.kubernetes.io/name: thanos-compact
compact.thanos.io/shard: shard-2
serviceName: thanos-compact-2
template:
metadata:
labels:
app.kubernetes.io/component: database-compactor
app.kubernetes.io/instance: thanos-compact-2
app.kubernetes.io/name: thanos-compact
app.kubernetes.io/version: v0.30.2
compact.thanos.io/shard: shard-2
spec:
affinity:
podAntiAffinity:
preferredDuringSchedulingIgnoredDuringExecution:
- podAffinityTerm:
labelSelector:
matchExpressions:
- key: app.kubernetes.io/name
operator: In
values:
- thanos-compact
- key: app.kubernetes.io/instance
operator: In
values:
- thanos-compact-2
namespaces:
- thanos
topologyKey: kubernetes.io/hostname
weight: 100
containers:
- args:
- compact
- --wait
- --log.level=info
- --log.format=logfmt
- --objstore.config=$(OBJSTORE_CONFIG)
- --data-dir=/var/thanos/compact
- --debug.accept-malformed-index
- --retention.resolution-raw=0d
- --retention.resolution-5m=0d
- --retention.resolution-1h=0d
- --delete-delay=48h
- --compact.concurrency=1
- --downsample.concurrency=1
- --downsampling.disable
- |-
--tracing.config="config":
"sampler_param": 2
"sampler_type": "ratelimiting"
"service_name": "thanos-compact"
"type": "JAEGER"
- |
--selector.relabel-config=
- action: hashmod
source_labels: ["cluster"]
target_label: shard
modulus: 3
- action: keep
source_labels: ["shard"]
regex: 2
env:
- name: OBJSTORE_CONFIG
valueFrom:
secretKeyRef:
key: thanos.yaml
name: thanos-objectstorage
- name: HOST_IP_ADDRESS
valueFrom:
fieldRef:
fieldPath: status.hostIP
image: quay.io/thanos/thanos:v0.30.2
imagePullPolicy: IfNotPresent
livenessProbe:
failureThreshold: 4
httpGet:
path: /-/healthy
port: 10902
scheme: HTTP
periodSeconds: 30
name: thanos-compact
ports:
- containerPort: 10902
name: http
readinessProbe:
failureThreshold: 20
httpGet:
path: /-/ready
port: 10902
scheme: HTTP
periodSeconds: 5
resources:
limits:
cpu: 0.42
memory: 420Mi
requests:
cpu: 0.123
memory: 123Mi
terminationMessagePolicy: FallbackToLogsOnError
volumeMounts:
- mountPath: /var/thanos/compact
name: data
readOnly: false
nodeSelector:
kubernetes.io/os: linux
securityContext:
fsGroup: 65534
runAsGroup: 65532
runAsNonRoot: true
runAsUser: 65534
seccompProfile:
type: RuntimeDefault
serviceAccountName: thanos-compact
terminationGracePeriodSeconds: 120
volumes: []
volumeClaimTemplates:
- metadata:
labels:
app.kubernetes.io/component: database-compactor
app.kubernetes.io/instance: thanos-compact-2
app.kubernetes.io/name: thanos-compact
compact.thanos.io/shard: shard-2
name: data
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 10Gi

View File

@ -0,0 +1,11 @@
apiVersion: v1
kind: ServiceAccount
metadata:
annotations: {}
labels:
app.kubernetes.io/component: database-compactor
app.kubernetes.io/instance: thanos-compact
app.kubernetes.io/name: thanos-compact
app.kubernetes.io/version: v0.30.2
name: thanos-compact
namespace: thanos

View File

@ -0,0 +1,30 @@
apiVersion: monitoring.coreos.com/v1
kind: ServiceMonitor
metadata:
labels:
app.kubernetes.io/component: database-compactor
app.kubernetes.io/instance: thanos-compact
app.kubernetes.io/name: thanos-compact
app.kubernetes.io/version: v0.30.2
name: thanos-compact
namespace: thanos
spec:
endpoints:
- port: http
relabelings:
- action: replace
separator: /
sourceLabels:
- namespace
- pod
targetLabel: instance
- action: replace
regex: shard\-(\d+)
replacement: $1
sourceLabels:
- __meta_kubernetes_service_label_compact_thanos_io_shard
targetLabel: shard
selector:
matchLabels:
app.kubernetes.io/component: database-compactor
app.kubernetes.io/name: thanos-compact

View File

@ -5,7 +5,7 @@ metadata:
app.kubernetes.io/component: database-compactor
app.kubernetes.io/instance: thanos-compact
app.kubernetes.io/name: thanos-compact
app.kubernetes.io/version: master-2020-05-24-079ad427
app.kubernetes.io/version: v0.30.2
name: thanos-compact
namespace: thanos
spec:
@ -22,22 +22,62 @@ spec:
app.kubernetes.io/component: database-compactor
app.kubernetes.io/instance: thanos-compact
app.kubernetes.io/name: thanos-compact
app.kubernetes.io/version: master-2020-05-24-079ad427
app.kubernetes.io/version: v0.30.2
spec:
affinity:
podAntiAffinity:
preferredDuringSchedulingIgnoredDuringExecution:
- podAffinityTerm:
labelSelector:
matchExpressions:
- key: app.kubernetes.io/name
operator: In
values:
- thanos-compact
- key: app.kubernetes.io/instance
operator: In
values:
- thanos-compact
namespaces:
- thanos
topologyKey: kubernetes.io/hostname
weight: 100
containers:
- args:
- compact
- --wait
- --log.level=info
- --log.format=logfmt
- --objstore.config=$(OBJSTORE_CONFIG)
- --data-dir=/var/thanos/compact
- --debug.accept-malformed-index
- --retention.resolution-raw=0d
- --retention.resolution-5m=0d
- --retention.resolution-1h=0d
- --delete-delay=48h
- --compact.concurrency=1
- --downsample.concurrency=1
- --downsampling.disable
- --deduplication.replica-label=prometheus_replica
- --deduplication.replica-label=rule_replica
- |-
--tracing.config="config":
"sampler_param": 2
"sampler_type": "ratelimiting"
"service_name": "thanos-compact"
"type": "JAEGER"
env:
- name: OBJSTORE_CONFIG
valueFrom:
secretKeyRef:
key: thanos.yaml
name: thanos-objectstorage
image: quay.io/thanos/thanos:master-2020-05-24-079ad427
- name: HOST_IP_ADDRESS
valueFrom:
fieldRef:
fieldPath: status.hostIP
image: quay.io/thanos/thanos:v0.30.2
imagePullPolicy: IfNotPresent
livenessProbe:
failureThreshold: 4
httpGet:
@ -56,11 +96,28 @@ spec:
port: 10902
scheme: HTTP
periodSeconds: 5
resources:
limits:
cpu: 0.42
memory: 420Mi
requests:
cpu: 0.123
memory: 123Mi
terminationMessagePolicy: FallbackToLogsOnError
volumeMounts:
- mountPath: /var/thanos/compact
name: data
readOnly: false
nodeSelector:
kubernetes.io/os: linux
securityContext:
fsGroup: 65534
runAsGroup: 65532
runAsNonRoot: true
runAsUser: 65534
seccompProfile:
type: RuntimeDefault
serviceAccountName: thanos-compact
terminationGracePeriodSeconds: 120
volumes: []
volumeClaimTemplates:

View File

@ -5,7 +5,7 @@ metadata:
app.kubernetes.io/component: query-layer
app.kubernetes.io/instance: thanos-query
app.kubernetes.io/name: thanos-query
app.kubernetes.io/version: master-2020-05-24-079ad427
app.kubernetes.io/version: v0.30.2
name: thanos-query
namespace: thanos
spec:
@ -21,7 +21,7 @@ spec:
app.kubernetes.io/component: query-layer
app.kubernetes.io/instance: thanos-query
app.kubernetes.io/name: thanos-query
app.kubernetes.io/version: master-2020-05-24-079ad427
app.kubernetes.io/version: v0.30.2
spec:
affinity:
podAntiAffinity:
@ -42,13 +42,35 @@ spec:
- query
- --grpc-address=0.0.0.0:10901
- --http-address=0.0.0.0:9090
- --log.level=debug
- --log.format=logfmt
- --query.replica-label=prometheus_replica
- --query.replica-label=rule_replica
- --store=dnssrv+_grpc._tcp.thanos-receive.thanos.svc.cluster.local
- --store=dnssrv+_grpc._tcp.thanos-rule.thanos.svc.cluster.local
- --store=dnssrv+_grpc._tcp.thanos-store.thanos.svc.cluster.local
- --endpoint=dnssrv+_grpc._tcp.thanos-receive.thanos.svc.cluster.local
- --endpoint=dnssrv+_grpc._tcp.thanos-rule.thanos.svc.cluster.local
- --endpoint=dnssrv+_grpc._tcp.thanos-sidecar.thanos.svc.cluster.local
- --endpoint=dnssrv+_grpc._tcp.thanos-store.thanos.svc.cluster.local
- --endpoint=dnssrv+_grpc._tcp.thanos-receive-default.thanos.svc.cluster.local
- --endpoint=dnssrv+_grpc._tcp.thanos-receive-region-1.thanos.svc.cluster.local
- --endpoint=dnssrv+_grpc._tcp.thanos-store-0.thanos.svc.cluster.local
- --endpoint=dnssrv+_grpc._tcp.thanos-store-1.thanos.svc.cluster.local
- --endpoint=dnssrv+_grpc._tcp.thanos-store-2.thanos.svc.cluster.local
- --query.timeout=5m
image: quay.io/thanos/thanos:master-2020-05-24-079ad427
- --query.lookback-delta=15m
- |-
--tracing.config="config":
"sampler_param": 2
"sampler_type": "ratelimiting"
"service_name": "thanos-query"
"type": "JAEGER"
- --query.auto-downsampling
env:
- name: HOST_IP_ADDRESS
valueFrom:
fieldRef:
fieldPath: status.hostIP
image: quay.io/thanos/thanos:v0.30.2
imagePullPolicy: IfNotPresent
livenessProbe:
failureThreshold: 4
httpGet:
@ -69,5 +91,27 @@ spec:
port: 9090
scheme: HTTP
periodSeconds: 5
resources: {}
securityContext:
allowPrivilegeEscalation: false
capabilities:
drop:
- ALL
readOnlyRootFilesystem: true
runAsGroup: 65532
runAsNonRoot: true
runAsUser: 65534
seccompProfile:
type: RuntimeDefault
terminationMessagePolicy: FallbackToLogsOnError
nodeSelector:
kubernetes.io/os: linux
securityContext:
fsGroup: 65534
runAsGroup: 65532
runAsNonRoot: true
runAsUser: 65534
seccompProfile:
type: RuntimeDefault
serviceAccountName: thanos-query
terminationGracePeriodSeconds: 120

View File

@ -0,0 +1,137 @@
apiVersion: apps/v1
kind: Deployment
metadata:
labels:
app.kubernetes.io/component: query-cache
app.kubernetes.io/instance: thanos-query-frontend
app.kubernetes.io/name: thanos-query-frontend
app.kubernetes.io/version: v0.30.2
name: thanos-query-frontend
namespace: thanos
spec:
replicas: 1
selector:
matchLabels:
app.kubernetes.io/component: query-cache
app.kubernetes.io/instance: thanos-query-frontend
app.kubernetes.io/name: thanos-query-frontend
template:
metadata:
labels:
app.kubernetes.io/component: query-cache
app.kubernetes.io/instance: thanos-query-frontend
app.kubernetes.io/name: thanos-query-frontend
app.kubernetes.io/version: v0.30.2
spec:
affinity:
podAntiAffinity:
preferredDuringSchedulingIgnoredDuringExecution:
- podAffinityTerm:
labelSelector:
matchExpressions:
- key: app.kubernetes.io/name
operator: In
values:
- thanos-query-frontend
namespaces:
- thanos
topologyKey: kubernetes.io/hostname
weight: 100
containers:
- args:
- query-frontend
- --log.level=info
- --log.format=logfmt
- --query-frontend.compress-responses
- --http-address=0.0.0.0:9090
- --query-frontend.downstream-url=http://thanos-query.thanos.svc.cluster.local.:9090
- --query-range.split-interval=12h
- --labels.split-interval=12h
- --query-range.max-retries-per-request=10
- --labels.max-retries-per-request=10
- --query-frontend.log-queries-longer-than=10s
- |-
--query-range.response-cache-config="config":
"addresses":
- "dnssrv+_client._tcp.<MEMCACHED_SERVICE>.thanos.svc.cluster.local"
"dns_provider_update_interval": "10s"
"max_async_buffer_size": 10000
"max_async_concurrency": 20
"max_get_multi_batch_size": 0
"max_get_multi_concurrency": 100
"max_idle_connections": 100
"timeout": "500ms"
"type": "memcached"
- |-
--labels.response-cache-config="config":
"addresses":
- "dnssrv+_client._tcp.<MEMCACHED_SERVICE>.thanos.svc.cluster.local"
"dns_provider_update_interval": "10s"
"max_async_buffer_size": 10000
"max_async_concurrency": 20
"max_get_multi_batch_size": 0
"max_get_multi_concurrency": 100
"max_idle_connections": 100
"timeout": "500ms"
"type": "memcached"
- |-
--tracing.config="config":
"sampler_param": 2
"sampler_type": "ratelimiting"
"service_name": "thanos-query-frontend"
"type": "JAEGER"
env:
- name: HOST_IP_ADDRESS
valueFrom:
fieldRef:
fieldPath: status.hostIP
image: quay.io/thanos/thanos:v0.30.2
imagePullPolicy: IfNotPresent
livenessProbe:
failureThreshold: 4
httpGet:
path: /-/healthy
port: 9090
scheme: HTTP
periodSeconds: 30
name: thanos-query-frontend
ports:
- containerPort: 9090
name: http
readinessProbe:
failureThreshold: 20
httpGet:
path: /-/ready
port: 9090
scheme: HTTP
periodSeconds: 5
resources:
limits:
cpu: 0.42
memory: 420Mi
requests:
cpu: 0.123
memory: 123Mi
securityContext:
allowPrivilegeEscalation: false
capabilities:
drop:
- ALL
readOnlyRootFilesystem: true
runAsGroup: 65532
runAsNonRoot: true
runAsUser: 65534
seccompProfile:
type: RuntimeDefault
terminationMessagePolicy: FallbackToLogsOnError
nodeSelector:
kubernetes.io/os: linux
securityContext:
fsGroup: 65534
runAsGroup: 65532
runAsNonRoot: true
runAsUser: 65534
seccompProfile:
type: RuntimeDefault
serviceAccountName: thanos-query-frontend
terminationGracePeriodSeconds: 120

View File

@ -0,0 +1,19 @@
apiVersion: v1
kind: Service
metadata:
labels:
app.kubernetes.io/component: query-cache
app.kubernetes.io/instance: thanos-query-frontend
app.kubernetes.io/name: thanos-query-frontend
app.kubernetes.io/version: v0.30.2
name: thanos-query-frontend
namespace: thanos
spec:
ports:
- name: http
port: 9090
targetPort: 9090
selector:
app.kubernetes.io/component: query-cache
app.kubernetes.io/instance: thanos-query-frontend
app.kubernetes.io/name: thanos-query-frontend

View File

@ -0,0 +1,11 @@
apiVersion: v1
kind: ServiceAccount
metadata:
annotations: {}
labels:
app.kubernetes.io/component: query-cache
app.kubernetes.io/instance: thanos-query-frontend
app.kubernetes.io/name: thanos-query-frontend
app.kubernetes.io/version: v0.30.2
name: thanos-query-frontend
namespace: thanos

View File

@ -0,0 +1,25 @@
apiVersion: monitoring.coreos.com/v1
kind: ServiceMonitor
metadata:
labels:
app.kubernetes.io/component: query-cache
app.kubernetes.io/instance: thanos-query-frontend
app.kubernetes.io/name: thanos-query-frontend
app.kubernetes.io/version: v0.30.2
name: thanos-query-frontend
namespace: thanos
spec:
endpoints:
- port: http
relabelings:
- action: replace
separator: /
sourceLabels:
- namespace
- pod
targetLabel: instance
selector:
matchLabels:
app.kubernetes.io/component: query-cache
app.kubernetes.io/instance: thanos-query-frontend
app.kubernetes.io/name: thanos-query-frontend

View File

@ -5,17 +5,17 @@ metadata:
app.kubernetes.io/component: query-layer
app.kubernetes.io/instance: thanos-query
app.kubernetes.io/name: thanos-query
app.kubernetes.io/version: master-2020-05-24-079ad427
app.kubernetes.io/version: v0.30.2
name: thanos-query
namespace: thanos
spec:
ports:
- name: grpc
port: 10901
targetPort: grpc
targetPort: 10901
- name: http
port: 9090
targetPort: http
targetPort: 9090
selector:
app.kubernetes.io/component: query-layer
app.kubernetes.io/instance: thanos-query

View File

@ -0,0 +1,11 @@
apiVersion: v1
kind: ServiceAccount
metadata:
annotations: {}
labels:
app.kubernetes.io/component: query-layer
app.kubernetes.io/instance: thanos-query
app.kubernetes.io/name: thanos-query
app.kubernetes.io/version: v0.30.2
name: thanos-query
namespace: thanos

View File

@ -5,12 +5,19 @@ metadata:
app.kubernetes.io/component: query-layer
app.kubernetes.io/instance: thanos-query
app.kubernetes.io/name: thanos-query
app.kubernetes.io/version: master-2020-05-24-079ad427
app.kubernetes.io/version: v0.30.2
name: thanos-query
namespace: thanos
spec:
endpoints:
- port: http
relabelings:
- action: replace
separator: /
sourceLabels:
- namespace
- pod
targetLabel: instance
selector:
matchLabels:
app.kubernetes.io/component: query-layer

View File

@ -0,0 +1,13 @@
apiVersion: policy/v1
kind: PodDisruptionBudget
metadata:
name: thanos-receive-default
namespace: thanos
spec:
maxUnavailable: 1
selector:
matchLabels:
app.kubernetes.io/component: database-write-hashring
app.kubernetes.io/instance: thanos-receive-default
app.kubernetes.io/name: thanos-receive
controller.receive.thanos.io/hashring: default

View File

@ -0,0 +1,28 @@
apiVersion: v1
kind: Service
metadata:
labels:
app.kubernetes.io/component: database-write-hashring
app.kubernetes.io/instance: thanos-receive-default
app.kubernetes.io/name: thanos-receive
app.kubernetes.io/version: v0.30.2
controller.receive.thanos.io/hashring: default
name: thanos-receive-default
namespace: thanos
spec:
clusterIP: None
ports:
- name: grpc
port: 10901
targetPort: 10901
- name: http
port: 10902
targetPort: 10902
- name: remote-write
port: 19291
targetPort: 19291
selector:
app.kubernetes.io/component: database-write-hashring
app.kubernetes.io/instance: thanos-receive-default
app.kubernetes.io/name: thanos-receive
controller.receive.thanos.io/hashring: default

View File

@ -0,0 +1,171 @@
apiVersion: apps/v1
kind: StatefulSet
metadata:
labels:
app.kubernetes.io/component: database-write-hashring
app.kubernetes.io/instance: thanos-receive-default
app.kubernetes.io/name: thanos-receive
app.kubernetes.io/version: v0.30.2
controller.receive.thanos.io: thanos-receive-controller
controller.receive.thanos.io/hashring: default
name: thanos-receive-default
namespace: thanos
spec:
minReadySeconds: 0
replicas: 3
selector:
matchLabels:
app.kubernetes.io/component: database-write-hashring
app.kubernetes.io/instance: thanos-receive-default
app.kubernetes.io/name: thanos-receive
controller.receive.thanos.io/hashring: default
serviceName: thanos-receive-default
template:
metadata:
labels:
app.kubernetes.io/component: database-write-hashring
app.kubernetes.io/instance: thanos-receive-default
app.kubernetes.io/name: thanos-receive
app.kubernetes.io/version: v0.30.2
controller.receive.thanos.io/hashring: default
spec:
affinity:
podAntiAffinity:
preferredDuringSchedulingIgnoredDuringExecution:
- podAffinityTerm:
labelSelector:
matchExpressions:
- key: app.kubernetes.io/name
operator: In
values:
- thanos-receive
- key: app.kubernetes.io/instance
operator: In
values:
- thanos-receive-default
namespaces:
- thanos
topologyKey: kubernetes.io/hostname
weight: 100
- podAffinityTerm:
labelSelector:
matchExpressions:
- key: app.kubernetes.io/name
operator: In
values:
- thanos-receive
- key: app.kubernetes.io/instance
operator: In
values:
- thanos-receive-default
namespaces:
- thanos
topologyKey: topology.kubernetes.io/zone
weight: 100
containers:
- args:
- receive
- --log.level=info
- --log.format=logfmt
- --grpc-address=0.0.0.0:10901
- --http-address=0.0.0.0:10902
- --remote-write.address=0.0.0.0:19291
- --receive.replication-factor=2
- --tsdb.path=/var/thanos/receive
- --tsdb.retention=15d
- --label=replica="$(NAME)"
- --label=receive="true"
- --objstore.config=$(OBJSTORE_CONFIG)
- --receive.local-endpoint=$(NAME).thanos-receive-default.$(NAMESPACE).svc.cluster.local:10901
- --receive.hashrings-file=/var/lib/thanos-receive/hashrings.json
- |-
--tracing.config="config":
"sampler_param": 2
"sampler_type": "ratelimiting"
"service_name": "thanos-receive"
"type": "JAEGER"
env:
- name: NAME
valueFrom:
fieldRef:
fieldPath: metadata.name
- name: NAMESPACE
valueFrom:
fieldRef:
fieldPath: metadata.namespace
- name: HOST_IP_ADDRESS
valueFrom:
fieldRef:
fieldPath: status.hostIP
- name: OBJSTORE_CONFIG
valueFrom:
secretKeyRef:
key: thanos.yaml
name: thanos-objectstorage
image: quay.io/thanos/thanos:v0.30.2
imagePullPolicy: IfNotPresent
livenessProbe:
failureThreshold: 8
httpGet:
path: /-/healthy
port: 10902
scheme: HTTP
periodSeconds: 30
name: thanos-receive
ports:
- containerPort: 10901
name: grpc
- containerPort: 10902
name: http
- containerPort: 19291
name: remote-write
readinessProbe:
failureThreshold: 20
httpGet:
path: /-/ready
port: 10902
scheme: HTTP
periodSeconds: 5
resources:
limits:
cpu: 0.42
memory: 420Mi
requests:
cpu: 0.123
memory: 123Mi
terminationMessagePolicy: FallbackToLogsOnError
volumeMounts:
- mountPath: /var/thanos/receive
name: data
readOnly: false
- mountPath: /var/lib/thanos-receive
name: hashring-config
nodeSelector:
kubernetes.io/os: linux
securityContext:
fsGroup: 65534
runAsGroup: 65532
runAsNonRoot: true
runAsUser: 65534
seccompProfile:
type: RuntimeDefault
serviceAccountName: thanos-receive
terminationGracePeriodSeconds: 900
volumes:
- configMap:
name: hashring
name: hashring-config
volumeClaimTemplates:
- metadata:
labels:
app.kubernetes.io/component: database-write-hashring
app.kubernetes.io/instance: thanos-receive-default
app.kubernetes.io/name: thanos-receive
controller.receive.thanos.io/hashring: default
name: data
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 10Gi

View File

@ -0,0 +1,11 @@
apiVersion: v1
kind: ServiceAccount
metadata:
annotations: {}
labels:
app.kubernetes.io/component: database-write-hashring
app.kubernetes.io/instance: thanos-receive
app.kubernetes.io/name: thanos-receive
app.kubernetes.io/version: v0.30.2
name: thanos-receive
namespace: thanos

View File

@ -0,0 +1,28 @@
apiVersion: monitoring.coreos.com/v1
kind: ServiceMonitor
metadata:
labels:
app.kubernetes.io/component: database-write-hashring
app.kubernetes.io/instance: thanos-receive
app.kubernetes.io/name: thanos-receive
app.kubernetes.io/version: v0.30.2
name: thanos-receive
namespace: thanos
spec:
endpoints:
- port: http
relabelings:
- action: replace
separator: /
sourceLabels:
- namespace
- pod
targetLabel: instance
- action: replace
sourceLabels:
- __meta_kubernetes_service_label_controller_receive_thanos_io_shard
targetLabel: hashring
selector:
matchLabels:
app.kubernetes.io/component: database-write-hashring
app.kubernetes.io/name: thanos-receive

View File

@ -0,0 +1,13 @@
apiVersion: policy/v1
kind: PodDisruptionBudget
metadata:
name: thanos-receive-region-1
namespace: thanos
spec:
maxUnavailable: 1
selector:
matchLabels:
app.kubernetes.io/component: database-write-hashring
app.kubernetes.io/instance: thanos-receive-region-1
app.kubernetes.io/name: thanos-receive
controller.receive.thanos.io/hashring: region-1

View File

@ -0,0 +1,28 @@
apiVersion: v1
kind: Service
metadata:
labels:
app.kubernetes.io/component: database-write-hashring
app.kubernetes.io/instance: thanos-receive-region-1
app.kubernetes.io/name: thanos-receive
app.kubernetes.io/version: v0.30.2
controller.receive.thanos.io/hashring: region-1
name: thanos-receive-region-1
namespace: thanos
spec:
clusterIP: None
ports:
- name: grpc
port: 10901
targetPort: 10901
- name: http
port: 10902
targetPort: 10902
- name: remote-write
port: 19291
targetPort: 19291
selector:
app.kubernetes.io/component: database-write-hashring
app.kubernetes.io/instance: thanos-receive-region-1
app.kubernetes.io/name: thanos-receive
controller.receive.thanos.io/hashring: region-1

View File

@ -0,0 +1,171 @@
apiVersion: apps/v1
kind: StatefulSet
metadata:
labels:
app.kubernetes.io/component: database-write-hashring
app.kubernetes.io/instance: thanos-receive-region-1
app.kubernetes.io/name: thanos-receive
app.kubernetes.io/version: v0.30.2
controller.receive.thanos.io: thanos-receive-controller
controller.receive.thanos.io/hashring: region-1
name: thanos-receive-region-1
namespace: thanos
spec:
minReadySeconds: 0
replicas: 3
selector:
matchLabels:
app.kubernetes.io/component: database-write-hashring
app.kubernetes.io/instance: thanos-receive-region-1
app.kubernetes.io/name: thanos-receive
controller.receive.thanos.io/hashring: region-1
serviceName: thanos-receive-region-1
template:
metadata:
labels:
app.kubernetes.io/component: database-write-hashring
app.kubernetes.io/instance: thanos-receive-region-1
app.kubernetes.io/name: thanos-receive
app.kubernetes.io/version: v0.30.2
controller.receive.thanos.io/hashring: region-1
spec:
affinity:
podAntiAffinity:
preferredDuringSchedulingIgnoredDuringExecution:
- podAffinityTerm:
labelSelector:
matchExpressions:
- key: app.kubernetes.io/name
operator: In
values:
- thanos-receive
- key: app.kubernetes.io/instance
operator: In
values:
- thanos-receive-region-1
namespaces:
- thanos
topologyKey: kubernetes.io/hostname
weight: 100
- podAffinityTerm:
labelSelector:
matchExpressions:
- key: app.kubernetes.io/name
operator: In
values:
- thanos-receive
- key: app.kubernetes.io/instance
operator: In
values:
- thanos-receive-region-1
namespaces:
- thanos
topologyKey: topology.kubernetes.io/zone
weight: 100
containers:
- args:
- receive
- --log.level=info
- --log.format=logfmt
- --grpc-address=0.0.0.0:10901
- --http-address=0.0.0.0:10902
- --remote-write.address=0.0.0.0:19291
- --receive.replication-factor=2
- --tsdb.path=/var/thanos/receive
- --tsdb.retention=15d
- --label=replica="$(NAME)"
- --label=receive="true"
- --objstore.config=$(OBJSTORE_CONFIG)
- --receive.local-endpoint=$(NAME).thanos-receive-region-1.$(NAMESPACE).svc.cluster.local:10901
- --receive.hashrings-file=/var/lib/thanos-receive/hashrings.json
- |-
--tracing.config="config":
"sampler_param": 2
"sampler_type": "ratelimiting"
"service_name": "thanos-receive"
"type": "JAEGER"
env:
- name: NAME
valueFrom:
fieldRef:
fieldPath: metadata.name
- name: NAMESPACE
valueFrom:
fieldRef:
fieldPath: metadata.namespace
- name: HOST_IP_ADDRESS
valueFrom:
fieldRef:
fieldPath: status.hostIP
- name: OBJSTORE_CONFIG
valueFrom:
secretKeyRef:
key: thanos.yaml
name: thanos-objectstorage
image: quay.io/thanos/thanos:v0.30.2
imagePullPolicy: IfNotPresent
livenessProbe:
failureThreshold: 8
httpGet:
path: /-/healthy
port: 10902
scheme: HTTP
periodSeconds: 30
name: thanos-receive
ports:
- containerPort: 10901
name: grpc
- containerPort: 10902
name: http
- containerPort: 19291
name: remote-write
readinessProbe:
failureThreshold: 20
httpGet:
path: /-/ready
port: 10902
scheme: HTTP
periodSeconds: 5
resources:
limits:
cpu: 0.42
memory: 420Mi
requests:
cpu: 0.123
memory: 123Mi
terminationMessagePolicy: FallbackToLogsOnError
volumeMounts:
- mountPath: /var/thanos/receive
name: data
readOnly: false
- mountPath: /var/lib/thanos-receive
name: hashring-config
nodeSelector:
kubernetes.io/os: linux
securityContext:
fsGroup: 65534
runAsGroup: 65532
runAsNonRoot: true
runAsUser: 65534
seccompProfile:
type: RuntimeDefault
serviceAccountName: thanos-receive
terminationGracePeriodSeconds: 900
volumes:
- configMap:
name: hashring
name: hashring-config
volumeClaimTemplates:
- metadata:
labels:
app.kubernetes.io/component: database-write-hashring
app.kubernetes.io/instance: thanos-receive-region-1
app.kubernetes.io/name: thanos-receive
controller.receive.thanos.io/hashring: region-1
name: data
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 10Gi

View File

@ -5,7 +5,7 @@ metadata:
app.kubernetes.io/component: database-write-hashring
app.kubernetes.io/instance: thanos-receive
app.kubernetes.io/name: thanos-receive
app.kubernetes.io/version: master-2020-05-24-079ad427
app.kubernetes.io/version: v0.30.2
name: thanos-receive
namespace: thanos
spec:

View File

@ -0,0 +1,11 @@
apiVersion: v1
kind: ServiceAccount
metadata:
annotations: {}
labels:
app.kubernetes.io/component: database-write-hashring
app.kubernetes.io/instance: thanos-receive
app.kubernetes.io/name: thanos-receive
app.kubernetes.io/version: v0.30.2
name: thanos-receive
namespace: thanos

View File

@ -5,12 +5,19 @@ metadata:
app.kubernetes.io/component: database-write-hashring
app.kubernetes.io/instance: thanos-receive
app.kubernetes.io/name: thanos-receive
app.kubernetes.io/version: master-2020-05-24-079ad427
app.kubernetes.io/version: v0.30.2
name: thanos-receive
namespace: thanos
spec:
endpoints:
- port: http
relabelings:
- action: replace
separator: /
sourceLabels:
- namespace
- pod
targetLabel: instance
selector:
matchLabels:
app.kubernetes.io/component: database-write-hashring

View File

@ -5,10 +5,11 @@ metadata:
app.kubernetes.io/component: database-write-hashring
app.kubernetes.io/instance: thanos-receive
app.kubernetes.io/name: thanos-receive
app.kubernetes.io/version: master-2020-05-24-079ad427
app.kubernetes.io/version: v0.30.2
name: thanos-receive
namespace: thanos
spec:
minReadySeconds: 0
replicas: 1
selector:
matchLabels:
@ -22,7 +23,7 @@ spec:
app.kubernetes.io/component: database-write-hashring
app.kubernetes.io/instance: thanos-receive
app.kubernetes.io/name: thanos-receive
app.kubernetes.io/version: master-2020-05-24-079ad427
app.kubernetes.io/version: v0.30.2
spec:
affinity:
podAntiAffinity:
@ -30,6 +31,10 @@ spec:
- podAffinityTerm:
labelSelector:
matchExpressions:
- key: app.kubernetes.io/name
operator: In
values:
- thanos-receive
- key: app.kubernetes.io/instance
operator: In
values:
@ -41,6 +46,10 @@ spec:
- podAffinityTerm:
labelSelector:
matchExpressions:
- key: app.kubernetes.io/name
operator: In
values:
- thanos-receive
- key: app.kubernetes.io/instance
operator: In
values:
@ -52,15 +61,25 @@ spec:
containers:
- args:
- receive
- --log.level=info
- --log.format=logfmt
- --grpc-address=0.0.0.0:10901
- --http-address=0.0.0.0:10902
- --remote-write.address=0.0.0.0:19291
- --receive.replication-factor=1
- --objstore.config=$(OBJSTORE_CONFIG)
- --tsdb.path=/var/thanos/receive
- --tsdb.retention=15d
- --label=replica="$(NAME)"
- --label=receive="true"
- --objstore.config=$(OBJSTORE_CONFIG)
- --receive.local-endpoint=$(NAME).thanos-receive.$(NAMESPACE).svc.cluster.local:10901
- --receive.hashrings-file=/var/lib/thanos-receive/hashrings.json
- |-
--tracing.config="config":
"sampler_param": 2
"sampler_type": "ratelimiting"
"service_name": "thanos-receive"
"type": "JAEGER"
env:
- name: NAME
valueFrom:
@ -70,12 +89,17 @@ spec:
valueFrom:
fieldRef:
fieldPath: metadata.namespace
- name: HOST_IP_ADDRESS
valueFrom:
fieldRef:
fieldPath: status.hostIP
- name: OBJSTORE_CONFIG
valueFrom:
secretKeyRef:
key: thanos.yaml
name: thanos-objectstorage
image: quay.io/thanos/thanos:master-2020-05-24-079ad427
image: quay.io/thanos/thanos:v0.30.2
imagePullPolicy: IfNotPresent
livenessProbe:
failureThreshold: 8
httpGet:
@ -98,13 +122,35 @@ spec:
port: 10902
scheme: HTTP
periodSeconds: 5
resources:
limits:
cpu: 0.42
memory: 420Mi
requests:
cpu: 0.123
memory: 123Mi
terminationMessagePolicy: FallbackToLogsOnError
volumeMounts:
- mountPath: /var/thanos/receive
name: data
readOnly: false
- mountPath: /var/lib/thanos-receive
name: hashring-config
nodeSelector:
kubernetes.io/os: linux
securityContext:
fsGroup: 65534
runAsGroup: 65532
runAsNonRoot: true
runAsUser: 65534
seccompProfile:
type: RuntimeDefault
serviceAccountName: thanos-receive
terminationGracePeriodSeconds: 900
volumes: []
volumes:
- configMap:
name: hashring
name: hashring-config
volumeClaimTemplates:
- metadata:
labels:

View File

@ -5,7 +5,7 @@ metadata:
app.kubernetes.io/component: rule-evaluation-engine
app.kubernetes.io/instance: thanos-rule
app.kubernetes.io/name: thanos-rule
app.kubernetes.io/version: master-2020-05-24-079ad427
app.kubernetes.io/version: v0.30.2
name: thanos-rule
namespace: thanos
spec:
@ -13,10 +13,13 @@ spec:
ports:
- name: grpc
port: 10901
targetPort: grpc
targetPort: 10901
- name: http
port: 10902
targetPort: http
targetPort: 10902
- name: reloader
port: 9533
targetPort: 9533
selector:
app.kubernetes.io/component: rule-evaluation-engine
app.kubernetes.io/instance: thanos-rule

View File

@ -0,0 +1,11 @@
apiVersion: v1
kind: ServiceAccount
metadata:
annotations: {}
labels:
app.kubernetes.io/component: rule-evaluation-engine
app.kubernetes.io/instance: thanos-rule
app.kubernetes.io/name: thanos-rule
app.kubernetes.io/version: v0.30.2
name: thanos-rule
namespace: thanos

View File

@ -5,12 +5,20 @@ metadata:
app.kubernetes.io/component: rule-evaluation-engine
app.kubernetes.io/instance: thanos-rule
app.kubernetes.io/name: thanos-rule
app.kubernetes.io/version: master-2020-05-24-079ad427
app.kubernetes.io/version: v0.30.2
name: thanos-rule
namespace: thanos
spec:
endpoints:
- port: http
relabelings:
- action: replace
separator: /
sourceLabels:
- namespace
- pod
targetLabel: instance
- port: reloader
selector:
matchLabels:
app.kubernetes.io/component: rule-evaluation-engine

View File

@ -5,7 +5,7 @@ metadata:
app.kubernetes.io/component: rule-evaluation-engine
app.kubernetes.io/instance: thanos-rule
app.kubernetes.io/name: thanos-rule
app.kubernetes.io/version: master-2020-05-24-079ad427
app.kubernetes.io/version: v0.30.2
name: thanos-rule
namespace: thanos
spec:
@ -22,18 +22,50 @@ spec:
app.kubernetes.io/component: rule-evaluation-engine
app.kubernetes.io/instance: thanos-rule
app.kubernetes.io/name: thanos-rule
app.kubernetes.io/version: master-2020-05-24-079ad427
app.kubernetes.io/version: v0.30.2
spec:
affinity:
podAntiAffinity:
preferredDuringSchedulingIgnoredDuringExecution:
- podAffinityTerm:
labelSelector:
matchExpressions:
- key: app.kubernetes.io/name
operator: In
values:
- thanos-rule
- key: app.kubernetes.io/instance
operator: In
values:
- thanos-rule
namespaces:
- thanos
topologyKey: kubernetes.io/hostname
weight: 100
containers:
- args:
- rule
- --log.level=info
- --log.format=logfmt
- --grpc-address=0.0.0.0:10901
- --http-address=0.0.0.0:10902
- --objstore.config=$(OBJSTORE_CONFIG)
- --data-dir=/var/thanos/rule
- --label=rule_replica="$(NAME)"
- --alert.label-drop=rule_replica
- --tsdb.retention=48h
- --tsdb.block-duration=2h
- --query=dnssrv+_http._tcp.thanos-query.thanos.svc.cluster.local
- --alertmanagers.url=alertmanager:9093
- --alertmanagers.config-file=/etc/thanos/config/thanos-ruler-config/config.yaml
- --rule-file=/etc/thanos/rules/test/test
- |-
--tracing.config="config":
"sampler_param": 2
"sampler_type": "ratelimiting"
"service_name": "thanos-rule"
"type": "JAEGER"
- --remote-write.config-file=/etc/thanos/config/thanos-stateless-ruler-config/rw-config.yaml
env:
- name: NAME
valueFrom:
@ -44,7 +76,12 @@ spec:
secretKeyRef:
key: thanos.yaml
name: thanos-objectstorage
image: quay.io/thanos/thanos:master-2020-05-24-079ad427
- name: HOST_IP_ADDRESS
valueFrom:
fieldRef:
fieldPath: status.hostIP
image: quay.io/thanos/thanos:v0.30.2
imagePullPolicy: IfNotPresent
livenessProbe:
failureThreshold: 24
httpGet:
@ -58,6 +95,8 @@ spec:
name: grpc
- containerPort: 10902
name: http
- containerPort: 9533
name: reloader
readinessProbe:
failureThreshold: 18
httpGet:
@ -66,12 +105,72 @@ spec:
scheme: HTTP
initialDelaySeconds: 10
periodSeconds: 5
resources:
limits:
cpu: 0.42
memory: 420Mi
requests:
cpu: 0.123
memory: 123Mi
securityContext:
allowPrivilegeEscalation: false
capabilities:
drop:
- ALL
readOnlyRootFilesystem: true
runAsGroup: 65532
runAsNonRoot: true
runAsUser: 65534
seccompProfile:
type: RuntimeDefault
terminationMessagePolicy: FallbackToLogsOnError
volumeMounts:
- mountPath: /var/thanos/rule
name: data
readOnly: false
volumes: []
- mountPath: /etc/thanos/rules/test
name: test
- mountPath: /etc/thanos/config/thanos-ruler-config
name: thanos-ruler-config
readOnly: true
- mountPath: /etc/thanos/config/thanos-stateless-ruler-config
name: thanos-stateless-ruler-config
readOnly: true
- args:
- -webhook-url=http://localhost:10902/-/reload
- -volume-dir=/etc/thanos/rules/test
- -volume-dir=/etc/thanos/config/thanos-ruler-config
- -volume-dir=/etc/thanos/config/thanos-stateless-ruler-config
image: jimmidyson/configmap-reload:v0.5.0
imagePullPolicy: IfNotPresent
name: configmap-reloader
volumeMounts:
- mountPath: /etc/thanos/rules/test
name: test
- mountPath: /etc/thanos/config/thanos-ruler-config
name: thanos-ruler-config
- mountPath: /etc/thanos/config/thanos-stateless-ruler-config
name: thanos-stateless-ruler-config
nodeSelector:
kubernetes.io/os: linux
securityContext:
fsGroup: 65534
runAsGroup: 65532
runAsNonRoot: true
runAsUser: 65534
seccompProfile:
type: RuntimeDefault
serviceAccountName: thanos-rule
volumes:
- configMap:
name: test
name: test
- configMap:
name: thanos-ruler-config
name: thanos-ruler-config
- configMap:
name: thanos-stateless-ruler-config
name: thanos-stateless-ruler-config
volumeClaimTemplates:
- metadata:
labels:

View File

@ -0,0 +1,21 @@
apiVersion: v1
kind: Service
metadata:
labels:
app.kubernetes.io/component: prometheus-sidecar
app.kubernetes.io/instance: thanos-sidecar
app.kubernetes.io/name: thanos-sidecar
app.kubernetes.io/version: v0.30.2
name: thanos-sidecar
namespace: thanos
spec:
clusterIP: None
ports:
- name: grpc
port: 10901
targetPort: 10901
- name: http
port: 10902
targetPort: 10902
selector:
app: prometheus

View File

@ -0,0 +1,25 @@
apiVersion: monitoring.coreos.com/v1
kind: ServiceMonitor
metadata:
labels:
app.kubernetes.io/component: prometheus-sidecar
app.kubernetes.io/instance: thanos-sidecar
app.kubernetes.io/name: thanos-sidecar
app.kubernetes.io/version: v0.30.2
name: thanos-sidecar
namespace: thanos
spec:
endpoints:
- port: http
relabelings:
- action: replace
separator: /
sourceLabels:
- namespace
- pod
targetLabel: instance
selector:
matchLabels:
app.kubernetes.io/component: prometheus-sidecar
app.kubernetes.io/instance: thanos-sidecar
app.kubernetes.io/name: thanos-sidecar

View File

@ -5,7 +5,7 @@ metadata:
app.kubernetes.io/component: object-store-gateway
app.kubernetes.io/instance: thanos-store
app.kubernetes.io/name: thanos-store
app.kubernetes.io/version: master-2020-05-24-079ad427
app.kubernetes.io/version: v0.30.2
name: thanos-store
namespace: thanos
spec:

View File

@ -0,0 +1,11 @@
apiVersion: v1
kind: ServiceAccount
metadata:
annotations: {}
labels:
app.kubernetes.io/component: object-store-gateway
app.kubernetes.io/instance: thanos-store
app.kubernetes.io/name: thanos-store
app.kubernetes.io/version: v0.30.2
name: thanos-store
namespace: thanos

View File

@ -5,12 +5,19 @@ metadata:
app.kubernetes.io/component: object-store-gateway
app.kubernetes.io/instance: thanos-store
app.kubernetes.io/name: thanos-store
app.kubernetes.io/version: master-2020-05-24-079ad427
app.kubernetes.io/version: v0.30.2
name: thanos-store
namespace: thanos
spec:
endpoints:
- port: http
relabelings:
- action: replace
separator: /
sourceLabels:
- namespace
- pod
targetLabel: instance
selector:
matchLabels:
app.kubernetes.io/component: object-store-gateway

View File

@ -0,0 +1,25 @@
apiVersion: v1
kind: Service
metadata:
labels:
app.kubernetes.io/component: object-store-gateway
app.kubernetes.io/instance: thanos-store-0
app.kubernetes.io/name: thanos-store
app.kubernetes.io/version: v0.30.2
store.thanos.io/shard: shard-0
name: thanos-store-0
namespace: thanos
spec:
clusterIP: None
ports:
- name: grpc
port: 10901
targetPort: 10901
- name: http
port: 10902
targetPort: 10902
selector:
app.kubernetes.io/component: object-store-gateway
app.kubernetes.io/instance: thanos-store-0
app.kubernetes.io/name: thanos-store
store.thanos.io/shard: shard-0

View File

@ -3,26 +3,29 @@ kind: StatefulSet
metadata:
labels:
app.kubernetes.io/component: object-store-gateway
app.kubernetes.io/instance: thanos-store
app.kubernetes.io/instance: thanos-store-0
app.kubernetes.io/name: thanos-store
app.kubernetes.io/version: master-2020-05-24-079ad427
name: thanos-store
app.kubernetes.io/version: v0.30.2
store.thanos.io/shard: shard-0
name: thanos-store-0
namespace: thanos
spec:
replicas: 1
selector:
matchLabels:
app.kubernetes.io/component: object-store-gateway
app.kubernetes.io/instance: thanos-store
app.kubernetes.io/instance: thanos-store-0
app.kubernetes.io/name: thanos-store
serviceName: thanos-store
store.thanos.io/shard: shard-0
serviceName: thanos-store-0
template:
metadata:
labels:
app.kubernetes.io/component: object-store-gateway
app.kubernetes.io/instance: thanos-store
app.kubernetes.io/instance: thanos-store-0
app.kubernetes.io/name: thanos-store
app.kubernetes.io/version: master-2020-05-24-079ad427
app.kubernetes.io/version: v0.30.2
store.thanos.io/shard: shard-0
spec:
affinity:
podAntiAffinity:
@ -37,7 +40,7 @@ spec:
- key: app.kubernetes.io/instance
operator: In
values:
- thanos-store
- thanos-store-0
namespaces:
- thanos
topologyKey: kubernetes.io/hostname
@ -45,15 +48,17 @@ spec:
containers:
- args:
- store
- --log.level=info
- --log.format=logfmt
- --data-dir=/var/thanos/store
- --grpc-address=0.0.0.0:10901
- --http-address=0.0.0.0:10902
- --objstore.config=$(OBJSTORE_CONFIG)
- --experimental.enable-index-cache-postings-compression
- --ignore-deletion-marks-delay=24h
- |-
--index-cache.config="config":
"addresses":
- "dnssrv+_client._tcp.<MEMCACHED_SERCIVE>.thanos.svc.cluster.local"
- "dnssrv+_client._tcp.<MEMCACHED_SERVICE>.thanos.svc.cluster.local"
"dns_provider_update_interval": "10s"
"max_async_buffer_size": 10000
"max_async_concurrency": 20
@ -70,7 +75,7 @@ spec:
"chunk_subrange_ttl": "24h"
"config":
"addresses":
- "dnssrv+_client._tcp.<MEMCACHED_SERCIVE>.thanos.svc.cluster.local"
- "dnssrv+_client._tcp.<MEMCACHED_SERVICE>.thanos.svc.cluster.local"
"dns_provider_update_interval": "10s"
"max_async_buffer_size": 10000
"max_async_concurrency": 20
@ -85,13 +90,33 @@ spec:
"metafile_exists_ttl": "2h"
"metafile_max_size": "1MiB"
"type": "memcached"
- |-
--tracing.config="config":
"sampler_param": 2
"sampler_type": "ratelimiting"
"service_name": "thanos-store"
"type": "JAEGER"
- |
--selector.relabel-config=
- action: hashmod
source_labels: ["__block_id"]
target_label: shard
modulus: 3
- action: keep
source_labels: ["shard"]
regex: 0
env:
- name: OBJSTORE_CONFIG
valueFrom:
secretKeyRef:
key: thanos.yaml
name: thanos-objectstorage
image: quay.io/thanos/thanos:master-2020-05-24-079ad427
- name: HOST_IP_ADDRESS
valueFrom:
fieldRef:
fieldPath: status.hostIP
image: quay.io/thanos/thanos:v0.30.2
imagePullPolicy: IfNotPresent
livenessProbe:
failureThreshold: 8
httpGet:
@ -99,6 +124,7 @@ spec:
port: 10902
scheme: HTTP
periodSeconds: 30
timeoutSeconds: 1
name: thanos-store
ports:
- containerPort: 10901
@ -112,19 +138,48 @@ spec:
port: 10902
scheme: HTTP
periodSeconds: 5
resources:
limits:
cpu: 0.42
memory: 420Mi
requests:
cpu: 0.123
memory: 123Mi
securityContext:
allowPrivilegeEscalation: false
capabilities:
drop:
- ALL
readOnlyRootFilesystem: true
runAsGroup: 65532
runAsNonRoot: true
runAsUser: 65534
seccompProfile:
type: RuntimeDefault
terminationMessagePolicy: FallbackToLogsOnError
volumeMounts:
- mountPath: /var/thanos/store
name: data
readOnly: false
nodeSelector:
kubernetes.io/os: linux
securityContext:
fsGroup: 65534
runAsGroup: 65532
runAsNonRoot: true
runAsUser: 65534
seccompProfile:
type: RuntimeDefault
serviceAccountName: thanos-store
terminationGracePeriodSeconds: 120
volumes: []
volumeClaimTemplates:
- metadata:
labels:
app.kubernetes.io/component: object-store-gateway
app.kubernetes.io/instance: thanos-store
app.kubernetes.io/instance: thanos-store-0
app.kubernetes.io/name: thanos-store
store.thanos.io/shard: shard-0
name: data
spec:
accessModes:

View File

@ -0,0 +1,25 @@
apiVersion: v1
kind: Service
metadata:
labels:
app.kubernetes.io/component: object-store-gateway
app.kubernetes.io/instance: thanos-store-1
app.kubernetes.io/name: thanos-store
app.kubernetes.io/version: v0.30.2
store.thanos.io/shard: shard-1
name: thanos-store-1
namespace: thanos
spec:
clusterIP: None
ports:
- name: grpc
port: 10901
targetPort: 10901
- name: http
port: 10902
targetPort: 10902
selector:
app.kubernetes.io/component: object-store-gateway
app.kubernetes.io/instance: thanos-store-1
app.kubernetes.io/name: thanos-store
store.thanos.io/shard: shard-1

View File

@ -0,0 +1,189 @@
apiVersion: apps/v1
kind: StatefulSet
metadata:
labels:
app.kubernetes.io/component: object-store-gateway
app.kubernetes.io/instance: thanos-store-1
app.kubernetes.io/name: thanos-store
app.kubernetes.io/version: v0.30.2
store.thanos.io/shard: shard-1
name: thanos-store-1
namespace: thanos
spec:
replicas: 1
selector:
matchLabels:
app.kubernetes.io/component: object-store-gateway
app.kubernetes.io/instance: thanos-store-1
app.kubernetes.io/name: thanos-store
store.thanos.io/shard: shard-1
serviceName: thanos-store-1
template:
metadata:
labels:
app.kubernetes.io/component: object-store-gateway
app.kubernetes.io/instance: thanos-store-1
app.kubernetes.io/name: thanos-store
app.kubernetes.io/version: v0.30.2
store.thanos.io/shard: shard-1
spec:
affinity:
podAntiAffinity:
preferredDuringSchedulingIgnoredDuringExecution:
- podAffinityTerm:
labelSelector:
matchExpressions:
- key: app.kubernetes.io/name
operator: In
values:
- thanos-store
- key: app.kubernetes.io/instance
operator: In
values:
- thanos-store-1
namespaces:
- thanos
topologyKey: kubernetes.io/hostname
weight: 100
containers:
- args:
- store
- --log.level=info
- --log.format=logfmt
- --data-dir=/var/thanos/store
- --grpc-address=0.0.0.0:10901
- --http-address=0.0.0.0:10902
- --objstore.config=$(OBJSTORE_CONFIG)
- --ignore-deletion-marks-delay=24h
- |-
--index-cache.config="config":
"addresses":
- "dnssrv+_client._tcp.<MEMCACHED_SERVICE>.thanos.svc.cluster.local"
"dns_provider_update_interval": "10s"
"max_async_buffer_size": 10000
"max_async_concurrency": 20
"max_get_multi_batch_size": 0
"max_get_multi_concurrency": 100
"max_idle_connections": 100
"max_item_size": "1MiB"
"timeout": "500ms"
"type": "memcached"
- |-
--store.caching-bucket.config="blocks_iter_ttl": "5m"
"chunk_object_attrs_ttl": "24h"
"chunk_subrange_size": 16000
"chunk_subrange_ttl": "24h"
"config":
"addresses":
- "dnssrv+_client._tcp.<MEMCACHED_SERVICE>.thanos.svc.cluster.local"
"dns_provider_update_interval": "10s"
"max_async_buffer_size": 10000
"max_async_concurrency": 20
"max_get_multi_batch_size": 0
"max_get_multi_concurrency": 100
"max_idle_connections": 100
"max_item_size": "1MiB"
"timeout": "500ms"
"max_chunks_get_range_requests": 3
"metafile_content_ttl": "24h"
"metafile_doesnt_exist_ttl": "15m"
"metafile_exists_ttl": "2h"
"metafile_max_size": "1MiB"
"type": "memcached"
- |-
--tracing.config="config":
"sampler_param": 2
"sampler_type": "ratelimiting"
"service_name": "thanos-store"
"type": "JAEGER"
- |
--selector.relabel-config=
- action: hashmod
source_labels: ["__block_id"]
target_label: shard
modulus: 3
- action: keep
source_labels: ["shard"]
regex: 1
env:
- name: OBJSTORE_CONFIG
valueFrom:
secretKeyRef:
key: thanos.yaml
name: thanos-objectstorage
- name: HOST_IP_ADDRESS
valueFrom:
fieldRef:
fieldPath: status.hostIP
image: quay.io/thanos/thanos:v0.30.2
imagePullPolicy: IfNotPresent
livenessProbe:
failureThreshold: 8
httpGet:
path: /-/healthy
port: 10902
scheme: HTTP
periodSeconds: 30
timeoutSeconds: 1
name: thanos-store
ports:
- containerPort: 10901
name: grpc
- containerPort: 10902
name: http
readinessProbe:
failureThreshold: 20
httpGet:
path: /-/ready
port: 10902
scheme: HTTP
periodSeconds: 5
resources:
limits:
cpu: 0.42
memory: 420Mi
requests:
cpu: 0.123
memory: 123Mi
securityContext:
allowPrivilegeEscalation: false
capabilities:
drop:
- ALL
readOnlyRootFilesystem: true
runAsGroup: 65532
runAsNonRoot: true
runAsUser: 65534
seccompProfile:
type: RuntimeDefault
terminationMessagePolicy: FallbackToLogsOnError
volumeMounts:
- mountPath: /var/thanos/store
name: data
readOnly: false
nodeSelector:
kubernetes.io/os: linux
securityContext:
fsGroup: 65534
runAsGroup: 65532
runAsNonRoot: true
runAsUser: 65534
seccompProfile:
type: RuntimeDefault
serviceAccountName: thanos-store
terminationGracePeriodSeconds: 120
volumes: []
volumeClaimTemplates:
- metadata:
labels:
app.kubernetes.io/component: object-store-gateway
app.kubernetes.io/instance: thanos-store-1
app.kubernetes.io/name: thanos-store
store.thanos.io/shard: shard-1
name: data
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 10Gi

View File

@ -0,0 +1,25 @@
apiVersion: v1
kind: Service
metadata:
labels:
app.kubernetes.io/component: object-store-gateway
app.kubernetes.io/instance: thanos-store-2
app.kubernetes.io/name: thanos-store
app.kubernetes.io/version: v0.30.2
store.thanos.io/shard: shard-2
name: thanos-store-2
namespace: thanos
spec:
clusterIP: None
ports:
- name: grpc
port: 10901
targetPort: 10901
- name: http
port: 10902
targetPort: 10902
selector:
app.kubernetes.io/component: object-store-gateway
app.kubernetes.io/instance: thanos-store-2
app.kubernetes.io/name: thanos-store
store.thanos.io/shard: shard-2

View File

@ -0,0 +1,189 @@
apiVersion: apps/v1
kind: StatefulSet
metadata:
labels:
app.kubernetes.io/component: object-store-gateway
app.kubernetes.io/instance: thanos-store-2
app.kubernetes.io/name: thanos-store
app.kubernetes.io/version: v0.30.2
store.thanos.io/shard: shard-2
name: thanos-store-2
namespace: thanos
spec:
replicas: 1
selector:
matchLabels:
app.kubernetes.io/component: object-store-gateway
app.kubernetes.io/instance: thanos-store-2
app.kubernetes.io/name: thanos-store
store.thanos.io/shard: shard-2
serviceName: thanos-store-2
template:
metadata:
labels:
app.kubernetes.io/component: object-store-gateway
app.kubernetes.io/instance: thanos-store-2
app.kubernetes.io/name: thanos-store
app.kubernetes.io/version: v0.30.2
store.thanos.io/shard: shard-2
spec:
affinity:
podAntiAffinity:
preferredDuringSchedulingIgnoredDuringExecution:
- podAffinityTerm:
labelSelector:
matchExpressions:
- key: app.kubernetes.io/name
operator: In
values:
- thanos-store
- key: app.kubernetes.io/instance
operator: In
values:
- thanos-store-2
namespaces:
- thanos
topologyKey: kubernetes.io/hostname
weight: 100
containers:
- args:
- store
- --log.level=info
- --log.format=logfmt
- --data-dir=/var/thanos/store
- --grpc-address=0.0.0.0:10901
- --http-address=0.0.0.0:10902
- --objstore.config=$(OBJSTORE_CONFIG)
- --ignore-deletion-marks-delay=24h
- |-
--index-cache.config="config":
"addresses":
- "dnssrv+_client._tcp.<MEMCACHED_SERVICE>.thanos.svc.cluster.local"
"dns_provider_update_interval": "10s"
"max_async_buffer_size": 10000
"max_async_concurrency": 20
"max_get_multi_batch_size": 0
"max_get_multi_concurrency": 100
"max_idle_connections": 100
"max_item_size": "1MiB"
"timeout": "500ms"
"type": "memcached"
- |-
--store.caching-bucket.config="blocks_iter_ttl": "5m"
"chunk_object_attrs_ttl": "24h"
"chunk_subrange_size": 16000
"chunk_subrange_ttl": "24h"
"config":
"addresses":
- "dnssrv+_client._tcp.<MEMCACHED_SERVICE>.thanos.svc.cluster.local"
"dns_provider_update_interval": "10s"
"max_async_buffer_size": 10000
"max_async_concurrency": 20
"max_get_multi_batch_size": 0
"max_get_multi_concurrency": 100
"max_idle_connections": 100
"max_item_size": "1MiB"
"timeout": "500ms"
"max_chunks_get_range_requests": 3
"metafile_content_ttl": "24h"
"metafile_doesnt_exist_ttl": "15m"
"metafile_exists_ttl": "2h"
"metafile_max_size": "1MiB"
"type": "memcached"
- |-
--tracing.config="config":
"sampler_param": 2
"sampler_type": "ratelimiting"
"service_name": "thanos-store"
"type": "JAEGER"
- |
--selector.relabel-config=
- action: hashmod
source_labels: ["__block_id"]
target_label: shard
modulus: 3
- action: keep
source_labels: ["shard"]
regex: 2
env:
- name: OBJSTORE_CONFIG
valueFrom:
secretKeyRef:
key: thanos.yaml
name: thanos-objectstorage
- name: HOST_IP_ADDRESS
valueFrom:
fieldRef:
fieldPath: status.hostIP
image: quay.io/thanos/thanos:v0.30.2
imagePullPolicy: IfNotPresent
livenessProbe:
failureThreshold: 8
httpGet:
path: /-/healthy
port: 10902
scheme: HTTP
periodSeconds: 30
timeoutSeconds: 1
name: thanos-store
ports:
- containerPort: 10901
name: grpc
- containerPort: 10902
name: http
readinessProbe:
failureThreshold: 20
httpGet:
path: /-/ready
port: 10902
scheme: HTTP
periodSeconds: 5
resources:
limits:
cpu: 0.42
memory: 420Mi
requests:
cpu: 0.123
memory: 123Mi
securityContext:
allowPrivilegeEscalation: false
capabilities:
drop:
- ALL
readOnlyRootFilesystem: true
runAsGroup: 65532
runAsNonRoot: true
runAsUser: 65534
seccompProfile:
type: RuntimeDefault
terminationMessagePolicy: FallbackToLogsOnError
volumeMounts:
- mountPath: /var/thanos/store
name: data
readOnly: false
nodeSelector:
kubernetes.io/os: linux
securityContext:
fsGroup: 65534
runAsGroup: 65532
runAsNonRoot: true
runAsUser: 65534
seccompProfile:
type: RuntimeDefault
serviceAccountName: thanos-store
terminationGracePeriodSeconds: 120
volumes: []
volumeClaimTemplates:
- metadata:
labels:
app.kubernetes.io/component: object-store-gateway
app.kubernetes.io/instance: thanos-store-2
app.kubernetes.io/name: thanos-store
store.thanos.io/shard: shard-2
name: data
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 10Gi

View File

@ -0,0 +1,11 @@
apiVersion: v1
kind: ServiceAccount
metadata:
annotations: {}
labels:
app.kubernetes.io/component: object-store-gateway
app.kubernetes.io/instance: thanos-store
app.kubernetes.io/name: thanos-store
app.kubernetes.io/version: v0.30.2
name: thanos-store
namespace: thanos

View File

@ -0,0 +1,30 @@
apiVersion: monitoring.coreos.com/v1
kind: ServiceMonitor
metadata:
labels:
app.kubernetes.io/component: object-store-gateway
app.kubernetes.io/instance: thanos-store
app.kubernetes.io/name: thanos-store
app.kubernetes.io/version: v0.30.2
name: thanos-store
namespace: thanos
spec:
endpoints:
- port: http
relabelings:
- action: replace
separator: /
sourceLabels:
- namespace
- pod
targetLabel: instance
- action: replace
regex: shard\-(\d+)
replacement: $1
sourceLabels:
- __meta_kubernetes_service_label_store_thanos_io_shard
targetLabel: shard
selector:
matchLabels:
app.kubernetes.io/component: object-store-gateway
app.kubernetes.io/name: thanos-store

View File

@ -5,7 +5,7 @@ metadata:
app.kubernetes.io/component: object-store-gateway
app.kubernetes.io/instance: thanos-store
app.kubernetes.io/name: thanos-store
app.kubernetes.io/version: master-2020-05-24-079ad427
app.kubernetes.io/version: v0.30.2
name: thanos-store
namespace: thanos
spec:
@ -22,7 +22,7 @@ spec:
app.kubernetes.io/component: object-store-gateway
app.kubernetes.io/instance: thanos-store
app.kubernetes.io/name: thanos-store
app.kubernetes.io/version: master-2020-05-24-079ad427
app.kubernetes.io/version: v0.30.2
spec:
affinity:
podAntiAffinity:
@ -45,17 +45,66 @@ spec:
containers:
- args:
- store
- --log.level=info
- --log.format=logfmt
- --data-dir=/var/thanos/store
- --grpc-address=0.0.0.0:10901
- --http-address=0.0.0.0:10902
- --objstore.config=$(OBJSTORE_CONFIG)
- --ignore-deletion-marks-delay=24h
- |-
--index-cache.config="config":
"addresses":
- "dnssrv+_client._tcp.<MEMCACHED_SERVICE>.thanos.svc.cluster.local"
"dns_provider_update_interval": "10s"
"max_async_buffer_size": 10000
"max_async_concurrency": 20
"max_get_multi_batch_size": 0
"max_get_multi_concurrency": 100
"max_idle_connections": 100
"max_item_size": "1MiB"
"timeout": "500ms"
"type": "memcached"
- |-
--store.caching-bucket.config="blocks_iter_ttl": "5m"
"chunk_object_attrs_ttl": "24h"
"chunk_subrange_size": 16000
"chunk_subrange_ttl": "24h"
"config":
"addresses":
- "dnssrv+_client._tcp.<MEMCACHED_SERVICE>.thanos.svc.cluster.local"
"dns_provider_update_interval": "10s"
"max_async_buffer_size": 10000
"max_async_concurrency": 20
"max_get_multi_batch_size": 0
"max_get_multi_concurrency": 100
"max_idle_connections": 100
"max_item_size": "1MiB"
"timeout": "500ms"
"max_chunks_get_range_requests": 3
"metafile_content_ttl": "24h"
"metafile_doesnt_exist_ttl": "15m"
"metafile_exists_ttl": "2h"
"metafile_max_size": "1MiB"
"type": "memcached"
- |-
--tracing.config="config":
"sampler_param": 2
"sampler_type": "ratelimiting"
"service_name": "thanos-store"
"type": "JAEGER"
env:
- name: OBJSTORE_CONFIG
valueFrom:
secretKeyRef:
key: thanos.yaml
name: thanos-objectstorage
image: quay.io/thanos/thanos:master-2020-05-24-079ad427
- name: HOST_IP_ADDRESS
valueFrom:
fieldRef:
fieldPath: status.hostIP
image: quay.io/thanos/thanos:v0.30.2
imagePullPolicy: IfNotPresent
livenessProbe:
failureThreshold: 8
httpGet:
@ -63,6 +112,7 @@ spec:
port: 10902
scheme: HTTP
periodSeconds: 30
timeoutSeconds: 1
name: thanos-store
ports:
- containerPort: 10901
@ -76,11 +126,39 @@ spec:
port: 10902
scheme: HTTP
periodSeconds: 5
resources:
limits:
cpu: 0.42
memory: 420Mi
requests:
cpu: 0.123
memory: 123Mi
securityContext:
allowPrivilegeEscalation: false
capabilities:
drop:
- ALL
readOnlyRootFilesystem: true
runAsGroup: 65532
runAsNonRoot: true
runAsUser: 65534
seccompProfile:
type: RuntimeDefault
terminationMessagePolicy: FallbackToLogsOnError
volumeMounts:
- mountPath: /var/thanos/store
name: data
readOnly: false
nodeSelector:
kubernetes.io/os: linux
securityContext:
fsGroup: 65534
runAsGroup: 65532
runAsNonRoot: true
runAsUser: 65534
seccompProfile:
type: RuntimeDefault
serviceAccountName: thanos-store
terminationGracePeriodSeconds: 120
volumes: []
volumeClaimTemplates:

View File

@ -2,6 +2,7 @@ apiVersion: apps/v1
kind: Deployment
metadata:
name: minio
namespace: thanos
spec:
selector:
matchLabels:
@ -14,22 +15,25 @@ spec:
app.kubernetes.io/name: minio
spec:
containers:
- name: minio
image: minio/minio
command:
- command:
- /bin/sh
- -c
- "mkdir -p /storage/thanos && /usr/bin/minio server /storage"
- |
mkdir -p /storage/thanos && \
/usr/bin/docker-entrypoint.sh minio server /storage
env:
- name: MINIO_ACCESS_KEY
value: "minio"
- name: MINIO_SECRET_KEY
value: "minio123"
- name: MINIO_ROOT_USER
value: minio
- name: MINIO_ROOT_PASSWORD
value: minio123
image: minio/minio:RELEASE.2023-05-27T05-56-19Z
imagePullPolicy: IfNotPresent
name: minio
ports:
- containerPort: 9000
volumeMounts:
- name: storage
mountPath: "/storage"
- mountPath: /storage
name: storage
volumes:
- name: storage
persistentVolumeClaim:

View File

@ -1,13 +1,13 @@
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: minio
namespace: thanos
labels:
app.kubernetes.io/name: minio
name: minio
namespace: thanos
spec:
accessModes:
- ReadWriteOnce
- ReadWriteOnce
resources:
requests:
storage: 10Gi
storage: 5Gi

View File

@ -2,13 +2,14 @@ apiVersion: v1
kind: Secret
metadata:
name: thanos-objectstorage
type: Opaque
namespace: thanos
stringData:
thanos.yaml: |-
thanos.yaml: |
type: s3
config:
bucket: thanos
endpoint: minio:9000
endpoint: minio.thanos.svc.cluster.local:9000
insecure: true
access_key: minio
secret_key: minio123
type: Opaque

View File

@ -2,11 +2,12 @@ apiVersion: v1
kind: Service
metadata:
name: minio
namespace: thanos
spec:
type: ClusterIP
ports:
- port: 9000
targetPort: 9000
protocol: TCP
- port: 9000
protocol: TCP
targetPort: 9000
selector:
app.kubernetes.io/name: minio
type: ClusterIP

View File

@ -1,13 +1,10 @@
local k = import 'ksonnet/ksonnet.beta.4/k.libsonnet';
local sts = k.apps.v1.statefulSet;
local deployment = k.apps.v1.deployment;
local t = (import 'kube-thanos/kube-thanos-receive.libsonnet');
local receive = import 'kube-thanos/kube-thanos-receive.libsonnet';
t.receive {
receive({
local tr = self,
name:: 'thanos-receive',
namespace:: 'observability',
version:: 'master-2020-05-24-079ad427',
version:: 'v0.24.0',
image:: 'quay.io/thanos/thanos:v' + tr.version,
replicas:: 3,
replicationFactor:: 3,
@ -18,4 +15,4 @@ t.receive {
pvcTemplate+:: {
size: '50G',
},
}
})

View File

@ -1,16 +1,5 @@
{
"version": 1,
"dependencies": [
{
"source": {
"git": {
"remote": "https://github.com/ksonnet/ksonnet-lib",
"subdir": ""
}
},
"version": "master",
"name": "ksonnet"
}
],
"dependencies": [],
"legacyImports": true
}

View File

@ -0,0 +1,212 @@
// These are the defaults for this components configuration.
// When calling the function to generate the component's manifest,
// you can pass an object structured like the default to overwrite default values.
local defaults = {
local defaults = self,
name: 'thanos-bucket-replicate',
namespace: error 'must provide namespace',
version: error 'must provide version',
image: error 'must provide image',
imagePullPolicy: 'IfNotPresent',
objectStorageConfig: error 'must provide objectStorageConfig',
objectStorageToConfig: error 'must provide objectStorageToConfig', // Destination object store configuration.
resources: {},
logLevel: 'info',
logFormat: 'logfmt',
ports: {
http: 10902,
},
tracing: {},
minTime: '',
maxTime: '',
compactionLevels: [],
resolutions: [],
extraEnv: [],
commonLabels:: {
'app.kubernetes.io/name': 'thanos-bucket-replicate',
'app.kubernetes.io/instance': defaults.name,
'app.kubernetes.io/version': defaults.version,
'app.kubernetes.io/component': 'object-store-bucket-replicate',
},
podLabelSelector:: {
[labelName]: defaults.commonLabels[labelName]
for labelName in std.objectFields(defaults.commonLabels)
if labelName != 'app.kubernetes.io/version'
},
securityContext:: {
fsGroup: 65534,
runAsUser: 65534,
runAsGroup: 65532,
runAsNonRoot: true,
seccompProfile: { type: 'RuntimeDefault' },
},
securityContextContainer:: {
runAsUser: defaults.securityContext.runAsUser,
runAsGroup: defaults.securityContext.runAsGroup,
runAsNonRoot: defaults.securityContext.runAsNonRoot,
seccompProfile: defaults.securityContext.seccompProfile,
allowPrivilegeEscalation: false,
readOnlyRootFilesystem: true,
capabilities: { drop: ['ALL'] },
},
serviceAccountAnnotations:: {},
};
function(params) {
local tbr = self,
// Combine the defaults and the passed params to make the component's config.
config:: defaults + params,
// Safety checks for combined config of defaults and params
assert std.isNumber(tbr.config.replicas) && tbr.config.replicas >= 0 : 'thanos bucket replicate replicas has to be number >= 0',
assert std.isObject(tbr.config.resources),
service: {
apiVersion: 'v1',
kind: 'Service',
metadata: {
name: tbr.config.name,
namespace: tbr.config.namespace,
labels: tbr.config.commonLabels,
},
spec: {
ports: [
{
assert std.isString(name),
assert std.isNumber(tbr.config.ports[name]),
name: name,
port: tbr.config.ports[name],
targetPort: tbr.config.ports[name],
}
for name in std.objectFields(tbr.config.ports)
],
selector: tbr.config.podLabelSelector,
},
},
serviceAccount: {
apiVersion: 'v1',
kind: 'ServiceAccount',
metadata: {
name: tbr.config.name,
namespace: tbr.config.namespace,
labels: tbr.config.commonLabels,
annotations: tbr.config.serviceAccountAnnotations,
},
},
deployment:
local container = {
name: 'thanos-bucket-replicate',
image: tbr.config.image,
imagePullPolicy: tbr.config.imagePullPolicy,
args: [
'tools',
'bucket',
'replicate',
'--log.level=' + tbr.config.logLevel,
'--log.format=' + tbr.config.logFormat,
'--objstore.config=$(OBJSTORE_CONFIG)',
'--objstore-to.config=$(OBJSTORE_TO_CONFIG)',
] + (
if std.length(tbr.config.tracing) > 0 then [
'--tracing.config=' + std.manifestYamlDoc(
{ config+: { service_name: defaults.name } } + tbr.config.tracing
),
] else []
) + (
if std.length(tbr.config.minTime) > 0 then [
'--min-time=' + tbr.config.minTime,
] else []
) + (
if std.length(tbr.config.maxTime) > 0 then [
'--max-time=' + tbr.config.maxTime,
] else []
) + (
if std.length(tbr.config.compactionLevels) > 0 then [
'--compaction=%d' % compactionLevel
for compactionLevel in tbr.config.compactionLevels
] else []
) + (
if std.length(tbr.config.resolutions) > 0 then [
'--resolution=%s' % resolution
for resolution in tbr.config.resolutions
] else []
),
env: [
{ name: 'OBJSTORE_CONFIG', valueFrom: { secretKeyRef: {
key: tbr.config.objectStorageConfig.key,
name: tbr.config.objectStorageConfig.name,
} } },
{ name: 'OBJSTORE_TO_CONFIG', valueFrom: { secretKeyRef: {
key: tbr.config.objectStorageToConfig.key,
name: tbr.config.objectStorageToConfig.name,
} } },
{
// Inject the host IP to make configuring tracing convenient.
name: 'HOST_IP_ADDRESS',
valueFrom: {
fieldRef: {
fieldPath: 'status.hostIP',
},
},
},
] + (
if std.length(tbr.config.extraEnv) > 0 then tbr.config.extraEnv else []
),
ports: [
{ name: name, containerPort: tbr.config.ports[name] }
for name in std.objectFields(tbr.config.ports)
],
livenessProbe: { failureThreshold: 4, periodSeconds: 30, httpGet: {
scheme: 'HTTP',
port: tbr.config.ports.http,
path: '/-/healthy',
} },
readinessProbe: { failureThreshold: 20, periodSeconds: 5, httpGet: {
scheme: 'HTTP',
port: tbr.config.ports.http,
path: '/-/ready',
} },
resources: if tbr.config.resources != {} then tbr.config.resources else {},
terminationMessagePolicy: 'FallbackToLogsOnError',
volumeMounts: if std.objectHas(tbr.config.objectStorageConfig, 'tlsSecretName') && std.length(tbr.config.objectStorageConfig.tlsSecretName) > 0 then [
{ name: 'tls-secret', mountPath: tbr.config.objectStorageConfig.tlsSecretMountPath },
] else [],
};
{
apiVersion: 'apps/v1',
kind: 'Deployment',
metadata: {
name: tbr.config.name,
namespace: tbr.config.namespace,
labels: tbr.config.commonLabels,
},
spec: {
replicas: 1,
selector: { matchLabels: tbr.config.podLabelSelector },
template: {
metadata: { labels: tbr.config.commonLabels },
spec: {
serviceAccountName: tbr.serviceAccount.metadata.name,
securityContext: tbr.config.securityContext,
containers: [container],
volumes: if std.objectHas(tbr.config.objectStorageConfig, 'tlsSecretName') && std.length(tbr.config.objectStorageConfig.tlsSecretName) > 0 then [{
name: 'tls-secret',
secret: { secretName: tbr.config.objectStorageConfig.tlsSecretName },
}] else [],
terminationGracePeriodSeconds: 120,
nodeSelector: {
'kubernetes.io/os': 'linux',
},
},
},
},
},
}

View File

@ -1,103 +1,193 @@
local k = import 'ksonnet/ksonnet.beta.4/k.libsonnet';
// These are the defaults for this components configuration.
// When calling the function to generate the component's manifest,
// you can pass an object structured like the default to overwrite default values.
local defaults = {
local defaults = self,
name: 'thanos-bucket',
namespace: error 'must provide namespace',
version: error 'must provide version',
image: error 'must provide image',
imagePullPolicy: 'IfNotPresent',
objectStorageConfig: error 'must provide objectStorageConfig',
resources: {},
logLevel: 'info',
logFormat: 'logfmt',
ports: {
http: 10902,
},
tracing: {},
extraEnv: [],
{
commonLabels:: {
'app.kubernetes.io/name': 'thanos-bucket',
'app.kubernetes.io/instance': defaults.name,
'app.kubernetes.io/version': defaults.version,
'app.kubernetes.io/component': 'object-store-bucket-debugging',
},
podLabelSelector:: {
[labelName]: defaults.commonLabels[labelName]
for labelName in std.objectFields(defaults.commonLabels)
if labelName != 'app.kubernetes.io/version'
},
securityContext:: {
fsGroup: 65534,
runAsUser: 65534,
runAsGroup: 65532,
runAsNonRoot: true,
seccompProfile: { type: 'RuntimeDefault' },
},
securityContextContainer:: {
runAsUser: defaults.securityContext.runAsUser,
runAsGroup: defaults.securityContext.runAsGroup,
runAsNonRoot: defaults.securityContext.runAsNonRoot,
seccompProfile: defaults.securityContext.seccompProfile,
allowPrivilegeEscalation: false,
readOnlyRootFilesystem: true,
capabilities: { drop: ['ALL'] },
},
serviceAccountAnnotations:: {},
};
function(params) {
local tb = self,
config:: {
name: error 'must provide name',
namespace: error 'must provide namespace',
version: error 'must provide version',
image: error 'must provide image',
objectStorageConfig: error 'must provide objectStorageConfig',
// Combine the defaults and the passed params to make the component's config.
config:: defaults + params,
// Safety checks for combined config of defaults and params
assert std.isNumber(tb.config.replicas) && tb.config.replicas >= 0 : 'thanos bucket replicas has to be number >= 0',
assert std.isObject(tb.config.resources),
commonLabels:: {
'app.kubernetes.io/name': 'thanos-bucket',
'app.kubernetes.io/instance': tb.config.name,
'app.kubernetes.io/version': tb.config.version,
'app.kubernetes.io/component': 'object-store-bucket-debugging',
service: {
apiVersion: 'v1',
kind: 'Service',
metadata: {
name: tb.config.name,
namespace: tb.config.namespace,
labels: tb.config.commonLabels,
},
spec: {
ports: [
{
assert std.isString(name),
assert std.isNumber(tb.config.ports[name]),
podLabelSelector:: {
[labelName]: tb.config.commonLabels[labelName]
for labelName in std.objectFields(tb.config.commonLabels)
if !std.setMember(labelName, ['app.kubernetes.io/version'])
name: name,
port: tb.config.ports[name],
targetPort: tb.config.ports[name],
}
for name in std.objectFields(tb.config.ports)
],
selector: tb.config.podLabelSelector,
},
},
service:
local service = k.core.v1.service;
local ports = service.mixin.spec.portsType;
service.new(
tb.config.name,
tb.config.podLabelSelector,
[ports.newNamed('http', 10902, 'http')],
) +
service.mixin.metadata.withNamespace(tb.config.namespace) +
service.mixin.metadata.withLabels(tb.config.commonLabels),
serviceAccount: {
apiVersion: 'v1',
kind: 'ServiceAccount',
metadata: {
name: tb.config.name,
namespace: tb.config.namespace,
labels: tb.config.commonLabels,
annotations: tb.config.serviceAccountAnnotations,
},
},
deployment:
local deployment = k.apps.v1.deployment;
local container = deployment.mixin.spec.template.spec.containersType;
local containerEnv = container.envType;
local c =
container.new('thanos-bucket', tb.config.image) +
container.withTerminationMessagePolicy('FallbackToLogsOnError') +
container.withArgs([
local container = {
name: 'thanos-bucket',
image: tb.config.image,
imagePullPolicy: tb.config.imagePullPolicy,
args: [
'tools',
'bucket',
'web',
'--log.level=' + tb.config.logLevel,
'--log.format=' + tb.config.logFormat,
'--objstore.config=$(OBJSTORE_CONFIG)',
]) +
container.withEnv([
containerEnv.fromSecretRef(
'OBJSTORE_CONFIG',
tb.config.objectStorageConfig.name,
tb.config.objectStorageConfig.key,
),
]) +
container.withPorts([
{ name: 'http', containerPort: tb.service.spec.ports[0].port },
]) +
container.mixin.livenessProbe +
container.mixin.livenessProbe.withPeriodSeconds(30) +
container.mixin.livenessProbe.withFailureThreshold(4) +
container.mixin.livenessProbe.httpGet.withPort(tb.service.spec.ports[0].port) +
container.mixin.livenessProbe.httpGet.withScheme('HTTP') +
container.mixin.livenessProbe.httpGet.withPath('/-/healthy') +
container.mixin.readinessProbe +
container.mixin.readinessProbe.withPeriodSeconds(5) +
container.mixin.readinessProbe.withFailureThreshold(20) +
container.mixin.readinessProbe.httpGet.withPort(tb.service.spec.ports[0].port) +
container.mixin.readinessProbe.httpGet.withScheme('HTTP') +
container.mixin.readinessProbe.httpGet.withPath('/-/ready');
] + (
if std.length(tb.config.tracing) > 0 then [
'--tracing.config=' + std.manifestYamlDoc(
{ config+: { service_name: defaults.name } } + tb.config.tracing
),
] else []
) + (
if std.objectHas(tb.config, 'label') then [
'--label=' + tb.config.label,
] else []
) + (
if std.objectHas(tb.config, 'refresh') then [
'--refresh=' + tb.config.refresh,
] else []
),
env: [
{ name: 'OBJSTORE_CONFIG', valueFrom: { secretKeyRef: {
key: tb.config.objectStorageConfig.key,
name: tb.config.objectStorageConfig.name,
} } },
{
// Inject the host IP to make configuring tracing convenient.
name: 'HOST_IP_ADDRESS',
valueFrom: {
fieldRef: {
fieldPath: 'status.hostIP',
},
},
},
] + (
if std.length(tb.config.extraEnv) > 0 then tb.config.extraEnv else []
),
ports: [
{ name: name, containerPort: tb.config.ports[name] }
for name in std.objectFields(tb.config.ports)
],
livenessProbe: { failureThreshold: 4, periodSeconds: 30, httpGet: {
scheme: 'HTTP',
port: tb.config.ports.http,
path: '/-/healthy',
} },
readinessProbe: { failureThreshold: 20, periodSeconds: 5, httpGet: {
scheme: 'HTTP',
port: tb.config.ports.http,
path: '/-/ready',
} },
resources: if tb.config.resources != {} then tb.config.resources else {},
securityContext: tb.config.securityContextContainer,
terminationMessagePolicy: 'FallbackToLogsOnError',
volumeMounts: if std.objectHas(tb.config.objectStorageConfig, 'tlsSecretName') && std.length(tb.config.objectStorageConfig.tlsSecretName) > 0 then [
{ name: 'tls-secret', mountPath: tb.config.objectStorageConfig.tlsSecretMountPath },
] else [],
};
deployment.new(tb.config.name, 1, c, tb.config.commonLabels) +
deployment.mixin.metadata.withNamespace(tb.config.namespace) +
deployment.mixin.metadata.withLabels(tb.config.commonLabels) +
deployment.mixin.spec.selector.withMatchLabels(tb.config.podLabelSelector) +
deployment.mixin.spec.template.spec.withTerminationGracePeriodSeconds(120),
withResources:: {
local tb = self,
config+:: {
resources: error 'must provide resources',
},
deployment+: {
spec+: {
template+: {
spec+: {
containers: [
if c.name == 'thanos-bucket' then c {
resources: tb.config.resources,
} else c
for c in super.containers
],
{
apiVersion: 'apps/v1',
kind: 'Deployment',
metadata: {
name: tb.config.name,
namespace: tb.config.namespace,
labels: tb.config.commonLabels,
},
spec: {
replicas: 1,
selector: { matchLabels: tb.config.podLabelSelector },
template: {
metadata: { labels: tb.config.commonLabels },
spec: {
serviceAccountName: tb.serviceAccount.metadata.name,
securityContext: tb.config.securityContext,
containers: [container],
volumes: if std.objectHas(tb.config.objectStorageConfig, 'tlsSecretName') && std.length(tb.config.objectStorageConfig.tlsSecretName) > 0 then [{
name: 'tls-secret',
secret: { secretName: tb.config.objectStorageConfig.tlsSecretName },
}] else [],
terminationGracePeriodSeconds: 120,
nodeSelector: {
'kubernetes.io/os': 'linux',
},
},
},
},
},
},
}

View File

@ -0,0 +1,63 @@
// These are the defaults for this components configuration.
// When calling the function to generate the component's manifest,
// you can pass an object structured like the default to overwrite default values.
{
local defaults = self,
name: 'thanos-compact',
namespace: error 'must provide namespace',
version: error 'must provide version',
image: error 'must provide image',
imagePullPolicy: 'IfNotPresent',
objectStorageConfig: error 'must provide objectStorageConfig',
resources: {},
logLevel: 'info',
logFormat: 'logfmt',
serviceMonitor: false,
volumeClaimTemplate: {},
retentionResolutionRaw: '0d',
retentionResolution5m: '0d',
retentionResolution1h: '0d',
compactConcurrency: 1,
deduplicationReplicaLabels: [],
deleteDelay: '48h',
disableDownsampling: false,
downsampleConcurrency: 1,
ports: {
http: 10902,
},
tracing: {},
extraEnv: [],
commonLabels:: {
'app.kubernetes.io/name': 'thanos-compact',
'app.kubernetes.io/instance': defaults.name,
'app.kubernetes.io/version': defaults.version,
'app.kubernetes.io/component': 'database-compactor',
},
podLabelSelector:: {
[labelName]: defaults.commonLabels[labelName]
for labelName in std.objectFields(defaults.commonLabels)
if labelName != 'app.kubernetes.io/version'
},
securityContext:: {
fsGroup: 65534,
runAsUser: 65534,
runAsGroup: 65532,
runAsNonRoot: true,
seccompProfile: { type: 'RuntimeDefault' },
},
securityContextContainer:: {
runAsUser: defaults.securityContext.runAsUser,
runAsGroup: defaults.securityContext.runAsGroup,
runAsNonRoot: defaults.securityContext.runAsNonRoot,
seccompProfile: defaults.securityContext.seccompProfile,
allowPrivilegeEscalation: false,
readOnlyRootFilesystem: true,
capabilities: { drop: ['ALL'] },
},
serviceAccountAnnotations:: {},
}

View File

@ -0,0 +1,109 @@
local compactConfigDefaults = import 'kube-thanos/kube-thanos-compact-default-params.libsonnet';
local compact = import 'kube-thanos/kube-thanos-compact.libsonnet';
// These are the defaults for this components configuration.
// When calling the function to generate the component's manifest,
// you can pass an object structured like the default to overwrite default values.
local defaults = compactConfigDefaults {
shards: 1,
};
function(params)
// Combine the defaults and the passed params to make the component's config.
local config = defaults + params;
// Safety checks for combined config of defaults and params
assert std.isNumber(config.shards) && config.shards >= 0 : 'thanos compact shards has to be number >= 0';
assert std.isArray(config.sourceLabels) && std.length(config.sourceLabels) > 0;
{ config:: config } + {
local allShards = self,
serviceAccount: {
apiVersion: 'v1',
kind: 'ServiceAccount',
metadata: {
name: config.name,
namespace: config.namespace,
labels: config.commonLabels,
annotations: config.serviceAccountAnnotations,
},
},
shards: {
['shard' + i]: compact(config {
name+: '-%d' % i,
commonLabels+:: { 'compact.thanos.io/shard': 'shard-' + i },
}) {
serviceAccount: null, // one service account for all compactors
serviceMonitor: null, // one service monitor for all compactors
statefulSet+: {
spec+: {
template+: {
spec+: {
serviceAccountName: allShards.serviceAccount.metadata.name,
containers: [
if c.name == 'thanos-compact' then c {
args+: [
|||
--selector.relabel-config=
- action: hashmod
source_labels: %s
target_label: shard
modulus: %d
- action: keep
source_labels: ["shard"]
regex: %d
||| % [config.sourceLabels, config.shards, i],
],
} else c
for c in super.containers
],
},
},
},
},
}
for i in std.range(0, config.shards - 1)
},
} + {
serviceMonitor: if config.serviceMonitor == true then {
apiVersion: 'monitoring.coreos.com/v1',
kind: 'ServiceMonitor',
metadata+: {
name: config.name,
namespace: config.namespace,
labels: config.commonLabels,
},
spec: {
selector: {
matchLabels: {
[key]: config.podLabelSelector[key]
for key in std.objectFields(config.podLabelSelector)
if key != 'app.kubernetes.io/instance'
},
},
endpoints: [
{
port: 'http',
relabelings: [
{
action: 'replace',
sourceLabels: ['namespace', 'pod'],
separator: '/',
targetLabel: 'instance',
},
{
action: 'replace',
sourceLabels: ['__meta_kubernetes_service_label_compact_thanos_io_shard'],
regex: 'shard\\-(\\d+)',
replacement: '$1',
targetLabel: 'shard',
},
],
},
],
},
},
}

View File

@ -1,255 +1,214 @@
local k = import 'ksonnet/ksonnet.beta.4/k.libsonnet';
local defaults = import 'kube-thanos/kube-thanos-compact-default-params.libsonnet';
{
function(params) {
local tc = self,
config:: {
name: error 'must provide name',
namespace: error 'must provide namespace',
version: error 'must provide version',
image: error 'must provide image',
objectStorageConfig: error 'must provide objectStorageConfig',
// Combine the defaults and the passed params to make the component's config.
config:: defaults + params,
// Safety checks for combined config of defaults and params
assert std.isNumber(tc.config.compactConcurrency),
assert std.isNumber(tc.config.downsampleConcurrency),
assert std.isNumber(tc.config.replicas) && (tc.config.replicas == 0 || tc.config.replicas == 1) : 'thanos compact replicas can only be 0 or 1',
assert std.isObject(tc.config.resources),
assert std.isObject(tc.config.volumeClaimTemplate),
assert !std.objectHas(tc.config.volumeClaimTemplate, 'spec') || std.assertEqual(tc.config.volumeClaimTemplate.spec.accessModes, ['ReadWriteOnce']) : 'thanos compact PVC accessMode can only be ReadWriteOnce',
assert std.isBoolean(tc.config.serviceMonitor),
assert std.isArray(tc.config.deduplicationReplicaLabels),
commonLabels:: {
'app.kubernetes.io/name': 'thanos-compact',
'app.kubernetes.io/instance': tc.config.name,
'app.kubernetes.io/version': tc.config.version,
'app.kubernetes.io/component': 'database-compactor',
service: {
apiVersion: 'v1',
kind: 'Service',
metadata: {
name: tc.config.name,
namespace: tc.config.namespace,
labels: tc.config.commonLabels,
},
spec: {
clusterIP: 'None',
selector: tc.config.podLabelSelector,
ports: [
{
assert std.isString(name),
assert std.isNumber(tc.config.ports[name]),
podLabelSelector:: {
[labelName]: tc.config.commonLabels[labelName]
for labelName in std.objectFields(tc.config.commonLabels)
if !std.setMember(labelName, ['app.kubernetes.io/version'])
name: name,
port: tc.config.ports[name],
targetPort: tc.config.ports[name],
}
for name in std.objectFields(tc.config.ports)
],
},
},
service:
local service = k.core.v1.service;
local ports = service.mixin.spec.portsType;
service.new(
tc.config.name,
tc.config.podLabelSelector,
[
ports.newNamed('http', 10902, 'http'),
],
) +
service.mixin.metadata.withNamespace(tc.config.namespace) +
service.mixin.metadata.withLabels(tc.config.commonLabels),
serviceAccount: {
apiVersion: 'v1',
kind: 'ServiceAccount',
metadata: {
name: tc.config.name,
namespace: tc.config.namespace,
labels: tc.config.commonLabels,
annotations: tc.config.serviceAccountAnnotations,
},
},
statefulSet:
local statefulSet = k.apps.v1.statefulSet;
local volume = statefulSet.mixin.spec.template.spec.volumesType;
local container = statefulSet.mixin.spec.template.spec.containersType;
local containerEnv = container.envType;
local containerVolumeMount = container.volumeMountsType;
local c =
container.new('thanos-compact', tc.config.image) +
container.withTerminationMessagePolicy('FallbackToLogsOnError') +
container.withArgs([
local c = {
name: 'thanos-compact',
image: tc.config.image,
imagePullPolicy: tc.config.imagePullPolicy,
args: [
'compact',
'--wait',
'--log.level=' + tc.config.logLevel,
'--log.format=' + tc.config.logFormat,
'--objstore.config=$(OBJSTORE_CONFIG)',
'--data-dir=/var/thanos/compact',
'--debug.accept-malformed-index',
]) +
container.withEnv([
containerEnv.fromSecretRef(
'OBJSTORE_CONFIG',
tc.config.objectStorageConfig.name,
tc.config.objectStorageConfig.key,
),
]) +
container.withPorts([
{ name: 'http', containerPort: tc.service.spec.ports[0].port },
]) +
container.withVolumeMounts([
containerVolumeMount.new('data', '/var/thanos/compact', false),
]) +
container.mixin.livenessProbe +
container.mixin.livenessProbe.withPeriodSeconds(30) +
container.mixin.livenessProbe.withFailureThreshold(4) +
container.mixin.livenessProbe.httpGet.withPort(tc.service.spec.ports[0].port) +
container.mixin.livenessProbe.httpGet.withScheme('HTTP') +
container.mixin.livenessProbe.httpGet.withPath('/-/healthy') +
container.mixin.readinessProbe +
container.mixin.readinessProbe.withPeriodSeconds(5) +
container.mixin.readinessProbe.withFailureThreshold(20) +
container.mixin.readinessProbe.httpGet.withPort(tc.service.spec.ports[0].port) +
container.mixin.readinessProbe.httpGet.withScheme('HTTP') +
container.mixin.readinessProbe.httpGet.withPath('/-/ready');
'--retention.resolution-raw=' + tc.config.retentionResolutionRaw,
'--retention.resolution-5m=' + tc.config.retentionResolution5m,
'--retention.resolution-1h=' + tc.config.retentionResolution1h,
'--delete-delay=' + tc.config.deleteDelay,
'--compact.concurrency=' + tc.config.compactConcurrency,
'--downsample.concurrency=' + tc.config.downsampleConcurrency,
] + (
if tc.config.disableDownsampling then ['--downsampling.disable'] else []
) + (
if std.length(tc.config.deduplicationReplicaLabels) > 0 then
[
'--deduplication.replica-label=' + l
for l in tc.config.deduplicationReplicaLabels
] else []
) + (
if std.length(tc.config.tracing) > 0 then [
'--tracing.config=' + std.manifestYamlDoc(
{ config+: { service_name: defaults.name } } + tc.config.tracing
),
] else []
),
env: [
{ name: 'OBJSTORE_CONFIG', valueFrom: { secretKeyRef: {
key: tc.config.objectStorageConfig.key,
name: tc.config.objectStorageConfig.name,
} } },
{
// Inject the host IP to make configuring tracing convenient.
name: 'HOST_IP_ADDRESS',
valueFrom: {
fieldRef: {
fieldPath: 'status.hostIP',
},
},
},
] + (
if std.length(tc.config.extraEnv) > 0 then tc.config.extraEnv else []
),
ports: [
{ name: name, containerPort: tc.config.ports[name] }
for name in std.objectFields(tc.config.ports)
],
livenessProbe: { failureThreshold: 4, periodSeconds: 30, httpGet: {
scheme: 'HTTP',
port: tc.config.ports.http,
path: '/-/healthy',
} },
readinessProbe: { failureThreshold: 20, periodSeconds: 5, httpGet: {
scheme: 'HTTP',
port: tc.config.ports.http,
path: '/-/ready',
} },
volumeMounts: [{
name: 'data',
mountPath: '/var/thanos/compact',
readOnly: false,
}] + (
if std.objectHas(tc.config.objectStorageConfig, 'tlsSecretName') && std.length(tc.config.objectStorageConfig.tlsSecretName) > 0 then [
{ name: 'tls-secret', mountPath: tc.config.objectStorageConfig.tlsSecretMountPath },
] else []
),
resources: if tc.config.resources != {} then tc.config.resources else {},
terminationMessagePolicy: 'FallbackToLogsOnError',
};
statefulSet.new(tc.config.name, tc.config.replicas, c, [], tc.config.commonLabels) +
statefulSet.mixin.metadata.withNamespace(tc.config.namespace) +
statefulSet.mixin.metadata.withLabels(tc.config.commonLabels) +
statefulSet.mixin.spec.withServiceName(tc.service.metadata.name) +
statefulSet.mixin.spec.template.spec.withTerminationGracePeriodSeconds(120) +
statefulSet.mixin.spec.template.spec.withVolumes([
volume.fromEmptyDir('data'),
]) +
statefulSet.mixin.spec.selector.withMatchLabels(tc.config.podLabelSelector) +
{
spec+: {
volumeClaimTemplates: null,
},
},
withServiceMonitor:: {
local tc = self,
serviceMonitor: {
apiVersion: 'monitoring.coreos.com/v1',
kind: 'ServiceMonitor',
metadata+: {
apiVersion: 'apps/v1',
kind: 'StatefulSet',
metadata: {
name: tc.config.name,
namespace: tc.config.namespace,
labels: tc.config.commonLabels,
},
spec: {
selector: {
matchLabels: tc.config.podLabelSelector,
},
endpoints: [
{ port: 'http' },
],
},
},
},
withVolumeClaimTemplate:: {
local tc = self,
config+:: {
volumeClaimTemplate: error 'must provide volumeClaimTemplate',
},
statefulSet+: {
spec+: {
template+: {
spec+: {
volumes: std.filter(function(v) v.name != 'data', super.volumes),
replicas: 1,
selector: { matchLabels: tc.config.podLabelSelector },
serviceName: tc.service.metadata.name,
template: {
metadata: {
labels: tc.config.commonLabels,
},
spec: {
serviceAccountName: tc.serviceAccount.metadata.name,
securityContext: tc.config.securityContext,
containers: [c],
volumes: if std.objectHas(tc.config.objectStorageConfig, 'tlsSecretName') && std.length(tc.config.objectStorageConfig.tlsSecretName) > 0 then [{
name: 'tls-secret',
secret: { secretName: tc.config.objectStorageConfig.tlsSecretName },
}] else [],
terminationGracePeriodSeconds: 120,
nodeSelector: {
'kubernetes.io/os': 'linux',
},
affinity: { podAntiAffinity: {
preferredDuringSchedulingIgnoredDuringExecution: [{
podAffinityTerm: {
namespaces: [tc.config.namespace],
topologyKey: 'kubernetes.io/hostname',
labelSelector: { matchExpressions: [{
key: 'app.kubernetes.io/name',
operator: 'In',
values: [tc.statefulSet.metadata.labels['app.kubernetes.io/name']],
}, {
key: 'app.kubernetes.io/instance',
operator: 'In',
values: [tc.statefulSet.metadata.labels['app.kubernetes.io/instance']],
}] },
},
weight: 100,
}],
} },
},
},
volumeClaimTemplates: [tc.config.volumeClaimTemplate {
volumeClaimTemplates: if std.length(tc.config.volumeClaimTemplate) > 0 then [tc.config.volumeClaimTemplate {
metadata+: {
name: 'data',
labels+: tc.config.podLabelSelector,
},
}],
}] else [],
},
},
},
withRetention:: {
local tc = self,
config+:: {
retentionResolutionRaw: error 'must provide retentionResolutionRaw',
retentionResolution5m: error 'must provide retentionResolution5m',
retentionResolution1h: error 'must provide retentionResolution1h',
serviceMonitor: if tc.config.serviceMonitor == true then {
apiVersion: 'monitoring.coreos.com/v1',
kind: 'ServiceMonitor',
metadata+: {
name: tc.config.name,
namespace: tc.config.namespace,
labels: tc.config.commonLabels,
},
statefulSet+: {
spec+: {
template+: {
spec+: {
containers: [
if c.name == 'thanos-compact' then c {
args+: [
'--retention.resolution-raw=' + tc.config.retentionResolutionRaw,
'--retention.resolution-5m=' + tc.config.retentionResolution5m,
'--retention.resolution-1h=' + tc.config.retentionResolution1h,
],
} else c
for c in super.containers
],
},
spec: {
selector: {
matchLabels: tc.config.podLabelSelector,
},
endpoints: [
{
port: 'http',
relabelings: [{
action: 'replace',
sourceLabels: ['namespace', 'pod'],
separator: '/',
targetLabel: 'instance',
}],
},
},
},
},
withDownsamplingDisabled:: {
local tc = self,
statefulSet+: {
spec+: {
template+: {
spec+: {
containers: [
if c.name == 'thanos-compact' then c {
args+: [
'--downsampling.disable',
],
} else c
for c in super.containers
],
},
},
},
},
},
withDeduplication:: {
local tc = self,
statefulSet+: {
spec+: {
template+: {
spec+: {
containers: [
if c.name == 'thanos-compact' then c {
args+: [
'--deduplication.replica-label=' + l
for l in tc.config.deduplicationReplicaLabels
],
} else c
for c in super.containers
],
},
},
},
},
},
withDeleteDelay:: {
local tc = self,
statefulSet+: {
spec+: {
template+: {
spec+: {
containers: [
if c.name == 'thanos-compact' then c {
args+: [
'--delete-delay=' + tc.config.deleteDelay,
],
} else c
for c in super.containers
],
},
},
},
},
},
withResources:: {
local tc = self,
config+:: {
resources: error 'must provide resources',
},
statefulSet+: {
spec+: {
template+: {
spec+: {
containers: [
if c.name == 'thanos-compact' then c {
resources: tc.config.resources,
} else c
for c in super.containers
],
},
},
},
],
},
},
}

View File

@ -0,0 +1,293 @@
// These are the defaults for this components configuration.
// When calling the function to generate the component's manifest,
// you can pass an object structured like the default to overwrite default values.
local defaults = {
local defaults = self,
name: 'thanos-query-frontend',
namespace: error 'must provide namespace',
version: error 'must provide version',
image: error 'must provide image',
imagePullPolicy: 'IfNotPresent',
replicas: error 'must provide replicas',
downstreamURL: error 'must provide downstreamURL',
splitInterval: '24h',
maxRetries: 5,
logQueriesLongerThan: '0',
fifoCache+:: {
config+: {
max_size: '0', // Don't limit maximum item size.
max_size_items: 2048,
validity: '6h',
},
},
queryRangeCache: {},
queryUrl: '',
labelsCache: {},
logLevel: 'info',
logFormat: 'logfmt',
resources: {},
serviceMonitor: false,
ports: {
http: 9090,
},
tracing: {},
extraEnv: [],
memcachedDefaults+:: {
config+: {
// List of memcached addresses, that will get resolved with the DNS service discovery provider.
// For DNS service discovery reference https://thanos.io/service-discovery.md/#dns-service-discovery
addresses+: error 'must provide memcached addresses',
timeout: '500ms',
max_idle_connections: 100,
max_async_concurrency: 20,
max_async_buffer_size: 10000,
max_get_multi_concurrency: 100,
max_get_multi_batch_size: 0,
dns_provider_update_interval: '10s',
},
},
commonLabels:: {
'app.kubernetes.io/name': 'thanos-query-frontend',
'app.kubernetes.io/instance': defaults.name,
'app.kubernetes.io/version': defaults.version,
'app.kubernetes.io/component': 'query-cache',
},
podLabelSelector:: {
[labelName]: defaults.commonLabels[labelName]
for labelName in std.objectFields(defaults.commonLabels)
if labelName != 'app.kubernetes.io/version'
},
securityContext:: {
fsGroup: 65534,
runAsUser: 65534,
runAsGroup: 65532,
runAsNonRoot: true,
seccompProfile: { type: 'RuntimeDefault' },
},
securityContextContainer:: {
runAsUser: defaults.securityContext.runAsUser,
runAsGroup: defaults.securityContext.runAsGroup,
runAsNonRoot: defaults.securityContext.runAsNonRoot,
seccompProfile: defaults.securityContext.seccompProfile,
allowPrivilegeEscalation: false,
readOnlyRootFilesystem: true,
capabilities: { drop: ['ALL'] },
},
serviceAccountAnnotations:: {},
};
function(params) {
local tqf = self,
// Combine the defaults and the passed params to make the component's config.
config:: defaults + params + {
queryRangeCache+:
if std.objectHas(params, 'queryRangeCache')
&& std.objectHas(params.queryRangeCache, 'type')
&& std.asciiUpper(params.queryRangeCache.type) == 'MEMCACHED' then
defaults.memcachedDefaults + params.queryRangeCache
else if std.objectHas(params, 'queryRangeCache')
&& std.objectHas(params.queryRangeCache, 'type')
&& std.asciiUpper(params.queryRangeCache.type) == 'IN-MEMORY' then
defaults.fifoCache + params.queryRangeCache
else {},
labelsCache+:
if std.objectHas(params, 'labelsCache')
&& std.objectHas(params.labelsCache, 'type')
&& std.asciiUpper(params.labelsCache.type) == 'MEMCACHED' then
defaults.memcachedDefaults + params.labelsCache
else if std.objectHas(params, 'labelsCache')
&& std.objectHas(params.labelsCache, 'type')
&& std.asciiUpper(params.labelsCache.type) == 'IN-MEMORY' then
defaults.fifoCache + params.labelsCache
else {},
},
// Safety checks for combined config of defaults and params
assert std.isNumber(tqf.config.replicas) && tqf.config.replicas >= 0 : 'thanos query frontend replicas has to be number >= 0',
assert std.isObject(tqf.config.resources),
assert std.isBoolean(tqf.config.serviceMonitor),
assert std.isNumber(tqf.config.maxRetries) && tqf.config.maxRetries >= 0 : 'thanos query frontend maxRetries has to be number >= 0',
service: {
apiVersion: 'v1',
kind: 'Service',
metadata: {
name: tqf.config.name,
namespace: tqf.config.namespace,
labels: tqf.config.commonLabels,
},
spec: {
selector: tqf.config.podLabelSelector,
ports: [
{
assert std.isString(name),
assert std.isNumber(tqf.config.ports[name]),
name: name,
port: tqf.config.ports[name],
targetPort: tqf.config.ports[name],
}
for name in std.objectFields(tqf.config.ports)
],
},
},
serviceAccount: {
apiVersion: 'v1',
kind: 'ServiceAccount',
metadata: {
name: tqf.config.name,
namespace: tqf.config.namespace,
labels: tqf.config.commonLabels,
annotations: tqf.config.serviceAccountAnnotations,
},
},
deployment:
local c = {
name: 'thanos-query-frontend',
image: tqf.config.image,
imagePullPolicy: tqf.config.imagePullPolicy,
args: [
'query-frontend',
'--log.level=' + tqf.config.logLevel,
'--log.format=' + tqf.config.logFormat,
'--query-frontend.compress-responses',
'--http-address=0.0.0.0:%d' % tqf.config.ports.http,
'--query-frontend.downstream-url=%s' % tqf.config.downstreamURL,
'--query-range.split-interval=%s' % tqf.config.splitInterval,
'--labels.split-interval=%s' % tqf.config.splitInterval,
'--query-range.max-retries-per-request=%d' % tqf.config.maxRetries,
'--labels.max-retries-per-request=%d' % tqf.config.maxRetries,
'--query-frontend.log-queries-longer-than=%s' % tqf.config.logQueriesLongerThan,
] + (
if std.length(tqf.config.queryRangeCache) > 0 then [
'--query-range.response-cache-config=' + std.manifestYamlDoc(
tqf.config.queryRangeCache
),
] else []
) + (
if std.length(tqf.config.labelsCache) > 0 then [
'--labels.response-cache-config=' + std.manifestYamlDoc(
tqf.config.labelsCache
),
] else []
) + (
if std.length(tqf.config.tracing) > 0 then [
'--tracing.config=' + std.manifestYamlDoc(
{ config+: { service_name: defaults.name } } + tqf.config.tracing
),
] else []
) + (
if tqf.config.queryUrl != '' then [
'--alert.query-url=' + tqf.config.queryUrl,
] else []
),
env: [
{
// Inject the host IP to make configuring tracing convenient.
name: 'HOST_IP_ADDRESS',
valueFrom: {
fieldRef: {
fieldPath: 'status.hostIP',
},
},
},
] + (
if std.length(tqf.config.extraEnv) > 0 then tqf.config.extraEnv else []
),
ports: [
{ name: name, containerPort: tqf.config.ports[name] }
for name in std.objectFields(tqf.config.ports)
],
livenessProbe: { failureThreshold: 4, periodSeconds: 30, httpGet: {
scheme: 'HTTP',
port: tqf.config.ports.http,
path: '/-/healthy',
} },
readinessProbe: { failureThreshold: 20, periodSeconds: 5, httpGet: {
scheme: 'HTTP',
port: tqf.config.ports.http,
path: '/-/ready',
} },
resources: if tqf.config.resources != {} then tqf.config.resources else {},
securityContext: tqf.config.securityContextContainer,
terminationMessagePolicy: 'FallbackToLogsOnError',
};
{
apiVersion: 'apps/v1',
kind: 'Deployment',
metadata: {
name: tqf.config.name,
namespace: tqf.config.namespace,
labels: tqf.config.commonLabels,
},
spec: {
replicas: tqf.config.replicas,
selector: { matchLabels: tqf.config.podLabelSelector },
template: {
metadata: { labels: tqf.config.commonLabels },
spec: {
containers: [c],
serviceAccountName: tqf.serviceAccount.metadata.name,
securityContext: tqf.config.securityContext,
terminationGracePeriodSeconds: 120,
nodeSelector: {
'kubernetes.io/os': 'linux',
},
affinity: { podAntiAffinity: {
preferredDuringSchedulingIgnoredDuringExecution: [{
podAffinityTerm: {
namespaces: [tqf.config.namespace],
topologyKey: 'kubernetes.io/hostname',
labelSelector: { matchExpressions: [{
key: 'app.kubernetes.io/name',
operator: 'In',
values: [tqf.deployment.metadata.labels['app.kubernetes.io/name']],
}] },
},
weight: 100,
}],
} },
},
},
},
},
serviceMonitor: if tqf.config.serviceMonitor == true then {
apiVersion: 'monitoring.coreos.com/v1',
kind: 'ServiceMonitor',
metadata+: {
name: tqf.config.name,
namespace: tqf.config.namespace,
labels: tqf.config.commonLabels,
},
spec: {
selector: {
matchLabels: tqf.config.podLabelSelector,
},
endpoints: [
{
port: 'http',
relabelings: [{
action: 'replace',
sourceLabels: ['namespace', 'pod'],
separator: '/',
targetLabel: 'instance',
}],
},
],
},
},
}

View File

@ -1,189 +1,294 @@
local k = import 'ksonnet/ksonnet.beta.4/k.libsonnet';
// These are the defaults for this components configuration.
// When calling the function to generate the component's manifest,
// you can pass an object structured like the default to overwrite default values.
local defaults = {
local defaults = self,
name: 'thanos-query',
namespace: error 'must provide namespace',
version: error 'must provide version',
image: error 'must provide image',
imagePullPolicy: 'IfNotPresent',
replicas: error 'must provide replicas',
replicaLabels: error 'must provide replicaLabels',
stores: ['dnssrv+_grpc._tcp.thanos-store.%s.svc.cluster.local' % defaults.namespace],
rules: [], // TODO(bwplotka): This is deprecated, switch to endpoints while ready.
externalPrefix: '',
queryUrl: '',
prefixHeader: '',
autoDownsampling: true,
useThanosEngine: false,
resources: {},
queryTimeout: '',
lookbackDelta: '',
ports: {
grpc: 10901,
http: 9090,
},
serviceMonitor: false,
logLevel: 'info',
logFormat: 'logfmt',
tracing: {},
extraEnv: [],
telemetryDurationQuantiles: '',
telemetrySamplesQuantiles: '',
telemetrySeriesQuantiles: '',
{
commonLabels:: {
'app.kubernetes.io/name': 'thanos-query',
'app.kubernetes.io/instance': defaults.name,
'app.kubernetes.io/version': defaults.version,
'app.kubernetes.io/component': 'query-layer',
},
podLabelSelector:: {
[labelName]: defaults.commonLabels[labelName]
for labelName in std.objectFields(defaults.commonLabels)
if labelName != 'app.kubernetes.io/version'
},
securityContext:: {
fsGroup: 65534,
runAsUser: 65534,
runAsGroup: 65532,
runAsNonRoot: true,
seccompProfile: { type: 'RuntimeDefault' },
},
securityContextContainer:: {
runAsUser: defaults.securityContext.runAsUser,
runAsGroup: defaults.securityContext.runAsGroup,
runAsNonRoot: defaults.securityContext.runAsNonRoot,
seccompProfile: defaults.securityContext.seccompProfile,
allowPrivilegeEscalation: false,
readOnlyRootFilesystem: true,
capabilities: { drop: ['ALL'] },
},
serviceAccountAnnotations:: {},
};
function(params) {
local tq = self,
config:: {
name: error 'must provide name',
namespace: error 'must provide namespace',
version: error 'must provide version',
image: error 'must provide image',
replicas: error 'must provide replicas',
replicaLabels: error 'must provide replica labels',
stores: error 'must provide store addresses',
// Combine the defaults and the passed params to make the component's config.
config:: defaults + params,
// Safety checks for combined config of defaults and params
assert std.isNumber(tq.config.replicas) && tq.config.replicas >= 0 : 'thanos query replicas has to be number >= 0',
assert std.isArray(tq.config.replicaLabels),
assert std.isObject(tq.config.resources),
assert std.isString(tq.config.externalPrefix),
assert std.isString(tq.config.queryTimeout),
assert std.isBoolean(tq.config.serviceMonitor),
assert std.isBoolean(tq.config.autoDownsampling),
assert std.isBoolean(tq.config.useThanosEngine),
commonLabels:: {
'app.kubernetes.io/name': 'thanos-query',
'app.kubernetes.io/instance': tq.config.name,
'app.kubernetes.io/version': tq.config.version,
'app.kubernetes.io/component': 'query-layer',
service: {
apiVersion: 'v1',
kind: 'Service',
metadata: {
name: tq.config.name,
namespace: tq.config.namespace,
labels: tq.config.commonLabels,
},
spec: {
ports: [
{
assert std.isString(name),
assert std.isNumber(tq.config.ports[name]),
podLabelSelector:: {
[labelName]: tq.config.commonLabels[labelName]
for labelName in std.objectFields(tq.config.commonLabels)
if !std.setMember(labelName, ['app.kubernetes.io/version'])
name: name,
port: tq.config.ports[name],
targetPort: tq.config.ports[name],
}
for name in std.objectFields(tq.config.ports)
],
selector: tq.config.podLabelSelector,
},
},
service:
local service = k.core.v1.service;
local ports = service.mixin.spec.portsType;
service.new(
tq.config.name,
tq.config.podLabelSelector,
[
ports.newNamed('grpc', 10901, 'grpc'),
ports.newNamed('http', 9090, 'http'),
]
) +
service.mixin.metadata.withNamespace(tq.config.namespace) +
service.mixin.metadata.withLabels(tq.config.commonLabels),
serviceAccount: {
apiVersion: 'v1',
kind: 'ServiceAccount',
metadata: {
name: tq.config.name,
namespace: tq.config.namespace,
labels: tq.config.commonLabels,
annotations: tq.config.serviceAccountAnnotations,
},
},
deployment:
local deployment = k.apps.v1.deployment;
local container = deployment.mixin.spec.template.spec.containersType;
local affinity = deployment.mixin.spec.template.spec.affinity.podAntiAffinity.preferredDuringSchedulingIgnoredDuringExecutionType;
local matchExpression = affinity.mixin.podAffinityTerm.labelSelector.matchExpressionsType;
local c = {
name: 'thanos-query',
image: tq.config.image,
imagePullPolicy: tq.config.imagePullPolicy,
args:
[
'query',
'--grpc-address=0.0.0.0:%d' % tq.config.ports.grpc,
'--http-address=0.0.0.0:%d' % tq.config.ports.http,
'--log.level=' + tq.config.logLevel,
'--log.format=' + tq.config.logFormat,
] + [
'--query.replica-label=%s' % labelName
for labelName in tq.config.replicaLabels
] + [
'--endpoint=%s' % store
for store in tq.config.stores
] + [
'--rule=%s' % store
for store in tq.config.rules
] +
(
if tq.config.externalPrefix != '' then [
'--web.external-prefix=' + tq.config.externalPrefix,
] else []
) +
(
if tq.config.prefixHeader != '' then [
'--web.prefix-header=' + tq.config.prefixHeader,
] else []
) +
(
if tq.config.queryTimeout != '' then [
'--query.timeout=' + tq.config.queryTimeout,
] else []
) +
(
if tq.config.lookbackDelta != '' then [
'--query.lookback-delta=' + tq.config.lookbackDelta,
] else []
) + (
if std.length(tq.config.tracing) > 0 then [
'--tracing.config=' + std.manifestYamlDoc(
{ config+: { service_name: defaults.name } } + tq.config.tracing
),
] else []
) + (
if tq.config.autoDownsampling then [
'--query.auto-downsampling',
] else []
) + (
if tq.config.useThanosEngine then [
'--query.promql-engine=thanos',
] else []
) + (
if tq.config.telemetryDurationQuantiles != '' then [
'--query.telemetry.request-duration-seconds-quantiles=' + std.stripChars(quantile, ' ')
for quantile in std.split(tq.config.telemetryDurationQuantiles, ',')
] else []
) + (
if tq.config.telemetrySamplesQuantiles != '' then [
'--query.telemetry.request-samples-quantiles=' + std.stripChars(quantile, ' ')
for quantile in std.split(tq.config.telemetrySamplesQuantiles, ',')
] else []
) + (
if tq.config.telemetrySeriesQuantiles != '' then [
'--query.telemetry.request-series-seconds-quantiles=' + std.stripChars(quantile, ' ')
for quantile in std.split(tq.config.telemetrySeriesQuantiles, ',')
] else []
) + (
if tq.config.queryUrl != '' then [
'--alert.query-url=' + tq.config.queryUrl,
] else []
),
env: [
{
// Inject the host IP to make configuring tracing convenient.
name: 'HOST_IP_ADDRESS',
valueFrom: {
fieldRef: {
fieldPath: 'status.hostIP',
},
},
},
] + (
if std.length(tq.config.extraEnv) > 0 then tq.config.extraEnv else []
),
ports: [
{ name: port.name, containerPort: port.port }
for port in tq.service.spec.ports
],
livenessProbe: { failureThreshold: 4, periodSeconds: 30, httpGet: {
scheme: 'HTTP',
port: tq.service.spec.ports[1].port,
path: '/-/healthy',
} },
readinessProbe: { failureThreshold: 20, periodSeconds: 5, httpGet: {
scheme: 'HTTP',
port: tq.service.spec.ports[1].port,
path: '/-/ready',
} },
resources: if tq.config.resources != {} then tq.config.resources else {},
securityContext: tq.config.securityContextContainer,
terminationMessagePolicy: 'FallbackToLogsOnError',
};
local c =
container.new('thanos-query', tq.config.image) +
container.withTerminationMessagePolicy('FallbackToLogsOnError') +
container.withArgs([
'query',
'--grpc-address=0.0.0.0:%d' % tq.service.spec.ports[0].port,
'--http-address=0.0.0.0:%d' % tq.service.spec.ports[1].port,
] + [
'--query.replica-label=%s' % labelName
for labelName in tq.config.replicaLabels
] + [
'--store=%s' % store
for store in tq.config.stores
]) +
container.withPorts([
{ name: 'grpc', containerPort: tq.service.spec.ports[0].port },
{ name: 'http', containerPort: tq.service.spec.ports[1].port },
]) +
container.mixin.livenessProbe +
container.mixin.livenessProbe.withPeriodSeconds(30) +
container.mixin.livenessProbe.withFailureThreshold(4) +
container.mixin.livenessProbe.httpGet.withPort(tq.service.spec.ports[1].port) +
container.mixin.livenessProbe.httpGet.withScheme('HTTP') +
container.mixin.livenessProbe.httpGet.withPath('/-/healthy') +
container.mixin.readinessProbe +
container.mixin.readinessProbe.withPeriodSeconds(5) +
container.mixin.readinessProbe.withFailureThreshold(20) +
container.mixin.readinessProbe.httpGet.withPort(tq.service.spec.ports[1].port) +
container.mixin.readinessProbe.httpGet.withScheme('HTTP') +
container.mixin.readinessProbe.httpGet.withPath('/-/ready');
deployment.new(tq.config.name, tq.config.replicas, c, tq.config.commonLabels) +
deployment.mixin.metadata.withNamespace(tq.config.namespace) +
deployment.mixin.metadata.withLabels(tq.config.commonLabels) +
deployment.mixin.spec.selector.withMatchLabels(tq.config.podLabelSelector) +
deployment.mixin.spec.template.spec.withTerminationGracePeriodSeconds(120) +
deployment.mixin.spec.template.spec.affinity.podAntiAffinity.withPreferredDuringSchedulingIgnoredDuringExecution([
affinity.new() +
affinity.withWeight(100) +
affinity.mixin.podAffinityTerm.withNamespaces(tq.config.namespace) +
affinity.mixin.podAffinityTerm.withTopologyKey('kubernetes.io/hostname') +
affinity.mixin.podAffinityTerm.labelSelector.withMatchExpressions([
matchExpression.new() +
matchExpression.withKey('app.kubernetes.io/name') +
matchExpression.withOperator('In') +
matchExpression.withValues([tq.deployment.metadata.labels['app.kubernetes.io/name']]),
]),
]),
withServiceMonitor:: {
local tq = self,
serviceMonitor: {
apiVersion: 'monitoring.coreos.com/v1',
kind: 'ServiceMonitor',
metadata+: {
{
apiVersion: 'apps/v1',
kind: 'Deployment',
metadata: {
name: tq.config.name,
namespace: tq.config.namespace,
labels: tq.config.commonLabels,
},
spec: {
selector: {
matchLabels: tq.config.podLabelSelector,
},
endpoints: [
{ port: 'http' },
],
},
},
},
withResources:: {
local tq = self,
config+:: {
resources: error 'must provide resources',
},
deployment+: {
spec+: {
template+: {
spec+: {
containers: [
if c.name == 'thanos-query' then c {
resources: tq.config.resources,
} else c
for c in super.containers
],
replicas: tq.config.replicas,
selector: { matchLabels: tq.config.podLabelSelector },
template: {
metadata: {
labels: tq.config.commonLabels,
},
spec: {
containers: [c],
securityContext: tq.config.securityContext,
serviceAccountName: tq.serviceAccount.metadata.name,
terminationGracePeriodSeconds: 120,
nodeSelector: {
'kubernetes.io/os': 'linux',
},
affinity: { podAntiAffinity: {
preferredDuringSchedulingIgnoredDuringExecution: [{
podAffinityTerm: {
namespaces: [tq.config.namespace],
topologyKey: 'kubernetes.io/hostname',
labelSelector: { matchExpressions: [{
key: 'app.kubernetes.io/name',
operator: 'In',
values: [tq.deployment.metadata.labels['app.kubernetes.io/name']],
}] },
},
weight: 100,
}],
} },
},
},
},
},
},
withExternalPrefix:: {
local tq = self,
config+:: {
externalPrefix: error 'must provide externalPrefix',
serviceMonitor: if tq.config.serviceMonitor == true then {
apiVersion: 'monitoring.coreos.com/v1',
kind: 'ServiceMonitor',
metadata+: {
name: tq.config.name,
namespace: tq.config.namespace,
labels: tq.config.commonLabels,
},
deployment+: {
spec+: {
template+: {
spec+: {
containers: [
if c.name == 'thanos-query' then c {
args+: [
'--web.external-prefix=' + tq.config.externalPrefix,
],
} else c
for c in super.containers
],
},
},
spec: {
selector: {
matchLabels: tq.config.podLabelSelector,
},
},
},
withQueryTimeout:: {
local tq = self,
config+:: {
queryTimeout: error 'must provide queryTimeout',
},
deployment+: {
spec+: {
template+: {
spec+: {
containers: [
if c.name == 'thanos-query' then c {
args+: [
'--query.timeout=' + tq.config.queryTimeout,
],
} else c
for c in super.containers
],
},
endpoints: [
{
port: 'http',
relabelings: [{
action: 'replace',
sourceLabels: ['namespace', 'pod'],
separator: '/',
targetLabel: 'instance',
}],
},
},
],
},
},
}

View File

@ -0,0 +1,73 @@
// These are the defaults for this components configuration.
// When calling the function to generate the component's manifest,
// you can pass an object structured like the default to overwrite default values.
{
local defaults = self,
name: 'thanos-receive',
namespace: error 'must provide namespace',
version: error 'must provide version',
image: error 'must provide image',
imagePullPolicy: 'IfNotPresent',
replicas: error 'must provide replicas',
minReadySeconds: 0,
replicationFactor: error 'must provide replication factor',
objectStorageConfig: error 'must provide objectStorageConfig',
podDisruptionBudgetMaxUnavailable: (std.floor(defaults.replicationFactor / 2)),
hashringConfigMapName: '',
enableLocalEndpoint: true,
volumeClaimTemplate: {},
retention: '15d',
logLevel: 'info',
logFormat: 'logfmt',
resources: {},
serviceMonitor: false,
ports: {
grpc: 10901,
http: 10902,
'remote-write': 19291,
},
tracing: {},
labels: [
'replica="$(NAME)"',
'receive="true"',
],
tenantLabelName: null,
tenantHeader: null,
clusterDomain: 'cluster.local',
extraEnv: [],
receiveLimitsConfigFile: {},
storeLimits: {},
commonLabels:: {
'app.kubernetes.io/name': 'thanos-receive',
'app.kubernetes.io/instance': defaults.name,
'app.kubernetes.io/version': defaults.version,
'app.kubernetes.io/component': 'database-write-hashring',
},
podLabelSelector:: {
[labelName]: defaults.commonLabels[labelName]
for labelName in std.objectFields(defaults.commonLabels)
if labelName != 'app.kubernetes.io/version'
},
securityContext:: {
fsGroup: 65534,
runAsUser: 65534,
runAsGroup: 65532,
runAsNonRoot: true,
seccompProfile: { type: 'RuntimeDefault' },
},
securityContextContainer:: {
runAsUser: defaults.securityContext.runAsUser,
runAsGroup: defaults.securityContext.runAsGroup,
runAsNonRoot: defaults.securityContext.runAsNonRoot,
seccompProfile: defaults.securityContext.seccompProfile,
allowPrivilegeEscalation: false,
readOnlyRootFilesystem: true,
capabilities: { drop: ['ALL'] },
},
serviceAccountAnnotations:: {},
}

Some files were not shown because too many files have changed in this diff Show More