[bitnami/thanos]Add option to configure index storegateway (#3400)

* Add option to configure index storegateway

* Formatting with new line

* Fix lint issue.
This commit is contained in:
Charlie Nederhoed
2020-08-12 19:07:59 +02:00
committed by GitHub
parent ddf2c9e2a7
commit 7bc2bce709
7 changed files with 67 additions and 1 deletions

View File

@@ -1,5 +1,5 @@
apiVersion: v1
version: 2.2.0
version: 2.3.0
appVersion: 0.14.0
description: Thanos is a highly available metrics system that can be added on top of existing Prometheus deployments, providing a global query view across all Prometheus installations.
engine: gotpl

View File

@@ -277,6 +277,8 @@ The following tables lists the configurable parameters of the Thanos chart and t
| `storegateway.enabled` | Enable/disable Thanos Store Gateway component | `false` |
| `storegateway.logLevel` | Thanos Store Gateway log level | `info` |
| `storegateway.extraFlags` | Extra Flags to passed to Thanos Store Gateway | `[]` |
| `storegateway.config` | Thanos Store Gateway cache configuration | `nil` |
| `storegateway.existingConfigmap` | Name of existing ConfigMap with Thanos Store Gateway cache configuration | `nil` |
| `storegateway.updateStrategyType` | Statefulset Update Strategy Type | `RollingUpdate` |
| `storegateway.replicaCount` | Number of Thanos Store Gateway replicas to deploy | `1` |
| `storegateway.affinity` | Affinity for pod assignment | `{}` (evaluated as a template) |

View File

@@ -206,6 +206,27 @@ Return true if a configmap object should be created
{{- end -}}
{{- end -}}
{{/*
Return the Thanos storegateway configuration configmap.
*/}}
{{- define "thanos.storegateway.configmapName" -}}
{{- if .Values.storegateway.existingConfigmap -}}
{{- printf "%s" (tpl .Values.storegateway.existingConfigmap $) -}}
{{- else -}}
{{- printf "%s-storegateway-configmap" (include "thanos.fullname" .) -}}
{{- end -}}
{{- end -}}
{{/*
Return true if a configmap object should be created
*/}}
{{- define "thanos.storegateway.createConfigmap" -}}
{{- if and .Values.storegateway.config (not .Values.storegateway.existingConfigmap) }}
{{- true -}}
{{- else -}}
{{- end -}}
{{- end -}}
{{/*
Return the Thanos Compactor pvc name
*/}}

View File

@@ -0,0 +1,11 @@
{{- if (include "thanos.storegateway.createConfigmap" .) }}
apiVersion: v1
kind: ConfigMap
metadata:
name: {{ include "thanos.fullname" . }}-storegateway-configmap
labels: {{- include "thanos.labels" . | nindent 4 }}
app.kubernetes.io/component: storegateway
data:
config.yml: |-
{{- include "thanos.tplValue" (dict "value" .Values.storegateway.config "context" $) | nindent 4 }}
{{ end }}

View File

@@ -83,6 +83,9 @@ spec:
{{- if .Values.bucketCacheConfig }}
- --store.caching-bucket.config-file=/conf/bucket-cache.yml
{{- end }}
{{- if or .Values.storegateway.config .Values.storegateway.existingConfigmap }}
- --index-cache.config-file=/conf/cache/config.yml
{{- end }}
{{- range .Values.storegateway.extraFlags }}
- {{ . }}
{{- end }}
@@ -107,6 +110,10 @@ spec:
mountPath: /conf
- name: data
mountPath: /data
{{- if or .Values.storegateway.config .Values.storegateway.existingConfigmap }}
- name: cache-config
mountPath: /conf/cache
{{- end }}
volumes:
- name: objstore-config
secret:
@@ -114,6 +121,11 @@ spec:
{{- if .Values.existingObjstoreSecretItems }}
items: {{- toYaml .Values.existingObjstoreSecretItems | nindent 14 }}
{{- end }}
{{- if or .Values.storegateway.config .Values.storegateway.existingConfigmap }}
- name: cache-config
configMap:
name: {{ include "thanos.storegateway.configmapName" . }}
{{- end }}
{{- if and .Values.storegateway.persistence.enabled .Values.storegateway.persistence.existingClaim }}
- name: data
persistentVolumeClaim:

View File

@@ -741,6 +741,16 @@ storegateway:
##
extraFlags: []
## Store Gateway Cache Configuration
## Specify content for config.yml
##
# config:
## ConfigMap with Store Gateway Cache Configuration
## NOTE: This will override storegateway.config
##
# existingConfigmap:
## Number of Thanos Store Gateway replicas to deploy
##
replicaCount: 1

View File

@@ -753,6 +753,16 @@ storegateway:
##
extraFlags: []
## Store Gateway Cache Configuration
## Specify content for config.yml
##
# config:
## ConfigMap with Store Gateway Cache Configuration
## NOTE: This will override storegateway.config
##
# existingConfigmap:
## Number of Thanos Store Gateway replicas to deploy
##
replicaCount: 1