Skip to content

Commit 7c2bbb4

Browse files
authored
feat(thanos): remove standalone ref + update docs (#1100)
* thanos chart + docs cleanup * patch * sd-config fix templating * minor version
1 parent 6e0b005 commit 7c2bbb4

File tree

12 files changed

+32
-46
lines changed

12 files changed

+32
-46
lines changed

thanos/README.md

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -170,19 +170,21 @@ Thanos Query would check for a Thanos endpoint named like `releaseName-store`. T
170170

171171
`--store=thanos-kube-store:10901`
172172

173-
If you just have one occurence of this Thanos plugin dpeloyed, the default option would work and does not need anything else.
173+
If you just have one occurence of this Thanos plugin deployed, the default option would work and does not need anything else.
174174

175175
### Standalone Query
176176

177177
![Standalone Query](img/thanos_standalone_query.png)
178178

179-
In case you want to achieve a setup like above and have an overarching Thanos Query to run with multiple Stores, you can set it to `standalone` and add your own store list. Setup your Plugin like this:
179+
In case you want to achieve a setup like above and have an overarching Thanos Query to run with multiple Stores, you can disable all other thanos components and add your own store list. Setup your Plugin like this:
180180

181181
```yaml
182182
spec:
183183
optionsValues:
184-
- name: thanos.query.standalone
185-
value: true
184+
- name: thanos.store.enabled
185+
value: false
186+
- name: thanos.compactor.enabled
187+
value: false
186188
```
187189

188190
This would enable you to either:
@@ -260,7 +262,7 @@ It is possible to disable certain Thanos components for your deployment. To do s
260262

261263
| Thanos Component | Enabled by default | Deactivatable | Flag |
262264
|---|---|---|---|
263-
| Query | True | False | n/a |
265+
| Query | True | True | thanos.query.enabled |
264266
| Store | True | True | thanos.store.enabled |
265267
| Compactor | True | True | thanos.compactor.enabled |
266268
| Ruler | False | True | thanos.ruler.enabled |
@@ -381,16 +383,15 @@ If Blackbox-exporter is enabled and store endpoints are provided, this Thanos de
381383
| thanos.query.persesDatasource.create | bool | `true` | Creates a Perses datasource for Thanos Query |
382384
| thanos.query.persesDatasource.isDefault | bool | `true` | set datasource as default for Perses. Consider setting this to `false` only if you have another (default) datasource for Perses already. |
383385
| thanos.query.persesDatasource.selector | object | `{}` | Label selectors for the Perses sidecar to detect this datasource. |
384-
| thanos.query.plutonoDatasource.create | bool | `false` | Creates a Perses datasource for standalone Thanos Query |
386+
| thanos.query.plutonoDatasource.create | bool | `false` | Creates a Perses datasource for Thanos Query |
385387
| thanos.query.plutonoDatasource.isDefault | bool | `false` | set datasource as default for Plutono |
386388
| thanos.query.plutonoDatasource.selector | object | `{}` | Label selectors for the Plutono sidecar to detect this datasource. |
387389
| thanos.query.replicaLabel | string | `"prometheus_replica"` | Set Thanos Query replica-label for Prometheus replicas |
388390
| thanos.query.replicas | string | `nil` | Number of Thanos Query replicas to deploy |
389391
| thanos.query.resources | object | <pre>ressources:<br> requests:<br> memory:<br> cpu:<br> limits:<br> memory:<br> cpu:<br></pre> | Resource requests and limits for the Thanos Query container. |
390392
| thanos.query.serviceAnnotations | object | `{}` | Service specific annotations to add to the Thanos Query service in addition to its already configured annotations. |
391393
| thanos.query.serviceLabels | object | `{}` | Labels to add to the Thanos Query service |
392-
| thanos.query.standalone | bool | `false` | |
393-
| thanos.query.stores | list | `[]` | |
394+
| thanos.query.stores | list | `[]` | Thanos Query store endpoints |
394395
| thanos.query.tls.data | object | `{}` | |
395396
| thanos.query.tls.secretName | string | `""` | |
396397
| thanos.query.web.externalPrefix | string | `nil` | |

thanos/README.md.gotmpl

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -170,19 +170,21 @@ Thanos Query would check for a Thanos endpoint named like `releaseName-store`. T
170170

171171
`--store=thanos-kube-store:10901`
172172

173-
If you just have one occurence of this Thanos plugin dpeloyed, the default option would work and does not need anything else.
173+
If you just have one occurence of this Thanos plugin deployed, the default option would work and does not need anything else.
174174

175175
### Standalone Query
176176

177177
![Standalone Query](img/thanos_standalone_query.png)
178178

179-
In case you want to achieve a setup like above and have an overarching Thanos Query to run with multiple Stores, you can set it to `standalone` and add your own store list. Setup your Plugin like this:
179+
In case you want to achieve a setup like above and have an overarching Thanos Query to run with multiple Stores, you can disable all other thanos components and add your own store list. Setup your Plugin like this:
180180

181181
```yaml
182182
spec:
183183
optionsValues:
184-
- name: thanos.query.standalone
185-
value: true
184+
- name: thanos.store.enabled
185+
value: false
186+
- name: thanos.compactor.enabled
187+
value: false
186188
```
187189

188190
This would enable you to either:
@@ -260,7 +262,7 @@ It is possible to disable certain Thanos components for your deployment. To do s
260262

261263
| Thanos Component | Enabled by default | Deactivatable | Flag |
262264
|---|---|---|---|
263-
| Query | True | False | n/a |
265+
| Query | True | True | thanos.query.enabled |
264266
| Store | True | True | thanos.store.enabled |
265267
| Compactor | True | True | thanos.compactor.enabled |
266268
| Ruler | False | True | thanos.ruler.enabled |

thanos/charts/Chart.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ maintainers:
1111
name: thanos
1212
sources:
1313
- https://github.com/cloudoperators/greenhouse-extensions
14-
version: 0.6.5
14+
version: 0.7.0
1515
keywords:
1616
- thanos
1717
- storage

thanos/charts/templates/compactor/deployment.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
{{ if and .Values.thanos.compactor.enabled (not .Values.thanos.query.standalone) }}
1+
{{ if and .Values.thanos.compactor.enabled }}
22
apiVersion: apps/v1
33
kind: Deployment
44
metadata:

thanos/charts/templates/compactor/pvc.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
{{ if and .Values.thanos.compactor.enabled (not .Values.thanos.query.standalone) }}
1+
{{ if and .Values.thanos.compactor.enabled }}
22
apiVersion: v1
33
kind: PersistentVolumeClaim
44
metadata:

thanos/charts/templates/compactor/service.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
{{ if and .Values.thanos.compactor.enabled (not .Values.thanos.query.standalone) }}
1+
{{ if and .Values.thanos.compactor.enabled }}
22
apiVersion: v1
33
kind: Service
44
metadata:

thanos/charts/templates/query/sd-config.yaml

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,11 @@ data:
1313
endpoint-targets.yaml: |-
1414
endpoints:
1515
{{- /* Technically it is possible to add stores and have the default stores all together.*/}}
16-
{{- /* Enabling standalone would remove the default stores for an empty store list to be maintained entirely manual.*/}}
17-
{{- if and (empty .Values.thanos.query.stores) (.Values.thanos.query.standalone) }}
18-
{{- fail "WARNING Thanos Query will have no data. Either unset thanos.query.standalone or specify thanos.query.stores." -}}
19-
{{- end }}
16+
{{- if not (empty .Values.thanos.query.stores) }}
2017
{{- range .Values.thanos.query.stores }}
2118
- address: "{{ . }}"
2219
{{- end -}}
23-
{{- if not .Values.thanos.query.standalone }}
20+
{{- else }}
2421
- address: "prometheus-operated:10901"
2522
- address: "{{ include "release.name" . }}-store:{{ default "10901" .Values.thanos.grpcAddress }}"
2623
{{- end }}

thanos/charts/templates/store/deployment.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
{{ if and .Values.thanos.store.enabled (not .Values.thanos.query.standalone) }}
1+
{{ if and .Values.thanos.store.enabled }}
22
apiVersion: apps/v1
33
kind: Deployment
44
metadata:

thanos/charts/templates/store/service.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
{{ if and .Values.thanos.store.enabled (not .Values.thanos.query.standalone) }}
1+
{{ if and .Values.thanos.store.enabled }}
22
apiVersion: v1
33
kind: Service
44
metadata:

thanos/charts/templates/tests/test-thanos-config.yaml

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ data:
2323
verify "there is 1 service named '{{ .Release.Name }}-query'"
2424
verify "there is 1 configmap named '{{ .Release.Name }}-sd-config'"
2525
try "at most 3 times every 5s to get pods named '{{ .Release.Name }}-query' and verify that '.status.phase' is 'running'"
26+
try "at most 3 times every 5s to get pods named 'prometheus-.*-[0-9]$' and verify that '.status.containerStatuses[*].name' is 'config-reloader,prometheus,thanos-sidecar'"
2627
2728
endpoints=$(kubectl get cm {{ .Release.Name }}-sd-config -oyaml | yq '.data["endpoint-targets.yaml"] | select(. != null)' | yq '.endpoints[].address')
2829
for endpoint in $endpoints; do
@@ -37,15 +38,15 @@ data:
3738
done
3839
}
3940
40-
{{ if and .Values.thanos.store.enabled (not .Values.thanos.query.standalone) }}
41+
{{ if and .Values.thanos.store.enabled }}
4142
@test "Verify {{ .Release.Name }} Store" {
4243
verify "there is 1 deployment named '{{ .Release.Name }}-store'"
4344
verify "there is 1 service named '{{ .Release.Name }}-store'"
4445
try "at most 3 times every 5s to get pods named '{{ .Release.Name }}-store' and verify that '.status.phase' is 'running'"
4546
}
4647
{{ end }}
4748
48-
{{ if and .Values.thanos.compactor.enabled (not .Values.thanos.query.standalone) }}
49+
{{ if and .Values.thanos.compactor.enabled }}
4950
@test "Verify {{ .Release.Name }} Compactor" {
5051
verify "there is 1 deployment named '{{ .Release.Name }}-compactor'"
5152
verify "there is 1 service named '{{ .Release.Name }}-compactor'"
@@ -76,12 +77,6 @@ data:
7677
}
7778
{{ end }}
7879
79-
{{ if (not .Values.thanos.query.standalone) }}
80-
@test "Verify prometheus sidecar is running" {
81-
try "at most 3 times every 5s to get pods named 'prometheus-.*-[0-9]$' and verify that '.status.containerStatuses[*].name' is 'config-reloader,prometheus,thanos-sidecar'"
82-
}
83-
{{ end }}
84-
8580
{{- if and .Values.thanos.query.ingress.grpc.enabled .Values.thanos.query.ingress.grpc.hosts .Values.thanos.query.ingress.grpc.tls (not .Values.ci.enabled ) }}
8681
@test "Verify the availability of the Thanos Query API Ingress hostname by using the created certificates" {
8782
url="{{ (first .Values.thanos.query.ingress.grpc.hosts).host }}:443"

0 commit comments

Comments
 (0)